diff --git a/couplet-auth/src/main/java/com/couplet/auth/CoupletAuthApplication.java b/couplet-auth/src/main/java/com/couplet/auth/CoupletAuthApplication.java index 85bffb7..c1b4d46 100644 --- a/couplet-auth/src/main/java/com/couplet/auth/CoupletAuthApplication.java +++ b/couplet-auth/src/main/java/com/couplet/auth/CoupletAuthApplication.java @@ -4,6 +4,7 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; /** * 认证授权中心 @@ -12,6 +13,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; */ @EnableMyFeignClients @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +@ComponentScan(basePackages = {"com.couplet"}) public class CoupletAuthApplication { public static void main (String[] args) { SpringApplication.run(CoupletAuthApplication.class, args); diff --git a/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/utils/PageUtils.java b/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/utils/PageUtils.java index 0bba702..6e22147 100644 --- a/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/utils/PageUtils.java +++ b/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/utils/PageUtils.java @@ -1,9 +1,9 @@ package com.couplet.common.core.utils; +import com.couplet.common.core.web.page.TableSupport; import com.github.pagehelper.PageHelper; import com.couplet.common.core.utils.sql.SqlUtil; import com.couplet.common.core.web.page.PageDomain; -import com.couplet.common.core.web.page.TableSupport; /** * 分页工具类 diff --git a/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java b/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java index 676d61f..0e79eae 100644 --- a/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java +++ b/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java @@ -1,6 +1,7 @@ package com.couplet.common.redis.service; import com.couplet.common.domain.CoupletVehicleData; +import com.couplet.common.domain.request.RealTimeDataRequest; import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.*; @@ -167,31 +168,8 @@ public class RedisService { setOperation.add(it.next()); } return setOperation; - } /** - * 缓存Set - * - * @param key 缓存键值 - * @param dataSet 缓存的数据 - * - * @return 缓存数据的对象 - */ - public BoundSetOperations setCacheSet (final String key, final T dataSet) { - BoundSetOperations setOperation = redisTemplate.boundSetOps(key); - setOperation.add(dataSet); - return setOperation; } - /** - * 删除set - * @param key - * @param setValue - */ - public void deleteSet(String key, String setValue) { - - //缓存的键值 - BoundSetOperations setOperation = redisTemplate.boundSetOps(key); - setOperation.remove(setValue); //缓存的数据 - } /** * 获得缓存的set * @@ -203,7 +181,6 @@ public class RedisService { return redisTemplate.opsForSet().members(key); } - /** * 缓存Map * @@ -286,5 +263,8 @@ public class RedisService { return redisTemplate.keys(pattern); } - + public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) { + String key = "vin:"+realTimeDataRequest.getVin()+"userId:"+realTimeDataRequest.getUserId(); + redisTemplate.opsForValue().set(key, realTimeDataRequest); + } } diff --git a/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteDeptFallbackFactory.java b/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteDeptFallbackFactory.java index e0a1b6d..125fc9f 100644 --- a/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteDeptFallbackFactory.java +++ b/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteDeptFallbackFactory.java @@ -5,6 +5,7 @@ import com.couplet.common.system.domain.SysDept; import com.couplet.common.system.remote.RemoteDeptService; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; +import org.springframework.stereotype.Component; import java.util.List; @@ -15,7 +16,7 @@ import java.util.List; * @date 2024/3/27 15:29 */ @Slf4j - +@Component public class RemoteDeptFallbackFactory implements FallbackFactory { @Override public RemoteDeptService create(Throwable cause) { diff --git a/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteEmployeeFallbackFactory.java b/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteEmployeeFallbackFactory.java index 1687ff6..4fe3871 100644 --- a/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteEmployeeFallbackFactory.java +++ b/couplet-common/couplet-common-system/src/main/java/com/couplet/common/system/remote/factory/RemoteEmployeeFallbackFactory.java @@ -5,6 +5,7 @@ import com.couplet.common.core.web.page.TableDataInfo; import com.couplet.common.system.domain.SysUser; import com.couplet.common.system.remote.RemoteEmployeeService; import org.springframework.cloud.openfeign.FallbackFactory; +import org.springframework.stereotype.Component; import java.util.List; @@ -14,6 +15,7 @@ import java.util.List; * @description: 员工服务降级处理 * @date 2024/3/31 19:43 */ +@Component public class RemoteEmployeeFallbackFactory implements FallbackFactory { @Override public RemoteEmployeeService create(Throwable cause) { diff --git a/couplet-modules/couplet-business/pom.xml b/couplet-modules/couplet-business/pom.xml index 2a6efe6..a5aea00 100644 --- a/couplet-modules/couplet-business/pom.xml +++ b/couplet-modules/couplet-business/pom.xml @@ -92,7 +92,15 @@ org.springframework.boot spring-boot-starter-amqp - + + io.minio + minio + 7.1.0 + + + com.couplet + couplet-modules-mq + diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java index 4fc051b..2ef9e84 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java @@ -5,7 +5,9 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import com.couplet.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.stereotype.Component; /** * @Author: LiJiaYao diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleController.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleController.java index 299cdc2..7c6b294 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleController.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleController.java @@ -11,6 +11,7 @@ import com.couplet.common.domain.request.VehicleListParams; import com.couplet.common.log.annotation.Log; import com.couplet.common.log.enums.BusinessType; import com.couplet.common.security.annotation.RequiresPermissions; +import com.couplet.common.security.utils.SecurityUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; @@ -159,7 +160,7 @@ public class VehicleController extends BaseController { @PostMapping public Result addVehicle(@RequestBody VehicleMiddle vehicleMiddle){ - return Result.success(vehicleService.addVehicle(vehicleMiddle)); + return Result.success(vehicleService.addVehicle(SecurityUtils.getUserId(),vehicleMiddle.getVehicleIds())); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java index a96e616..6031e71 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java @@ -56,13 +56,7 @@ public class VehicleDetectionController { */ @PostMapping("/monitorinData/{vin}") public void monitorinData(@PathVariable String vin){ - String exchangeName = "exchangeName"; // 交换机名称 - String routingKey = "routingKey"; // 路由键 - RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest(); - Long userId = SecurityUtils.getUserId(); - realTimeDataRequest.setUserId(userId); - realTimeDataRequest.setVin(vin); - rabbitTemplate.convertAndSend(exchangeName, routingKey, realTimeDataRequest); + vehicleDetectionService.monitorinData(vin); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleMapper.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleMapper.java index 6a7374d..a8bd843 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleMapper.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleMapper.java @@ -22,9 +22,12 @@ public interface VehicleMapper extends BaseMapper { Integer deleteVehicle(Long middleId); - Integer addVehicle(VehicleMiddle vehicleMiddle); + List vehicleAll(); Integer onOrOutLineByVIN(@Param("vin") String vin, @Param("status") int status); + + + Integer addVehicle(@Param("userId") Long userId, @Param("vehicleIds") List vehicleIds); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java index 20f587f..a874703 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java @@ -9,4 +9,5 @@ public interface VehicleDetectionService { List detectionList(); + void monitorinData(String vin); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleService.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleService.java index 0712f58..4aba662 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleService.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleService.java @@ -33,10 +33,11 @@ public interface VehicleService extends IService { Integer deleteVehicle(Long middleId); - Integer addVehicle(VehicleMiddle vehicleMiddle); List vehicleAll(); Integer onOrOutLineByVIN(String s, int i); + + Integer addVehicle(Long userId, List vehicleIds); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java index 94c1ab1..52bf7a8 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java @@ -11,10 +11,13 @@ import com.couplet.common.domain.request.FenceRequest; import com.couplet.common.domain.request.FenceUpdateRequest; import com.couplet.common.redis.service.RedisService; import com.couplet.common.security.utils.SecurityUtils; +import com.couplet.mq.remote.RemoteFenceService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.concurrent.TimeUnit; @@ -40,12 +43,12 @@ public class FenceServiceImpl extends ServiceImpl implements * 注入redis模板 */ @Autowired - private RedisService redisService; + private StringRedisTemplate redisTemplate; /** * 远程调用队列服务 */ -// @Autowired -// private RemoteFenceService remoteFenceService; + @Autowired + private RemoteFenceService remoteFenceService; @Override public List pageQuery(FenceConfig fenceConfig) { @@ -54,7 +57,6 @@ public class FenceServiceImpl extends ServiceImpl implements } @Override - @Transactional(rollbackFor = Exception.class) public void changeFenceStatus(FenceUpdateRequest fenceUpdateRequest) { String username = SecurityUtils.getUsername(); @@ -63,31 +65,50 @@ public class FenceServiceImpl extends ServiceImpl implements /** * 电子围栏发送改变 */ -// redisService.setCacheObject("fence:info"+fenceUpdateRequest.getFenceId(),fenceUpdateRequest, 10, TimeUnit.MINUTES); + redisTemplate.opsForValue().set("changeFenceStatus", JSON.toJSONString(fenceUpdateRequest), 10, TimeUnit.MINUTES); + + remoteFenceService.fenceQueue(fenceUpdateRequest); + } + + @Override + public void fenceInsert(FenceRequest fenceRequest) { - redisService.setCacheObject("fence:info:"+fenceUpdateRequest.getFenceId(),fenceUpdateRequest); - redisService.expire("fence:info:"+fenceUpdateRequest.getFenceId(),10,TimeUnit.MINUTES); -// remoteFenceService.fenceQueue(fenceUpdateRequest); } /** * 业务实现:添加围栏 * + * @param request * @param fenceRequest */ - @Transactional(rollbackFor = Exception.class) - @Override - public void fenceInsert(FenceRequest fenceRequest) { - String username = SecurityUtils.getUsername(); - fenceRequest.setCrateName(username); - //先添加围栏 - fenceMapper.insertFence(fenceRequest); - fenAndLogoService.addBach(fenceRequest.getFenceId(), fenceRequest.getLogoIds()); - } +// @Override +// public void fenceInsert(HttpServletRequest request, FenceRequest fenceRequest) { +// String username = SecurityUtils.getUsername(); +// fenceRequest.setCrateName(username); +// //先添加围栏 +// fenceMapper.insertFence(fenceRequest); +// String[] logoIds = fenceRequest.getLogoIds(); +// String[] parts = new String[0]; +// for (String logoId : logoIds) { +// //把前台传入的字符串分割成数组 +// parts = logoId.split(","); +// //再添加围栏和标识中间表 +// fenAndLogoService.addBach(fenceRequest.getFenceId(), parts); +// } +// /** +// * 电子围栏发送改变 +// */ +// redisTemplate.opsForValue().set("fenceInsert", JSON.toJSONString(fenceRequest), 10, TimeUnit.MINUTES); +// } @Override public void removeByFenceId(Long fenceId) { fenceMapper.removeByFenceId(fenceId); + /** + * 电子围栏发送改变 + */ + redisTemplate.opsForValue().set("removeByFenceId", JSON.toJSONString(fenceId), 10, TimeUnit.MINUTES); + } @Override diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java index f1866a5..00a0a9a 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java @@ -1,12 +1,20 @@ package com.couplet.business.server.service.impl; +import com.alibaba.fastjson.JSON; import com.couplet.business.server.mapper.VehicleDetectionMapper; import com.couplet.business.server.service.VehicleDetectionService; import com.couplet.business.server.service.VehicleManageService; import com.couplet.common.core.domain.Result; import com.couplet.common.domain.Vehicle; +import com.couplet.common.domain.request.RealTimeDataRequest; +import com.couplet.common.redis.service.RedisService; +import com.couplet.common.security.utils.SecurityUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.mysql.cj.xdevapi.JsonString; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import springfox.documentation.spring.web.json.Json; import java.util.List; @@ -21,10 +29,22 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{ @Autowired private VehicleDetectionMapper vehicleDetectionMapper; + @Autowired + private RedisService redisService; @Override public List detectionList() { return vehicleDetectionMapper.detectionList(); } + @Override + public void monitorinData(String vin) { + RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest(); + Long userId = SecurityUtils.getUserId(); + realTimeDataRequest.setVin(vin); + realTimeDataRequest.setUserId(userId); + redisService.setVinAndUserId(realTimeDataRequest); + + } + } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java index 5dd54a5..7f62e96 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java @@ -303,11 +303,7 @@ public class VehicleServiceImpl extends ServiceImpl impl return vehicleMapper.deleteVehicle(middleId); } - @Override - public Integer addVehicle(VehicleMiddle vehicleMiddle) { - return vehicleMapper.addVehicle(vehicleMiddle); - } @Override public List vehicleAll() { @@ -322,6 +318,11 @@ public class VehicleServiceImpl extends ServiceImpl impl return vehicleMapper.onOrOutLineByVIN(vin, status); } + @Override + public Integer addVehicle(Long userId, List vehicleIds) { + return vehicleMapper.addVehicle(userId,vehicleIds); + } + @Override public List findByVIN(String vin) { diff --git a/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleMapper.xml b/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleMapper.xml index 0e5bdb8..1c1cf5c 100644 --- a/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleMapper.xml +++ b/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleMapper.xml @@ -41,12 +41,11 @@ INSERT INTO `couplet-cloud`.`couplet_middle` (`user_id`, `vehicle_id`, `del_flag`) VALUES - + (#{userId}, #{vehicleId}, 0) - UPDATE `couplet-cloud`.`couplet_vehicle` SET `vehicle_state` = #{status} diff --git a/couplet-modules/couplet-gen/src/main/java/com/couplet/gen/CoupletGenApplication.java b/couplet-modules/couplet-gen/src/main/java/com/couplet/gen/CoupletGenApplication.java index 37f425b..994e2f5 100644 --- a/couplet-modules/couplet-gen/src/main/java/com/couplet/gen/CoupletGenApplication.java +++ b/couplet-modules/couplet-gen/src/main/java/com/couplet/gen/CoupletGenApplication.java @@ -5,6 +5,7 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import com.couplet.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; /** * 代码生成 @@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableCustomSwagger2 @EnableMyFeignClients @SpringBootApplication +@ComponentScan(basePackages = {"com.couplet"}) public class CoupletGenApplication { public static void main (String[] args) { SpringApplication.run(CoupletGenApplication.class, args); diff --git a/couplet-modules/couplet-job/src/main/java/com/couplet/job/CoupletJobApplication.java b/couplet-modules/couplet-job/src/main/java/com/couplet/job/CoupletJobApplication.java index b93e210..34236d6 100644 --- a/couplet-modules/couplet-job/src/main/java/com/couplet/job/CoupletJobApplication.java +++ b/couplet-modules/couplet-job/src/main/java/com/couplet/job/CoupletJobApplication.java @@ -5,6 +5,7 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import com.couplet.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; /** * 定时任务 @@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableCustomSwagger2 @EnableMyFeignClients @SpringBootApplication +@ComponentScan(basePackages = {"com.couplet"}) public class CoupletJobApplication { public static void main (String[] args) { SpringApplication.run(CoupletJobApplication.class, args); diff --git a/couplet-modules/couplet-job/src/main/java/com/couplet/job/controller/SysJobController.java b/couplet-modules/couplet-job/src/main/java/com/couplet/job/controller/SysJobController.java index e63e378..e3a92e2 100644 --- a/couplet-modules/couplet-job/src/main/java/com/couplet/job/controller/SysJobController.java +++ b/couplet-modules/couplet-job/src/main/java/com/couplet/job/controller/SysJobController.java @@ -1,6 +1,7 @@ package com.couplet.job.controller; import com.couplet.common.core.constant.Constants; + import com.couplet.common.core.exception.job.TaskException; import com.couplet.common.core.utils.StringUtils; import com.couplet.common.core.utils.poi.ExcelUtil; diff --git a/couplet-modules/couplet-job/src/main/java/com/couplet/job/task/MyTask.java b/couplet-modules/couplet-job/src/main/java/com/couplet/job/task/MyTask.java deleted file mode 100644 index a76b69a..0000000 --- a/couplet-modules/couplet-job/src/main/java/com/couplet/job/task/MyTask.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.couplet.job.task; - -import com.couplet.common.core.utils.StringUtils; -import org.springframework.stereotype.Component; - -/** - * 定时任务调度测试 - * - * @author couplet - */ -@Component("myTask") -public class MyTask { - public void ryMultipleParams (String s, Boolean b, Long l, Double d, Integer i) { - System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); - } - - public void ryParams (String params) { - System.out.println("执行有参方法:" + params); - } - - public void ryNoParams () { - System.out.println("执行无参方法"); - } -} diff --git a/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/CoupletMqApplatcaion.java b/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/CoupletMqApplatcaion.java index d1c309f..86d963f 100644 --- a/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/CoupletMqApplatcaion.java +++ b/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/CoupletMqApplatcaion.java @@ -5,6 +5,7 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import com.couplet.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; /** * @ProjectName: Default (Template) Project @@ -16,6 +17,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableCustomSwagger2 @EnableMyFeignClients @SpringBootApplication +@ComponentScan(basePackages = {"com.couplet"}) public class CoupletMqApplatcaion { public static void main(String[] args) { SpringApplication.run(CoupletMqApplatcaion.class, args); diff --git a/couplet-modules/couplet-system/src/main/java/com/couplet/system/CoupletSystemApplication.java b/couplet-modules/couplet-system/src/main/java/com/couplet/system/CoupletSystemApplication.java index 1347fbb..aeda1d2 100644 --- a/couplet-modules/couplet-system/src/main/java/com/couplet/system/CoupletSystemApplication.java +++ b/couplet-modules/couplet-system/src/main/java/com/couplet/system/CoupletSystemApplication.java @@ -5,6 +5,7 @@ import com.couplet.common.security.annotation.EnableMyFeignClients; import com.couplet.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; /** * 系统模块 @@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableCustomSwagger2 @EnableMyFeignClients @SpringBootApplication +@ComponentScan(basePackages = {"com.couplet"}) public class CoupletSystemApplication { public static void main (String[] args) { SpringApplication.run(CoupletSystemApplication.class, args);