Commit 9482b3b220e628f7713ff8ab04575b436ff60ee5
1 parent
d5997c4d
1. 修改日志 2.回退提交测试代码 3. 修改配置
Showing
3 changed files
with
16 additions
and
30 deletions
Jenkinsfile
| @@ -36,6 +36,13 @@ pipeline { | @@ -36,6 +36,13 @@ pipeline { | ||
| 36 | 36 | ||
| 37 | stage('构建') { | 37 | stage('构建') { |
| 38 | steps { | 38 | steps { |
| 39 | + // TODO 解决多环境链接、密码不同配置临时方案 | ||
| 40 | + sh 'if [ ! -d "' + "${env.HOME}" + '/resources" ];then\n' + | ||
| 41 | + ' echo "配置文件不存在无需修改"\n' + | ||
| 42 | + 'else\n' + | ||
| 43 | + ' cp -rf /home/pi/resources/*.yaml ' + "${env.APP_NAME}" + '/src/main/resources\n' + | ||
| 44 | + ' echo "配置文件替换"\n' + | ||
| 45 | + 'fi' | ||
| 39 | sh 'mvn clean package -Dmaven.test.skip=true' | 46 | sh 'mvn clean package -Dmaven.test.skip=true' |
| 40 | } | 47 | } |
| 41 | } | 48 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/job/InfJobController.java
| 1 | package cn.iocoder.yudao.adminserver.modules.infra.controller.job; | 1 | package cn.iocoder.yudao.adminserver.modules.infra.controller.job; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*; | ||
| 4 | -import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert; | ||
| 5 | -import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO; | ||
| 6 | -import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService; | ||
| 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 5 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 10 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | 6 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 11 | import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; | 7 | import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; |
| 8 | +import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*; | ||
| 9 | +import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert; | ||
| 10 | +import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO; | ||
| 11 | +import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService; | ||
| 12 | import io.swagger.annotations.Api; | 12 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiImplicitParam; | 13 | import io.swagger.annotations.ApiImplicitParam; |
| 14 | import io.swagger.annotations.ApiImplicitParams; | 14 | import io.swagger.annotations.ApiImplicitParams; |
| 15 | import io.swagger.annotations.ApiOperation; | 15 | import io.swagger.annotations.ApiOperation; |
| 16 | -import org.quartz.Scheduler; | ||
| 17 | import org.quartz.SchedulerException; | 16 | import org.quartz.SchedulerException; |
| 18 | -import org.quartz.impl.StdScheduler; | ||
| 19 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | -import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor; | ||
| 21 | -import org.springframework.scheduling.config.ScheduledTask; | ||
| 22 | -import org.springframework.scheduling.quartz.SchedulerFactoryBean; | ||
| 23 | import org.springframework.security.access.prepost.PreAuthorize; | 17 | import org.springframework.security.access.prepost.PreAuthorize; |
| 24 | import org.springframework.validation.annotation.Validated; | 18 | import org.springframework.validation.annotation.Validated; |
| 25 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
| @@ -28,7 +22,10 @@ import javax.annotation.Resource; | @@ -28,7 +22,10 @@ import javax.annotation.Resource; | ||
| 28 | import javax.servlet.http.HttpServletResponse; | 22 | import javax.servlet.http.HttpServletResponse; |
| 29 | import javax.validation.Valid; | 23 | import javax.validation.Valid; |
| 30 | import java.io.IOException; | 24 | import java.io.IOException; |
| 31 | -import java.util.*; | 25 | +import java.util.Collection; |
| 26 | +import java.util.Collections; | ||
| 27 | +import java.util.Date; | ||
| 28 | +import java.util.List; | ||
| 32 | 29 | ||
| 33 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 30 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 34 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | 31 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| @@ -42,15 +39,6 @@ public class InfJobController { | @@ -42,15 +39,6 @@ public class InfJobController { | ||
| 42 | @Resource | 39 | @Resource |
| 43 | private InfJobService jobService; | 40 | private InfJobService jobService; |
| 44 | 41 | ||
| 45 | - @Autowired | ||
| 46 | - private SchedulerFactoryBean schedulerFactoryBean; | ||
| 47 | - | ||
| 48 | - @Autowired | ||
| 49 | - private StdScheduler stdScheduler; | ||
| 50 | - | ||
| 51 | - @Autowired | ||
| 52 | - private ScheduledAnnotationBeanPostProcessor scheduledAnnotationBeanPostProcessor; | ||
| 53 | - | ||
| 54 | @PostMapping("/create") | 42 | @PostMapping("/create") |
| 55 | @ApiOperation("创建定时任务") | 43 | @ApiOperation("创建定时任务") |
| 56 | @PreAuthorize("@ss.hasPermission('infra:job:create')") | 44 | @PreAuthorize("@ss.hasPermission('infra:job:create')") |
| @@ -123,15 +111,6 @@ public class InfJobController { | @@ -123,15 +111,6 @@ public class InfJobController { | ||
| 123 | @PreAuthorize("@ss.hasPermission('infra:job:query')") | 111 | @PreAuthorize("@ss.hasPermission('infra:job:query')") |
| 124 | public CommonResult<PageResult<InfJobRespVO>> getJobPage(@Valid InfJobPageReqVO pageVO) { | 112 | public CommonResult<PageResult<InfJobRespVO>> getJobPage(@Valid InfJobPageReqVO pageVO) { |
| 125 | PageResult<InfJobDO> pageResult = jobService.getJobPage(pageVO); | 113 | PageResult<InfJobDO> pageResult = jobService.getJobPage(pageVO); |
| 126 | - Scheduler scheduler = schedulerFactoryBean.getScheduler(); | ||
| 127 | - Set<ScheduledTask> scheduledTasks = scheduledAnnotationBeanPostProcessor.getScheduledTasks(); | ||
| 128 | - Iterator<ScheduledTask> scheduledTaskIterator = scheduledTasks.iterator(); | ||
| 129 | - while (scheduledTaskIterator.hasNext()) { | ||
| 130 | - System.err.println("================================="); | ||
| 131 | - ScheduledTask scheduledTask = scheduledTaskIterator.next(); | ||
| 132 | - scheduledAnnotationBeanPostProcessor.postProcessAfterInitialization(scheduledTask, scheduledTask.toString()); | ||
| 133 | - System.err.println("================================="); | ||
| 134 | - } | ||
| 135 | return success(InfJobConvert.INSTANCE.convertPage(pageResult)); | 114 | return success(InfJobConvert.INSTANCE.convertPage(pageResult)); |
| 136 | } | 115 | } |
| 137 | 116 |
yudao-admin-server/src/main/resources/logback-spring.xml
| @@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
| 65 | </root> | 65 | </root> |
| 66 | </springProfile> | 66 | </springProfile> |
| 67 | <!-- 其它环境 --> | 67 | <!-- 其它环境 --> |
| 68 | - <springProfile name="default"> | 68 | + <springProfile name="dev,default"> |
| 69 | <root level="INFO"> | 69 | <root level="INFO"> |
| 70 | <appender-ref ref="STDOUT"/> | 70 | <appender-ref ref="STDOUT"/> |
| 71 | <appender-ref ref="ASYNC"/> | 71 | <appender-ref ref="ASYNC"/> |