修改前端部署路径

pull/2/head
weir 2021-07-25 16:24:45 +08:00
parent b5695494c2
commit d5997c4dc0
3 changed files with 33 additions and 10 deletions

View File

@ -1,19 +1,25 @@
package cn.iocoder.yudao.adminserver.modules.infra.controller.job;
import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*;
import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.quartz.core.util.CronUtils;
import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*;
import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert;
import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO;
import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.impl.StdScheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;
import org.springframework.scheduling.config.ScheduledTask;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -22,10 +28,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@ -39,6 +42,15 @@ public class InfJobController {
@Resource
private InfJobService jobService;
@Autowired
private SchedulerFactoryBean schedulerFactoryBean;
@Autowired
private StdScheduler stdScheduler;
@Autowired
private ScheduledAnnotationBeanPostProcessor scheduledAnnotationBeanPostProcessor;
@PostMapping("/create")
@ApiOperation("创建定时任务")
@PreAuthorize("@ss.hasPermission('infra:job:create')")
@ -111,6 +123,15 @@ public class InfJobController {
@PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<PageResult<InfJobRespVO>> getJobPage(@Valid InfJobPageReqVO pageVO) {
PageResult<InfJobDO> pageResult = jobService.getJobPage(pageVO);
Scheduler scheduler = schedulerFactoryBean.getScheduler();
Set<ScheduledTask> scheduledTasks = scheduledAnnotationBeanPostProcessor.getScheduledTasks();
Iterator<ScheduledTask> scheduledTaskIterator = scheduledTasks.iterator();
while (scheduledTaskIterator.hasNext()) {
System.err.println("=================================");
ScheduledTask scheduledTask = scheduledTaskIterator.next();
scheduledAnnotationBeanPostProcessor.postProcessAfterInitialization(scheduledTask, scheduledTask.toString());
System.err.println("=================================");
}
return success(InfJobConvert.INSTANCE.convertPage(pageResult));
}

View File

@ -3,3 +3,5 @@ ENV = 'production'
# 芋道管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'
# 静态资源地址
PUBLIC_PATH = 'yudao-admin'

View File

@ -10,7 +10,7 @@ pipeline {
}
environment {
APP_NAME = 'yudao-admin-ui'
APP_NAME = 'yudao-admin'
NGINX_WORKDIR = '/home/pi/mydata/nginx/html/'
}
@ -31,7 +31,7 @@ pipeline {
stage('部署') {
steps {
sh 'cp -rf ' + "${env.APP_NAME}" + '/dist/. ' + "${env.NGINX_WORKDIR}"
sh 'cp -rf ' + "${env.APP_NAME}" + '/dist/. ' + "${env.NGINX_WORKDIR}" + "${env.APP_NAME}"
sh 'tar -zcvf ' + "${env.APP_NAME}" + '/'+ "${env.APP_NAME}" + '.tar.gz ' + "${env.APP_NAME}" + '/dist/'
archiveArtifacts "${env.APP_NAME}" + '/'+ "${env.APP_NAME}" + '.tar.gz'
//TODO 考虑刷新缓存的问题