Commit de8843be by 阳浪

配置信息

parent 1ed1e0cc
...@@ -81,5 +81,9 @@ ...@@ -81,5 +81,9 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<!-- 跳过测试 -->
<skipTests>true</skipTests>
</properties>
</project> </project>
...@@ -2,6 +2,7 @@ package com.yizhi.course.application; ...@@ -2,6 +2,7 @@ package com.yizhi.course.application;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
...@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @Date: 2018/1/22 11:07 * @Date: 2018/1/22 11:07
*/ */
@EnableTransactionManagement @EnableTransactionManagement
@SpringBootApplication @SpringBootApplication(exclude = {RabbitAutoConfiguration.class})
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.yizhi"}) @EnableFeignClients(basePackages = {"com.yizhi"})
@ComponentScan(basePackages = {"com.yizhi"}) @ComponentScan(basePackages = {"com.yizhi"})
......
...@@ -28,7 +28,6 @@ import com.yizhi.util.application.event.TrainingProjectEvent; ...@@ -28,7 +28,6 @@ import com.yizhi.util.application.event.TrainingProjectEvent;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -56,9 +55,9 @@ public class CourseStudyController { ...@@ -56,9 +55,9 @@ public class CourseStudyController {
@Autowired @Autowired
PointRedisFeignClients pointRedisFeignClients; PointRedisFeignClients pointRedisFeignClients;
/*
@Autowired @Autowired
AmqpTemplate amqpTemplate; AmqpTemplate amqpTemplate;*/
@Autowired @Autowired
private ICourseService courseService; private ICourseService courseService;
...@@ -947,7 +946,7 @@ public class CourseStudyController { ...@@ -947,7 +946,7 @@ public class CourseStudyController {
LOGGER.info("准备发送积分,设置{}对象到redis,sitePointId={}", pointParamVO, sitePointId); LOGGER.info("准备发送积分,设置{}对象到redis,sitePointId={}", pointParamVO, sitePointId);
if (null != sitePointId) { if (null != sitePointId) {
//发送积分获取消息 //发送积分获取消息
amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE. //amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE.
// 配合小伟的经验发放 // 配合小伟的经验发放
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO); /*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId); LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
......
...@@ -43,8 +43,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException; ...@@ -43,8 +43,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -84,11 +82,11 @@ public class OfflineRecordeController { ...@@ -84,11 +82,11 @@ public class OfflineRecordeController {
private IdGenerator idGenerator; private IdGenerator idGenerator;
@Autowired @Autowired
private LogEventPublisher logEventPublisher; private LogEventPublisher logEventPublisher;
/*@Autowired
AmqpTemplate amqpTemplate;*/
/*
@Autowired @Autowired
AmqpTemplate amqpTemplate; RabbitTemplate rabbitTemplate;*/
@Autowired
RabbitTemplate rabbitTemplate;
@Autowired @Autowired
private TaskExecutor taskExecutor; private TaskExecutor taskExecutor;
...@@ -512,7 +510,7 @@ public class OfflineRecordeController { ...@@ -512,7 +510,7 @@ public class OfflineRecordeController {
} }
// 错误的信息发送给任务详情表 // 错误的信息发送给任务详情表
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(failEvents)) { if (org.apache.commons.collections.CollectionUtils.isNotEmpty(failEvents)) {
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents); //rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
} }
result.put("success", recordes); result.put("success", recordes);
result.put("error", Collections.singletonList("成功导入" + passCount + "条,失败" + failCount + "条")); result.put("error", Collections.singletonList("成功导入" + passCount + "条,失败" + failCount + "条"));
...@@ -607,7 +605,7 @@ public class OfflineRecordeController { ...@@ -607,7 +605,7 @@ public class OfflineRecordeController {
String sitePointId = pointRedisFeignClients.addPointRedis(pointParamVO); String sitePointId = pointRedisFeignClients.addPointRedis(pointParamVO);
// 发送积分 // 发送积分
if (StringUtils.isNotBlank(sitePointId)) { if (StringUtils.isNotBlank(sitePointId)) {
amqpTemplate.convertAndSend("offlineCourse", sitePointId); //amqpTemplate.convertAndSend("offlineCourse", sitePointId);
} }
} }
......
...@@ -53,7 +53,7 @@ public class MybatisCodeGenerator { ...@@ -53,7 +53,7 @@ public class MybatisCodeGenerator {
return super.processTypeConvert(fieldType); return super.processTypeConvert(fieldType);
} }
}); });
dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root"); dsc.setUsername("root");
dsc.setPassword("fulan123"); dsc.setPassword("fulan123");
dsc.setUrl("jdbc:mysql://180.169.149.5:11306/cloud_statistics?characterEncoding=utf8"); dsc.setUrl("jdbc:mysql://180.169.149.5:11306/cloud_statistics?characterEncoding=utf8");
......
...@@ -25,7 +25,6 @@ import com.yizhi.util.application.date.DateUtil; ...@@ -25,7 +25,6 @@ import com.yizhi.util.application.date.DateUtil;
import com.yizhi.util.application.event.TrainingProjectEvent; import com.yizhi.util.application.event.TrainingProjectEvent;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -33,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -33,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -57,8 +57,8 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements ...@@ -57,8 +57,8 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
private CloudEventPublisher cloudEventPublisher; private CloudEventPublisher cloudEventPublisher;
@Autowired @Autowired
private PointRedisFeignClients pointRedisFeignClients; private PointRedisFeignClients pointRedisFeignClients;
@Autowired /*@Autowired
private AmqpTemplate amqpTemplate; private AmqpTemplate amqpTemplate;*/
@Autowired @Autowired
private IRecordeService recordeService; private IRecordeService recordeService;
@Autowired @Autowired
...@@ -80,7 +80,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements ...@@ -80,7 +80,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
@Autowired @Autowired
private ICourseMqRecordService courseMqRecordService; private ICourseMqRecordService courseMqRecordService;
@Autowired @Resource
private ScormMapper scormMapper; private ScormMapper scormMapper;
@Autowired @Autowired
...@@ -905,7 +905,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements ...@@ -905,7 +905,7 @@ public class ScormServiceImpl extends ServiceImpl<ScormMapper, Scorm> implements
String sitePointId = pointRedisFeignClients.addPointRedis(pointParamVO); String sitePointId = pointRedisFeignClients.addPointRedis(pointParamVO);
if (null != sitePointId) { if (null != sitePointId) {
//发送积分获取消息 //发送积分获取消息
amqpTemplate.convertAndSend(mqName, sitePointId); //amqpTemplate.convertAndSend(mqName, sitePointId);
return "ok"; return "ok";
} }
return "sitePointId 为null"; return "sitePointId 为null";
......
...@@ -17,7 +17,6 @@ import com.yizhi.point.application.feign.PointUserFeignClients; ...@@ -17,7 +17,6 @@ import com.yizhi.point.application.feign.PointUserFeignClients;
import com.yizhi.point.application.vo.PointParamVO; import com.yizhi.point.application.vo.PointParamVO;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -51,8 +50,8 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String ...@@ -51,8 +50,8 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
@Autowired @Autowired
PointUserFeignClients pointUserFeignClients; PointUserFeignClients pointUserFeignClients;
@Autowired /* @Autowired
AmqpTemplate amqpTemplate; AmqpTemplate amqpTemplate;*/
// 课程积分发放的事件名称 // 课程积分发放的事件名称
private static final String EVENT_NAME = "pointCourse"; private static final String EVENT_NAME = "pointCourse";
...@@ -320,7 +319,7 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String ...@@ -320,7 +319,7 @@ public class CoursePointInitAsync extends AbstractDefaultTask<String, Map<String
logger.info("准备发送积分,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId); logger.info("准备发送积分,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
if (null != sitePointId) { if (null != sitePointId) {
//发送积分获取消息 //发送积分获取消息
amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE. // amqpTemplate.convertAndSend(mqKey, sitePointId); //web端 定义 MQqueuesEnum.COURSE.
// 配合小伟的经验发放 // 配合小伟的经验发放
/*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO); /*String sitePointId1 = pointRedisFeignClients.addPointRedis(pointParamVO);
LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId); LOGGER.info("积分发放完毕,准备发送经验值,设置{}对象到redis,sitePointId={}",pointParamVO,sitePointId);
......
server.port=32000 server.port=32000
spring.application.name=course spring.application.name=course
ACTIVE=${spring.profiles.active} ACTIVE=${spring.profiles.active}
spring.profiles.active=dev spring.profiles.active=prod
# nacos # nacos
spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace=${spring.profiles.active} spring.cloud.nacos.config.namespace=${spring.profiles.active}
spring.cloud.nacos.config.prefix=${spring.application.name} spring.cloud.nacos.config.prefix=${spring.application.name}
spring.cloud.nacos.config.file-extension=properties spring.cloud.nacos.config.file-extension=properties
#spring.cloud.nacos.config.server-addr=92.168.1.13:3333,192.168.1.24:4444,192.168.1.38:5555 #spring.cloud.nacos.config.server-addr=92.168.1.13:3333,192.168.1.24:4444,192.168.1.38:5555
spring.cloud.nacos.config.server-addr=192.168.1.22:3333,192.168.1.22:4444,192.168.1.22:5555 spring.cloud.nacos.config.server-addr=10.23.1.183:8848
\ No newline at end of file \ No newline at end of file
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<repositories> <repositories>
<repository> <repository>
<id>learning-data-group</id> <id>hqzhdj-data-group</id>
<url>http://192.168.0.15:8081/repository/learning-data-group/</url> <url>http://192.168.0.15:8081/repository/hqzhdj-data-group/</url>
<releases> <releases>
<enabled>true</enabled> <enabled>true</enabled>
</releases> </releases>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment