Commit adbfbd48 by 阳浪

配置信息

parent 95905b35
...@@ -2,6 +2,7 @@ package com.yizhi.application; ...@@ -2,6 +2,7 @@ package com.yizhi.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.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
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;
...@@ -14,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -14,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
*/ */
@EnableTransactionManagement @EnableTransactionManagement
@EnableDiscoveryClient @EnableDiscoveryClient
@SpringBootApplication @SpringBootApplication(exclude = {RabbitAutoConfiguration.class})
@EnableFeignClients(basePackages = {"com.yizhi"}) @EnableFeignClients(basePackages = {"com.yizhi"})
@ComponentScan(basePackages = {"com.yizhi"}) @ComponentScan(basePackages = {"com.yizhi"})
public class LecturerApplication { public class LecturerApplication {
......
...@@ -30,7 +30,6 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -30,7 +30,6 @@ import org.apache.commons.collections.CollectionUtils;
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.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -65,8 +64,8 @@ public class LecturerImportServiceImpl implements ILecturerImportService { ...@@ -65,8 +64,8 @@ public class LecturerImportServiceImpl implements ILecturerImportService {
@Autowired @Autowired
private ILecturerRelationService lecturerRelationService; private ILecturerRelationService lecturerRelationService;
@Autowired /*@Autowired
private RabbitTemplate rabbitTemplate; private RabbitTemplate rabbitTemplate;*/
public final String COURSE = "线上"; public final String COURSE = "线上";
public final String OFFLINE_COURSE = "线下"; public final String OFFLINE_COURSE = "线下";
...@@ -183,7 +182,7 @@ public class LecturerImportServiceImpl implements ILecturerImportService { ...@@ -183,7 +182,7 @@ public class LecturerImportServiceImpl implements ILecturerImportService {
models.remove(0); models.remove(0);
//错误的信息发送给任务详情表 //错误的信息发送给任务详情表
if (CollectionUtils.isNotEmpty(failEvents)) { if (CollectionUtils.isNotEmpty(failEvents)) {
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents); // rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
} }
} else { } else {
...@@ -388,7 +387,7 @@ public class LecturerImportServiceImpl implements ILecturerImportService { ...@@ -388,7 +387,7 @@ public class LecturerImportServiceImpl implements ILecturerImportService {
models.remove(0); models.remove(0);
//错误的信息发送给任务详情表 //错误的信息发送给任务详情表
if (CollectionUtils.isNotEmpty(failEvents)) { if (CollectionUtils.isNotEmpty(failEvents)) {
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents); // rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
} }
} else { } else {
logger.info(ReturnCode.RESOURCE_NOT_FOUND.getMsg()); logger.info(ReturnCode.RESOURCE_NOT_FOUND.getMsg());
......
server.port=38001 server.port=38001
spring.application.name=lecturer spring.application.name=lecturer
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=192.168.1.22:3333 spring.cloud.nacos.config.server-addr=10.23.1.183:8848
\ No newline at end of file \ No newline at end of file
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,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