Commit 90e4966420567a33c7e371f8071f5399df5627e2
1 parent
f99d48a7
项目结构调整 x 3
Showing
40 changed files
with
451 additions
and
477 deletions
pom.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | <version>${revision}</version> | 9 | <version>${revision}</version> |
| 10 | <packaging>pom</packaging> | 10 | <packaging>pom</packaging> |
| 11 | <modules> | 11 | <modules> |
| 12 | - <module>yudao-dependencies</module> | 12 | +<!-- <module>yudao-dependencies</module>--> |
| 13 | <!-- <module>yudao-framework</module>--> | 13 | <!-- <module>yudao-framework</module>--> |
| 14 | <module>yudao-admin-server</module> | 14 | <module>yudao-admin-server</module> |
| 15 | <module>yudao-framework</module> | 15 | <module>yudao-framework</module> |
| @@ -23,16 +23,4 @@ | @@ -23,16 +23,4 @@ | ||
| 23 | <revision>1.0.0</revision> | 23 | <revision>1.0.0</revision> |
| 24 | </properties> | 24 | </properties> |
| 25 | 25 | ||
| 26 | - <dependencyManagement> | ||
| 27 | - <dependencies> | ||
| 28 | - <dependency> | ||
| 29 | - <groupId>cn.iocoder.boot</groupId> | ||
| 30 | - <artifactId>yudao-dependencies</artifactId> | ||
| 31 | - <version>${revision}</version> | ||
| 32 | - <type>pom</type> | ||
| 33 | - <scope>import</scope> | ||
| 34 | - </dependency> | ||
| 35 | - </dependencies> | ||
| 36 | - </dependencyManagement> | ||
| 37 | - | ||
| 38 | </project> | 26 | </project> |
yudao-admin-server/pom.xml
| @@ -7,12 +7,37 @@ | @@ -7,12 +7,37 @@ | ||
| 7 | <groupId>cn.iocoder.boot</groupId> | 7 | <groupId>cn.iocoder.boot</groupId> |
| 8 | <artifactId>yudao-admin-server</artifactId> | 8 | <artifactId>yudao-admin-server</artifactId> |
| 9 | <version>${revision}</version> | 9 | <version>${revision}</version> |
| 10 | + | ||
| 10 | <packaging>jar</packaging> | 11 | <packaging>jar</packaging> |
| 11 | 12 | ||
| 12 | <name>yudao-admin-server</name> | 13 | <name>yudao-admin-server</name> |
| 13 | <description>管理后台 Server,提供其 API 接口</description> | 14 | <description>管理后台 Server,提供其 API 接口</description> |
| 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 15 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 16 | ||
| 17 | + <properties> | ||
| 18 | + <revision>1.0.0</revision> | ||
| 19 | + </properties> | ||
| 20 | + | ||
| 21 | + <dependencies> | ||
| 22 | + <dependency> | ||
| 23 | + <groupId>cn.iocoder.boot</groupId> | ||
| 24 | + <artifactId>yudao-framework</artifactId> | ||
| 25 | + <version>${revision}</version> | ||
| 26 | + </dependency> | ||
| 27 | + </dependencies> | ||
| 16 | 28 | ||
| 29 | + <!-- TODO 稍后清理掉 --> | ||
| 30 | + <build> | ||
| 31 | + <plugins> | ||
| 32 | + <plugin> | ||
| 33 | + <groupId>org.apache.maven.plugins</groupId> | ||
| 34 | + <artifactId>maven-compiler-plugin</artifactId> | ||
| 35 | + <configuration> | ||
| 36 | + <source>8</source> | ||
| 37 | + <target>8</target> | ||
| 38 | + </configuration> | ||
| 39 | + </plugin> | ||
| 40 | + </plugins> | ||
| 41 | + </build> | ||
| 17 | 42 | ||
| 18 | </project> | 43 | </project> |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/config/InfConfigDAOImpl.java
| 1 | package cn.iocoder.dashboard.modules.infra.dal.mysql.config; | 1 | package cn.iocoder.dashboard.modules.infra.dal.mysql.config; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.framework.apollo.internals.ConfigFrameworkDAO; | 3 | import cn.iocoder.dashboard.framework.apollo.internals.ConfigFrameworkDAO; |
| 4 | +import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; | ||
| 4 | import cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO; | 5 | import cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO; |
| 5 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | 6 | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| 6 | import org.springframework.jdbc.core.JdbcTemplate; | 7 | import org.springframework.jdbc.core.JdbcTemplate; |
| @@ -32,8 +33,8 @@ public class InfConfigDAOImpl implements ConfigFrameworkDAO { | @@ -32,8 +33,8 @@ public class InfConfigDAOImpl implements ConfigFrameworkDAO { | ||
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | @Override | 35 | @Override |
| 35 | - public List<InfConfigDO> selectList() { | ||
| 36 | - return jdbcTemplate.query("SELECT `key`, `value`, update_time, deleted FROM inf_config", new BeanPropertyRowMapper<>(InfConfigDO.class)); | 36 | + public List<ConfigRespDTO> selectList() { |
| 37 | + return jdbcTemplate.query("SELECT `key`, `value`, update_time, deleted FROM inf_config", new BeanPropertyRowMapper<>(ConfigRespDTO.class)); | ||
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | } | 40 | } |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/vo/operatelog/SysOperateLogCreateReqVO.java deleted
| 1 | -package cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import lombok.Data; | ||
| 5 | -import lombok.EqualsAndHashCode; | ||
| 6 | -import lombok.ToString; | ||
| 7 | - | ||
| 8 | -@ApiModel(value = "操作日志创建 Request VO", description = "暂时提供给前端,仅仅后端切面记录操作日志时,进行使用") | ||
| 9 | -@Data | ||
| 10 | -@EqualsAndHashCode(callSuper = true) | ||
| 11 | -@ToString(callSuper = true) | ||
| 12 | -public class SysOperateLogCreateReqVO extends SysOperateLogBaseVO { | ||
| 13 | -} |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java
| 1 | package cn.iocoder.dashboard.modules.system.convert.dict; | 1 | package cn.iocoder.dashboard.modules.system.convert.dict; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; | ||
| 4 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.*; | 5 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.*; |
| 5 | import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictDataDO; | 6 | import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictDataDO; |
| 7 | +import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictTypeDO; | ||
| 6 | import org.mapstruct.Mapper; | 8 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.factory.Mappers; | 9 | import org.mapstruct.factory.Mappers; |
| 8 | 10 | ||
| 11 | +import java.util.Collection; | ||
| 9 | import java.util.List; | 12 | import java.util.List; |
| 10 | 13 | ||
| 11 | @Mapper | 14 | @Mapper |
| @@ -25,4 +28,8 @@ public interface SysDictDataConvert { | @@ -25,4 +28,8 @@ public interface SysDictDataConvert { | ||
| 25 | 28 | ||
| 26 | List<SysDictDataExcelVO> convertList02(List<SysDictDataDO> bean); | 29 | List<SysDictDataExcelVO> convertList02(List<SysDictDataDO> bean); |
| 27 | 30 | ||
| 31 | + DictDataRespDTO convert02(SysDictDataDO bean); | ||
| 32 | + | ||
| 33 | + List<DictDataRespDTO> convertList03(Collection<SysDictDataDO> list); | ||
| 34 | + | ||
| 28 | } | 35 | } |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictTypeConvert.java
| 1 | package cn.iocoder.dashboard.modules.system.convert.dict; | 1 | package cn.iocoder.dashboard.modules.system.convert.dict; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; | ||
| 4 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.*; | 5 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.*; |
| 5 | import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictTypeDO; | 6 | import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictTypeDO; |
| 6 | import org.mapstruct.Mapper; | 7 | import org.mapstruct.Mapper; |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/logger/SysOperateLogConvert.java
| 1 | package cn.iocoder.dashboard.modules.system.convert.logger; | 1 | package cn.iocoder.dashboard.modules.system.convert.logger; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | -import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogCreateReqVO; | 4 | +import cn.iocoder.dashboard.framework.logger.operatelog.core.dto.OperateLogCreateReqDTO; |
| 5 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExcelVO; | 5 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExcelVO; |
| 6 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogRespVO; | 6 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogRespVO; |
| 7 | import cn.iocoder.dashboard.modules.system.dal.dataobject.logger.SysOperateLogDO; | 7 | import cn.iocoder.dashboard.modules.system.dal.dataobject.logger.SysOperateLogDO; |
| @@ -21,7 +21,7 @@ public interface SysOperateLogConvert { | @@ -21,7 +21,7 @@ public interface SysOperateLogConvert { | ||
| 21 | 21 | ||
| 22 | SysOperateLogConvert INSTANCE = Mappers.getMapper(SysOperateLogConvert.class); | 22 | SysOperateLogConvert INSTANCE = Mappers.getMapper(SysOperateLogConvert.class); |
| 23 | 23 | ||
| 24 | - SysOperateLogDO convert(SysOperateLogCreateReqVO bean); | 24 | + SysOperateLogDO convert(OperateLogCreateReqDTO bean); |
| 25 | 25 | ||
| 26 | PageResult<SysOperateLogRespVO> convertPage(PageResult<SysOperateLogDO> page); | 26 | PageResult<SysOperateLogRespVO> convertPage(PageResult<SysOperateLogDO> page); |
| 27 | 27 |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/impl/SysDictDataServiceImpl.java
| @@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.dict.impl; | @@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.dict.impl; | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | 4 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; |
| 5 | import cn.iocoder.dashboard.common.pojo.PageResult; | 5 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 6 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; | ||
| 6 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | 7 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; |
| 7 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO; | 8 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO; |
| 8 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataExportReqVO; | 9 | import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataExportReqVO; |
| @@ -23,7 +24,6 @@ import org.springframework.stereotype.Service; | @@ -23,7 +24,6 @@ import org.springframework.stereotype.Service; | ||
| 23 | 24 | ||
| 24 | import javax.annotation.PostConstruct; | 25 | import javax.annotation.PostConstruct; |
| 25 | import javax.annotation.Resource; | 26 | import javax.annotation.Resource; |
| 26 | -import java.util.ArrayList; | ||
| 27 | import java.util.Comparator; | 27 | import java.util.Comparator; |
| 28 | import java.util.Date; | 28 | import java.util.Date; |
| 29 | import java.util.List; | 29 | import java.util.List; |
| @@ -239,18 +239,18 @@ public class SysDictDataServiceImpl implements SysDictDataService { | @@ -239,18 +239,18 @@ public class SysDictDataServiceImpl implements SysDictDataService { | ||
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | @Override | 241 | @Override |
| 242 | - public SysDictDataDO getDictDataFromCache(String type, String value) { | ||
| 243 | - return valueDictDataCache.get(type, value); | 242 | + public DictDataRespDTO getDictDataFromCache(String type, String value) { |
| 243 | + return SysDictDataConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); | ||
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | @Override | 246 | @Override |
| 247 | - public SysDictDataDO parseDictDataFromCache(String type, String label) { | ||
| 248 | - return labelDictDataCache.get(type, label); | 247 | + public DictDataRespDTO parseDictDataFromCache(String type, String label) { |
| 248 | + return SysDictDataConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); | ||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | @Override | 251 | @Override |
| 252 | - public List<SysDictDataDO> listDictDatasFromCache(String type) { | ||
| 253 | - return new ArrayList<>(labelDictDataCache.row(type).values()); | 252 | + public List<DictDataRespDTO> listDictDatasFromCache(String type) { |
| 253 | + return SysDictDataConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values())); | ||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | } | 256 | } |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/logger/impl/SysOperateLogServiceImpl.java
| @@ -3,7 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.logger.impl; | @@ -3,7 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.logger.impl; | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.util.StrUtil; | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | import cn.iocoder.dashboard.common.pojo.PageResult; | 5 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 6 | -import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogCreateReqVO; | 6 | +import cn.iocoder.dashboard.framework.logger.operatelog.core.dto.OperateLogCreateReqDTO; |
| 7 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExportReqVO; | 7 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExportReqVO; |
| 8 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogPageReqVO; | 8 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogPageReqVO; |
| 9 | import cn.iocoder.dashboard.modules.system.convert.logger.SysOperateLogConvert; | 9 | import cn.iocoder.dashboard.modules.system.convert.logger.SysOperateLogConvert; |
| @@ -40,7 +40,7 @@ public class SysOperateLogServiceImpl implements SysOperateLogService { | @@ -40,7 +40,7 @@ public class SysOperateLogServiceImpl implements SysOperateLogService { | ||
| 40 | 40 | ||
| 41 | @Override | 41 | @Override |
| 42 | @Async | 42 | @Async |
| 43 | - public Future<Boolean> createOperateLogAsync(SysOperateLogCreateReqVO reqVO) { | 43 | + public Future<Boolean> createOperateLogAsync(OperateLogCreateReqDTO reqVO) { |
| 44 | boolean success = false; | 44 | boolean success = false; |
| 45 | try { | 45 | try { |
| 46 | SysOperateLogDO logDO = SysOperateLogConvert.INSTANCE.convert(reqVO); | 46 | SysOperateLogDO logDO = SysOperateLogConvert.INSTANCE.convert(reqVO); |
yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysOperateLogServiceImplTest.java
| @@ -7,7 +7,7 @@ import cn.iocoder.dashboard.common.exception.enums.GlobalErrorCodeConstants; | @@ -7,7 +7,7 @@ import cn.iocoder.dashboard.common.exception.enums.GlobalErrorCodeConstants; | ||
| 7 | import cn.iocoder.dashboard.common.pojo.PageResult; | 7 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 8 | import cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum; | 8 | import cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum; |
| 9 | import cn.iocoder.dashboard.framework.tracer.core.util.TracerUtils; | 9 | import cn.iocoder.dashboard.framework.tracer.core.util.TracerUtils; |
| 10 | -import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogCreateReqVO; | 10 | +import cn.iocoder.dashboard.framework.logger.operatelog.core.dto.OperateLogCreateReqDTO; |
| 11 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExportReqVO; | 11 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogExportReqVO; |
| 12 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogPageReqVO; | 12 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogPageReqVO; |
| 13 | import cn.iocoder.dashboard.modules.system.dal.dataobject.logger.SysOperateLogDO; | 13 | import cn.iocoder.dashboard.modules.system.dal.dataobject.logger.SysOperateLogDO; |
| @@ -48,7 +48,7 @@ public class SysOperateLogServiceImplTest extends BaseDbUnitTest { | @@ -48,7 +48,7 @@ public class SysOperateLogServiceImplTest extends BaseDbUnitTest { | ||
| 48 | @Test | 48 | @Test |
| 49 | public void testCreateOperateLogAsync() throws InterruptedException, ExecutionException { | 49 | public void testCreateOperateLogAsync() throws InterruptedException, ExecutionException { |
| 50 | String traceId = TracerUtils.getTraceId(); | 50 | String traceId = TracerUtils.getTraceId(); |
| 51 | - SysOperateLogCreateReqVO reqVO = RandomUtils.randomPojo(SysOperateLogCreateReqVO.class, o -> { | 51 | + OperateLogCreateReqDTO reqVO = RandomUtils.randomPojo(OperateLogCreateReqDTO.class, o -> { |
| 52 | o.setTraceId(traceId); | 52 | o.setTraceId(traceId); |
| 53 | o.setUserId(randomLongId()); | 53 | o.setUserId(randomLongId()); |
| 54 | o.setExts(MapUtil.<String, Object>builder("orderId", randomLongId()).build()); | 54 | o.setExts(MapUtil.<String, Object>builder("orderId", randomLongId()).build()); |
yudao-dependencies/pom.xml
| @@ -13,359 +13,4 @@ | @@ -13,359 +13,4 @@ | ||
| 13 | <description>基础 bom 文件,管理整个项目的依赖版本</description> | 13 | <description>基础 bom 文件,管理整个项目的依赖版本</description> |
| 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 15 | ||
| 16 | - <properties> | ||
| 17 | - <revision>1.0.0</revision> | ||
| 18 | - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| 19 | - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 20 | - <resource.delimiter>@</resource.delimiter> | ||
| 21 | - <java.version>1.8</java.version> | ||
| 22 | - <maven.compiler.source>${java.version}</maven.compiler.source> | ||
| 23 | - <maven.compiler.target>${java.version}</maven.compiler.target> | ||
| 24 | - <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> | ||
| 25 | - | ||
| 26 | - <!-- 统一依赖管理 --> | ||
| 27 | - <spring.boot.version>2.4.4</spring.boot.version> | ||
| 28 | - <!-- Web 相关 --> | ||
| 29 | - <knife4j.version>3.0.2</knife4j.version> | ||
| 30 | - <swagger-annotations.version>1.5.22</swagger-annotations.version> | ||
| 31 | - <!-- DB 相关 --> | ||
| 32 | - <mysql-connector-java.version>5.1.46</mysql-connector-java.version> | ||
| 33 | - <druid.version>1.2.4</druid.version> | ||
| 34 | - <mybatis-plus.version>3.4.2</mybatis-plus.version> | ||
| 35 | - <dynamic-datasource.version>3.3.2</dynamic-datasource.version> | ||
| 36 | - <redisson.version>3.15.1</redisson.version> | ||
| 37 | - <!-- Config 配置中心相关 --> | ||
| 38 | - <apollo.version>1.7.0</apollo.version> | ||
| 39 | - <!-- 服务保障相关 --> | ||
| 40 | - <lock4j.version>2.2.0</lock4j.version> | ||
| 41 | - <resilience4j.version>1.7.0</resilience4j.version> | ||
| 42 | - <!-- 监控相关 --> | ||
| 43 | - <skywalking.version>8.5.0</skywalking.version> | ||
| 44 | - <logback.encoder.version>6.1</logback.encoder.version> | ||
| 45 | - <spring-boot-admin.version>2.3.1</spring-boot-admin.version> | ||
| 46 | - <!-- 工具类相关 --> | ||
| 47 | - <lombok.version>1.16.14</lombok.version> | ||
| 48 | - <mapstruct.version>1.4.1.Final</mapstruct.version> | ||
| 49 | - <hutool.version>5.6.1</hutool.version> | ||
| 50 | - <easyexcel.verion>2.2.7</easyexcel.verion> | ||
| 51 | - <velocity.version>2.2</velocity.version> | ||
| 52 | - <screw.version>1.0.5</screw.version> | ||
| 53 | - <podam.version>7.2.6.RELEASE</podam.version> | ||
| 54 | - <jedis-mock.version>0.1.16</jedis-mock.version> | ||
| 55 | - <!-- 三方云服务相关 --> | ||
| 56 | - <aliyun-java-sdk-core.version>4.5.18</aliyun-java-sdk-core.version> | ||
| 57 | - <aliyun-java-sdk-dysmsapi.version>2.1.0</aliyun-java-sdk-dysmsapi.version> | ||
| 58 | - <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version> | ||
| 59 | - </properties> | ||
| 60 | - | ||
| 61 | - <dependencyManagement> | ||
| 62 | - <dependencies> | ||
| 63 | - <!-- 统一依赖管理 --> | ||
| 64 | - <dependency> | ||
| 65 | - <groupId>org.springframework.boot</groupId> | ||
| 66 | - <artifactId>spring-boot-dependencies</artifactId> | ||
| 67 | - <version>${spring.boot.version}</version> | ||
| 68 | - <type>pom</type> | ||
| 69 | - <scope>import</scope> | ||
| 70 | - </dependency> | ||
| 71 | - | ||
| 72 | - <!-- 通用相关 --> | ||
| 73 | - <dependency> | ||
| 74 | - <groupId>cn.iocoder.boot</groupId> | ||
| 75 | - <artifactId>yudao-dependencies</artifactId> | ||
| 76 | - <version>${revision}</version> | ||
| 77 | - </dependency> | ||
| 78 | - | ||
| 79 | - <!-- Spring 核心 --> | ||
| 80 | - <dependency> | ||
| 81 | - <!-- 用于生成自定义的 Spring @ConfigurationProperties 配置类的说明文件 --> | ||
| 82 | - <groupId>org.springframework.boot</groupId> | ||
| 83 | - <artifactId>spring-boot-configuration-processor</artifactId> | ||
| 84 | - <optional>true</optional> | ||
| 85 | - </dependency> | ||
| 86 | - | ||
| 87 | - <dependency> | ||
| 88 | - <groupId>org.springframework.boot</groupId> | ||
| 89 | - <artifactId>spring-boot-starter-aop</artifactId> | ||
| 90 | - </dependency> | ||
| 91 | - | ||
| 92 | - <!-- Web 相关 --> | ||
| 93 | - <dependency> | ||
| 94 | - <groupId>org.springframework.boot</groupId> | ||
| 95 | - <artifactId>spring-boot-starter-web</artifactId> | ||
| 96 | - </dependency> | ||
| 97 | - | ||
| 98 | - <dependency> | ||
| 99 | - <groupId>org.springframework.boot</groupId> | ||
| 100 | - <artifactId>spring-boot-starter-security</artifactId> | ||
| 101 | - </dependency> | ||
| 102 | - | ||
| 103 | - <dependency> | ||
| 104 | - <groupId>org.springframework.boot</groupId> | ||
| 105 | - <artifactId>spring-boot-starter-validation</artifactId> | ||
| 106 | - </dependency> | ||
| 107 | - | ||
| 108 | - <dependency> | ||
| 109 | - <groupId>com.github.xiaoymin</groupId> | ||
| 110 | - <artifactId>knife4j-spring-boot-starter</artifactId> | ||
| 111 | - <version>${knife4j.version}</version> | ||
| 112 | - <exclusions> | ||
| 113 | - <exclusion> | ||
| 114 | - <artifactId>mapstruct</artifactId> | ||
| 115 | - <groupId>org.mapstruct</groupId> <!-- 避免冲突 --> | ||
| 116 | - </exclusion> | ||
| 117 | - <exclusion> | ||
| 118 | - <artifactId>guava</artifactId> | ||
| 119 | - <groupId>com.google.guava</groupId> | ||
| 120 | - </exclusion> | ||
| 121 | - <exclusion> | ||
| 122 | - <artifactId>swagger-annotations</artifactId> | ||
| 123 | - <groupId>io.swagger</groupId> | ||
| 124 | - </exclusion> | ||
| 125 | - </exclusions> | ||
| 126 | - </dependency> | ||
| 127 | - <dependency> | ||
| 128 | - <groupId>io.swagger</groupId> | ||
| 129 | - <artifactId>swagger-annotations</artifactId> | ||
| 130 | - <version>${swagger-annotations.version}</version> | ||
| 131 | - </dependency> | ||
| 132 | - | ||
| 133 | - <!-- DB 相关 --> | ||
| 134 | - <dependency> | ||
| 135 | - <groupId>mysql</groupId> | ||
| 136 | - <artifactId>mysql-connector-java</artifactId> | ||
| 137 | - <version>${mysql-connector-java.version}</version> | ||
| 138 | - </dependency> | ||
| 139 | - <dependency> | ||
| 140 | - <groupId>com.alibaba</groupId> | ||
| 141 | - <artifactId>druid-spring-boot-starter</artifactId> | ||
| 142 | - <version>${druid.version}</version> | ||
| 143 | - </dependency> | ||
| 144 | - <dependency> | ||
| 145 | - <groupId>com.baomidou</groupId> | ||
| 146 | - <artifactId>mybatis-plus-boot-starter</artifactId> | ||
| 147 | - <version>${mybatis-plus.version}</version> | ||
| 148 | - </dependency> | ||
| 149 | - <dependency> | ||
| 150 | - <groupId>com.baomidou</groupId> | ||
| 151 | - <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 --> | ||
| 152 | - <version>${dynamic-datasource.version}</version> | ||
| 153 | - </dependency> | ||
| 154 | - | ||
| 155 | - <dependency> | ||
| 156 | - <groupId>org.redisson</groupId> | ||
| 157 | - <artifactId>redisson-spring-boot-starter</artifactId> | ||
| 158 | - <version>${redisson.version}</version> | ||
| 159 | - </dependency> | ||
| 160 | - | ||
| 161 | - <!-- Config 配置中心相关 --> | ||
| 162 | - <dependency> | ||
| 163 | - <groupId>com.ctrip.framework.apollo</groupId> | ||
| 164 | - <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 --> | ||
| 165 | - <version>${apollo.version}</version> | ||
| 166 | - </dependency> | ||
| 167 | - | ||
| 168 | - <!-- Job 定时任务相关 --> | ||
| 169 | - <dependency> | ||
| 170 | - <groupId>org.springframework.boot</groupId> | ||
| 171 | - <artifactId>spring-boot-starter-quartz</artifactId> | ||
| 172 | - </dependency> | ||
| 173 | - | ||
| 174 | - <!-- 服务保障相关 --> | ||
| 175 | - <dependency> | ||
| 176 | - <groupId>com.baomidou</groupId> | ||
| 177 | - <artifactId>lock4j-redisson-spring-boot-starter</artifactId> | ||
| 178 | - <version>${lock4j.version}</version> | ||
| 179 | - <exclusions> | ||
| 180 | - <exclusion> | ||
| 181 | - <artifactId>redisson-spring-boot-starter</artifactId> | ||
| 182 | - <groupId>org.redisson</groupId> | ||
| 183 | - </exclusion> | ||
| 184 | - </exclusions> | ||
| 185 | - </dependency> | ||
| 186 | - | ||
| 187 | - <dependency> | ||
| 188 | - <groupId>io.github.resilience4j</groupId> | ||
| 189 | - <artifactId>resilience4j-spring-boot2</artifactId> | ||
| 190 | - <version>${resilience4j.version}</version> | ||
| 191 | - </dependency> | ||
| 192 | - | ||
| 193 | - <!-- 监控相关 --> | ||
| 194 | - <dependency> | ||
| 195 | - <groupId>org.apache.skywalking</groupId> | ||
| 196 | - <artifactId>apm-toolkit-trace</artifactId> | ||
| 197 | - <version>${skywalking.version}</version> | ||
| 198 | - </dependency> | ||
| 199 | - <dependency> | ||
| 200 | - <groupId>org.apache.skywalking</groupId> | ||
| 201 | - <artifactId>apm-toolkit-logback-1.x</artifactId> | ||
| 202 | - <version>${skywalking.version}</version> | ||
| 203 | - </dependency> | ||
| 204 | - <dependency> | ||
| 205 | - <groupId>org.apache.skywalking</groupId> | ||
| 206 | - <artifactId>apm-toolkit-opentracing</artifactId> | ||
| 207 | - <version>${skywalking.version}</version> | ||
| 208 | - </dependency> | ||
| 209 | - | ||
| 210 | - <dependency> | ||
| 211 | - <groupId>de.codecentric</groupId> | ||
| 212 | - <artifactId>spring-boot-admin-starter-server</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | ||
| 213 | - <version>${spring-boot-admin.version}</version> | ||
| 214 | - </dependency> | ||
| 215 | - <dependency> | ||
| 216 | - <groupId>de.codecentric</groupId> | ||
| 217 | - <artifactId>spring-boot-admin-starter-client</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | ||
| 218 | - <version>${spring-boot-admin.version}</version> | ||
| 219 | - </dependency> | ||
| 220 | - | ||
| 221 | - <!-- Test 测试相关 --> | ||
| 222 | - <dependency> | ||
| 223 | - <groupId>org.springframework.boot</groupId> | ||
| 224 | - <artifactId>spring-boot-starter-test</artifactId> | ||
| 225 | - <scope>test</scope> | ||
| 226 | - <exclusions> | ||
| 227 | - <exclusion> | ||
| 228 | - <artifactId>asm</artifactId> | ||
| 229 | - <groupId>org.ow2.asm</groupId> | ||
| 230 | - </exclusion> | ||
| 231 | - </exclusions> | ||
| 232 | - </dependency> | ||
| 233 | - | ||
| 234 | - <dependency> | ||
| 235 | - <groupId>com.h2database</groupId> <!-- 单元测试,我们采用 H2 作为数据库 --> | ||
| 236 | - <artifactId>h2</artifactId> | ||
| 237 | - <scope>test</scope> | ||
| 238 | - </dependency> | ||
| 239 | - | ||
| 240 | - <dependency> | ||
| 241 | - <groupId>com.github.fppt</groupId> <!-- 单元测试,我们采用内嵌的 Redis 数据库 --> | ||
| 242 | - <artifactId>jedis-mock</artifactId> | ||
| 243 | - <version>${jedis-mock.version}</version> | ||
| 244 | - <scope>test</scope> | ||
| 245 | - </dependency> | ||
| 246 | - | ||
| 247 | - <dependency> | ||
| 248 | - <groupId>uk.co.jemos.podam</groupId> <!-- 单元测试,随机生成 POJO 类 --> | ||
| 249 | - <artifactId>podam</artifactId> | ||
| 250 | - <version>${podam.version}</version> | ||
| 251 | - <scope>test</scope> | ||
| 252 | - </dependency> | ||
| 253 | - | ||
| 254 | - <!-- 工具类相关 --> | ||
| 255 | - <dependency> | ||
| 256 | - <groupId>org.projectlombok</groupId> | ||
| 257 | - <artifactId>lombok</artifactId> | ||
| 258 | - <version>${lombok.version}</version> | ||
| 259 | - </dependency> | ||
| 260 | - | ||
| 261 | - <dependency> | ||
| 262 | - <groupId>org.mapstruct</groupId> | ||
| 263 | - <artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher --> | ||
| 264 | - <version>${mapstruct.version}</version> | ||
| 265 | - </dependency> | ||
| 266 | - <dependency> | ||
| 267 | - <groupId>org.mapstruct</groupId> | ||
| 268 | - <artifactId>mapstruct-processor</artifactId> | ||
| 269 | - <version>${mapstruct.version}</version> | ||
| 270 | - <optional>true</optional> | ||
| 271 | - </dependency> | ||
| 272 | - <dependency> | ||
| 273 | - <groupId>org.mapstruct</groupId> | ||
| 274 | - <artifactId>mapstruct-jdk8</artifactId> | ||
| 275 | - <version>${mapstruct.version}</version> | ||
| 276 | - </dependency> | ||
| 277 | - | ||
| 278 | - <dependency> | ||
| 279 | - <groupId>cn.hutool</groupId> | ||
| 280 | - <artifactId>hutool-all</artifactId> | ||
| 281 | - <version>${hutool.version}</version> | ||
| 282 | - </dependency> | ||
| 283 | - | ||
| 284 | - <dependency> | ||
| 285 | - <groupId>com.alibaba</groupId> | ||
| 286 | - <artifactId>easyexcel</artifactId> | ||
| 287 | - <version>${easyexcel.verion}</version> | ||
| 288 | - </dependency> | ||
| 289 | - | ||
| 290 | - <dependency> | ||
| 291 | - <groupId>org.apache.velocity</groupId> | ||
| 292 | - <artifactId>velocity-engine-core</artifactId> | ||
| 293 | - <version>${velocity.version}</version> | ||
| 294 | - </dependency> | ||
| 295 | - | ||
| 296 | - <dependency> | ||
| 297 | - <groupId>cn.smallbun.screw</groupId> | ||
| 298 | - <artifactId>screw-core</artifactId> <!-- 实现数据库文档 --> | ||
| 299 | - <version>${screw.version}</version> | ||
| 300 | - </dependency> | ||
| 301 | - | ||
| 302 | - <!-- 三方云服务相关 --> | ||
| 303 | - | ||
| 304 | - <!-- SMS SDK begin --> | ||
| 305 | - <dependency> | ||
| 306 | - <groupId>com.yunpian.sdk</groupId> | ||
| 307 | - <artifactId>yunpian-java-sdk</artifactId> | ||
| 308 | - <version>${yunpian-java-sdk.version}</version> | ||
| 309 | - </dependency> | ||
| 310 | - | ||
| 311 | - <dependency> | ||
| 312 | - <groupId>com.aliyun</groupId> | ||
| 313 | - <artifactId>aliyun-java-sdk-core</artifactId> | ||
| 314 | - <version>${aliyun-java-sdk-core.version}</version> | ||
| 315 | - </dependency> | ||
| 316 | - <dependency> | ||
| 317 | - <groupId>com.aliyun</groupId> | ||
| 318 | - <artifactId>aliyun-java-sdk-dysmsapi</artifactId> | ||
| 319 | - <version>${aliyun-java-sdk-dysmsapi.version}</version> | ||
| 320 | - </dependency> | ||
| 321 | - <!-- SMS SDK end --> | ||
| 322 | - </dependencies> | ||
| 323 | - </dependencyManagement> | ||
| 324 | - | ||
| 325 | - <build> | ||
| 326 | - <!-- 设置构建的 jar 包名 --> | ||
| 327 | - <finalName>${project.artifactId}</finalName> | ||
| 328 | - <plugins> | ||
| 329 | - <!-- 打包 --> | ||
| 330 | - <plugin> | ||
| 331 | - <groupId>org.springframework.boot</groupId> | ||
| 332 | - <artifactId>spring-boot-maven-plugin</artifactId> | ||
| 333 | - <version>${spring.boot.version}</version> | ||
| 334 | - <configuration> | ||
| 335 | - <fork>true</fork> | ||
| 336 | - </configuration> | ||
| 337 | - <executions> | ||
| 338 | - <execution> | ||
| 339 | - <goals> | ||
| 340 | - <goal>repackage</goal> <!-- 将原来的 jar 打入其中 --> | ||
| 341 | - </goals> | ||
| 342 | - </execution> | ||
| 343 | - </executions> | ||
| 344 | - </plugin> | ||
| 345 | - | ||
| 346 | - <!-- 提供给 mapstruct 使用 --> | ||
| 347 | - <plugin> | ||
| 348 | - <groupId>org.apache.maven.plugins</groupId> | ||
| 349 | - <artifactId>maven-compiler-plugin</artifactId> | ||
| 350 | - <version>${maven-compiler-plugin.version}</version> | ||
| 351 | - <configuration> | ||
| 352 | - <source>${java.version}</source> <!-- or higher, depending on your project --> | ||
| 353 | - <target>${java.version}</target> <!-- or higher, depending on your project --> | ||
| 354 | - <annotationProcessorPaths> | ||
| 355 | - <path> | ||
| 356 | - <groupId>org.mapstruct</groupId> | ||
| 357 | - <artifactId>mapstruct-processor</artifactId> | ||
| 358 | - <version>${mapstruct.version}</version> | ||
| 359 | - </path> | ||
| 360 | - <path> | ||
| 361 | - <groupId>org.projectlombok</groupId> | ||
| 362 | - <artifactId>lombok</artifactId> | ||
| 363 | - <version>${lombok.version}</version> | ||
| 364 | - </path> | ||
| 365 | - </annotationProcessorPaths> | ||
| 366 | - </configuration> | ||
| 367 | - </plugin> | ||
| 368 | - </plugins> | ||
| 369 | - </build> | ||
| 370 | - | ||
| 371 | </project> | 16 | </project> |
yudao-framework/pom.xml
| @@ -11,12 +11,70 @@ | @@ -11,12 +11,70 @@ | ||
| 11 | 11 | ||
| 12 | <artifactId>yudao-framework</artifactId> | 12 | <artifactId>yudao-framework</artifactId> |
| 13 | 13 | ||
| 14 | + <properties> | ||
| 15 | + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| 16 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 17 | + <resource.delimiter>@</resource.delimiter> | ||
| 18 | + <java.version>1.8</java.version> | ||
| 19 | + <maven.compiler.source>${java.version}</maven.compiler.source> | ||
| 20 | + <maven.compiler.target>${java.version}</maven.compiler.target> | ||
| 21 | + <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> | ||
| 22 | + <!-- 统一依赖管理 --> | ||
| 23 | + <spring.boot.version>2.4.4</spring.boot.version> | ||
| 24 | + <!-- Web 相关 --> | ||
| 25 | + <knife4j.version>3.0.2</knife4j.version> | ||
| 26 | + <swagger-annotations.version>1.5.22</swagger-annotations.version> | ||
| 27 | + <!-- DB 相关 --> | ||
| 28 | + <mysql-connector-java.version>5.1.46</mysql-connector-java.version> | ||
| 29 | + <druid.version>1.2.4</druid.version> | ||
| 30 | + <mybatis-plus.version>3.4.2</mybatis-plus.version> | ||
| 31 | + <dynamic-datasource.version>3.3.2</dynamic-datasource.version> | ||
| 32 | + <redisson.version>3.15.1</redisson.version> | ||
| 33 | + <!-- Config 配置中心相关 --> | ||
| 34 | + <apollo.version>1.7.0</apollo.version> | ||
| 35 | + <!-- 服务保障相关 --> | ||
| 36 | + <lock4j.version>2.2.0</lock4j.version> | ||
| 37 | + <resilience4j.version>1.7.0</resilience4j.version> | ||
| 38 | + <!-- 监控相关 --> | ||
| 39 | + <skywalking.version>8.5.0</skywalking.version> | ||
| 40 | + <logback.encoder.version>6.1</logback.encoder.version> | ||
| 41 | + <spring-boot-admin.version>2.3.1</spring-boot-admin.version> | ||
| 42 | + <!-- 工具类相关 --> | ||
| 43 | + <lombok.version>1.16.14</lombok.version> | ||
| 44 | + <mapstruct.version>1.4.1.Final</mapstruct.version> | ||
| 45 | + <hutool.version>5.6.1</hutool.version> | ||
| 46 | + <easyexcel.verion>2.2.7</easyexcel.verion> | ||
| 47 | + <velocity.version>2.2</velocity.version> | ||
| 48 | + <screw.version>1.0.5</screw.version> | ||
| 49 | + <podam.version>7.2.6.RELEASE</podam.version> | ||
| 50 | + <jedis-mock.version>0.1.16</jedis-mock.version> | ||
| 51 | + <!-- 三方云服务相关 --> | ||
| 52 | + <aliyun-java-sdk-core.version>4.5.18</aliyun-java-sdk-core.version> | ||
| 53 | + <aliyun-java-sdk-dysmsapi.version>2.1.0</aliyun-java-sdk-dysmsapi.version> | ||
| 54 | + <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version> | ||
| 55 | + </properties> | ||
| 56 | + | ||
| 57 | + <!-- 依赖声明 --> | ||
| 58 | + <dependencyManagement> | ||
| 59 | + <dependencies> | ||
| 60 | + <!-- 统一依赖管理 --> | ||
| 61 | + <dependency> | ||
| 62 | + <groupId>org.springframework.boot</groupId> | ||
| 63 | + <artifactId>spring-boot-dependencies</artifactId> | ||
| 64 | + <version>${spring.boot.version}</version> | ||
| 65 | + <type>pom</type> | ||
| 66 | + <scope>import</scope> | ||
| 67 | + </dependency> | ||
| 68 | + </dependencies> | ||
| 69 | + </dependencyManagement> | ||
| 70 | + | ||
| 14 | <dependencies> | 71 | <dependencies> |
| 15 | <!-- Spring 核心 --> | 72 | <!-- Spring 核心 --> |
| 16 | <dependency> | 73 | <dependency> |
| 17 | <!-- 用于生成自定义的 Spring @ConfigurationProperties 配置类的说明文件 --> | 74 | <!-- 用于生成自定义的 Spring @ConfigurationProperties 配置类的说明文件 --> |
| 18 | <groupId>org.springframework.boot</groupId> | 75 | <groupId>org.springframework.boot</groupId> |
| 19 | <artifactId>spring-boot-configuration-processor</artifactId> | 76 | <artifactId>spring-boot-configuration-processor</artifactId> |
| 77 | + <optional>true</optional> | ||
| 20 | </dependency> | 78 | </dependency> |
| 21 | 79 | ||
| 22 | <dependency> | 80 | <dependency> |
| @@ -43,39 +101,61 @@ | @@ -43,39 +101,61 @@ | ||
| 43 | <dependency> | 101 | <dependency> |
| 44 | <groupId>com.github.xiaoymin</groupId> | 102 | <groupId>com.github.xiaoymin</groupId> |
| 45 | <artifactId>knife4j-spring-boot-starter</artifactId> | 103 | <artifactId>knife4j-spring-boot-starter</artifactId> |
| 104 | + <version>${knife4j.version}</version> | ||
| 105 | + <exclusions> | ||
| 106 | + <exclusion> | ||
| 107 | + <artifactId>mapstruct</artifactId> | ||
| 108 | + <groupId>org.mapstruct</groupId> <!-- 避免冲突 --> | ||
| 109 | + </exclusion> | ||
| 110 | + <exclusion> | ||
| 111 | + <artifactId>guava</artifactId> | ||
| 112 | + <groupId>com.google.guava</groupId> | ||
| 113 | + </exclusion> | ||
| 114 | + <exclusion> | ||
| 115 | + <artifactId>swagger-annotations</artifactId> | ||
| 116 | + <groupId>io.swagger</groupId> | ||
| 117 | + </exclusion> | ||
| 118 | + </exclusions> | ||
| 46 | </dependency> | 119 | </dependency> |
| 47 | <dependency> | 120 | <dependency> |
| 48 | <groupId>io.swagger</groupId> | 121 | <groupId>io.swagger</groupId> |
| 49 | <artifactId>swagger-annotations</artifactId> | 122 | <artifactId>swagger-annotations</artifactId> |
| 123 | + <version>${swagger-annotations.version}</version> | ||
| 50 | </dependency> | 124 | </dependency> |
| 51 | 125 | ||
| 52 | <!-- DB 相关 --> | 126 | <!-- DB 相关 --> |
| 53 | <dependency> | 127 | <dependency> |
| 54 | <groupId>mysql</groupId> | 128 | <groupId>mysql</groupId> |
| 55 | <artifactId>mysql-connector-java</artifactId> | 129 | <artifactId>mysql-connector-java</artifactId> |
| 130 | + <version>${mysql-connector-java.version}</version> | ||
| 56 | </dependency> | 131 | </dependency> |
| 57 | <dependency> | 132 | <dependency> |
| 58 | <groupId>com.alibaba</groupId> | 133 | <groupId>com.alibaba</groupId> |
| 59 | <artifactId>druid-spring-boot-starter</artifactId> | 134 | <artifactId>druid-spring-boot-starter</artifactId> |
| 135 | + <version>${druid.version}</version> | ||
| 60 | </dependency> | 136 | </dependency> |
| 61 | <dependency> | 137 | <dependency> |
| 62 | <groupId>com.baomidou</groupId> | 138 | <groupId>com.baomidou</groupId> |
| 63 | <artifactId>mybatis-plus-boot-starter</artifactId> | 139 | <artifactId>mybatis-plus-boot-starter</artifactId> |
| 140 | + <version>${mybatis-plus.version}</version> | ||
| 64 | </dependency> | 141 | </dependency> |
| 65 | <dependency> | 142 | <dependency> |
| 66 | <groupId>com.baomidou</groupId> | 143 | <groupId>com.baomidou</groupId> |
| 67 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 --> | 144 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 --> |
| 145 | + <version>${dynamic-datasource.version}</version> | ||
| 68 | </dependency> | 146 | </dependency> |
| 69 | 147 | ||
| 70 | <dependency> | 148 | <dependency> |
| 71 | <groupId>org.redisson</groupId> | 149 | <groupId>org.redisson</groupId> |
| 72 | <artifactId>redisson-spring-boot-starter</artifactId> | 150 | <artifactId>redisson-spring-boot-starter</artifactId> |
| 151 | + <version>${redisson.version}</version> | ||
| 73 | </dependency> | 152 | </dependency> |
| 74 | 153 | ||
| 75 | <!-- Config 配置中心相关 --> | 154 | <!-- Config 配置中心相关 --> |
| 76 | <dependency> | 155 | <dependency> |
| 77 | <groupId>com.ctrip.framework.apollo</groupId> | 156 | <groupId>com.ctrip.framework.apollo</groupId> |
| 78 | <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 --> | 157 | <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 --> |
| 158 | + <version>${apollo.version}</version> | ||
| 79 | </dependency> | 159 | </dependency> |
| 80 | 160 | ||
| 81 | <!-- Job 定时任务相关 --> | 161 | <!-- Job 定时任务相关 --> |
| @@ -88,41 +168,55 @@ | @@ -88,41 +168,55 @@ | ||
| 88 | <dependency> | 168 | <dependency> |
| 89 | <groupId>com.baomidou</groupId> | 169 | <groupId>com.baomidou</groupId> |
| 90 | <artifactId>lock4j-redisson-spring-boot-starter</artifactId> | 170 | <artifactId>lock4j-redisson-spring-boot-starter</artifactId> |
| 171 | + <version>${lock4j.version}</version> | ||
| 172 | + <exclusions> | ||
| 173 | + <exclusion> | ||
| 174 | + <artifactId>redisson-spring-boot-starter</artifactId> | ||
| 175 | + <groupId>org.redisson</groupId> | ||
| 176 | + </exclusion> | ||
| 177 | + </exclusions> | ||
| 91 | </dependency> | 178 | </dependency> |
| 92 | 179 | ||
| 93 | <dependency> | 180 | <dependency> |
| 94 | <groupId>io.github.resilience4j</groupId> | 181 | <groupId>io.github.resilience4j</groupId> |
| 95 | <artifactId>resilience4j-spring-boot2</artifactId> | 182 | <artifactId>resilience4j-spring-boot2</artifactId> |
| 183 | + <version>${resilience4j.version}</version> | ||
| 96 | </dependency> | 184 | </dependency> |
| 97 | 185 | ||
| 98 | <!-- 监控相关 --> | 186 | <!-- 监控相关 --> |
| 99 | <dependency> | 187 | <dependency> |
| 100 | <groupId>org.apache.skywalking</groupId> | 188 | <groupId>org.apache.skywalking</groupId> |
| 101 | <artifactId>apm-toolkit-trace</artifactId> | 189 | <artifactId>apm-toolkit-trace</artifactId> |
| 190 | + <version>${skywalking.version}</version> | ||
| 102 | </dependency> | 191 | </dependency> |
| 103 | <dependency> | 192 | <dependency> |
| 104 | <groupId>org.apache.skywalking</groupId> | 193 | <groupId>org.apache.skywalking</groupId> |
| 105 | <artifactId>apm-toolkit-logback-1.x</artifactId> | 194 | <artifactId>apm-toolkit-logback-1.x</artifactId> |
| 195 | + <version>${skywalking.version}</version> | ||
| 106 | </dependency> | 196 | </dependency> |
| 107 | <dependency> | 197 | <dependency> |
| 108 | <groupId>org.apache.skywalking</groupId> | 198 | <groupId>org.apache.skywalking</groupId> |
| 109 | <artifactId>apm-toolkit-opentracing</artifactId> | 199 | <artifactId>apm-toolkit-opentracing</artifactId> |
| 200 | + <version>${skywalking.version}</version> | ||
| 110 | </dependency> | 201 | </dependency> |
| 111 | 202 | ||
| 112 | <dependency> | 203 | <dependency> |
| 113 | <groupId>de.codecentric</groupId> | 204 | <groupId>de.codecentric</groupId> |
| 114 | <artifactId>spring-boot-admin-starter-server</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | 205 | <artifactId>spring-boot-admin-starter-server</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> |
| 206 | + <version>${spring-boot-admin.version}</version> | ||
| 115 | </dependency> | 207 | </dependency> |
| 116 | <dependency> | 208 | <dependency> |
| 117 | <groupId>de.codecentric</groupId> | 209 | <groupId>de.codecentric</groupId> |
| 118 | <artifactId>spring-boot-admin-starter-client</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | 210 | <artifactId>spring-boot-admin-starter-client</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> |
| 211 | + <version>${spring-boot-admin.version}</version> | ||
| 119 | </dependency> | 212 | </dependency> |
| 120 | 213 | ||
| 121 | <!-- Test 测试相关 --> | 214 | <!-- Test 测试相关 --> |
| 122 | <dependency> | 215 | <dependency> |
| 123 | <groupId>org.springframework.boot</groupId> | 216 | <groupId>org.springframework.boot</groupId> |
| 124 | <artifactId>spring-boot-starter-test</artifactId> | 217 | <artifactId>spring-boot-starter-test</artifactId> |
| 125 | - <scope>test</scope> | 218 | +<!-- <scope>test</scope>--> <!-- TODO 调整依赖 scope --> |
| 219 | + <optional>true</optional> | ||
| 126 | <exclusions> | 220 | <exclusions> |
| 127 | <exclusion> | 221 | <exclusion> |
| 128 | <artifactId>asm</artifactId> | 222 | <artifactId>asm</artifactId> |
| @@ -140,53 +234,64 @@ | @@ -140,53 +234,64 @@ | ||
| 140 | <dependency> | 234 | <dependency> |
| 141 | <groupId>com.github.fppt</groupId> <!-- 单元测试,我们采用内嵌的 Redis 数据库 --> | 235 | <groupId>com.github.fppt</groupId> <!-- 单元测试,我们采用内嵌的 Redis 数据库 --> |
| 142 | <artifactId>jedis-mock</artifactId> | 236 | <artifactId>jedis-mock</artifactId> |
| 237 | + <version>${jedis-mock.version}</version> | ||
| 143 | <scope>test</scope> | 238 | <scope>test</scope> |
| 144 | </dependency> | 239 | </dependency> |
| 145 | 240 | ||
| 146 | <dependency> | 241 | <dependency> |
| 147 | <groupId>uk.co.jemos.podam</groupId> <!-- 单元测试,随机生成 POJO 类 --> | 242 | <groupId>uk.co.jemos.podam</groupId> <!-- 单元测试,随机生成 POJO 类 --> |
| 148 | <artifactId>podam</artifactId> | 243 | <artifactId>podam</artifactId> |
| 149 | - <scope>test</scope> | 244 | + <version>${podam.version}</version> |
| 245 | + <!-- <scope>test</scope>--> <!-- TODO 调整依赖 scope --> | ||
| 246 | + <optional>true</optional> | ||
| 150 | </dependency> | 247 | </dependency> |
| 151 | 248 | ||
| 152 | <!-- 工具类相关 --> | 249 | <!-- 工具类相关 --> |
| 153 | <dependency> | 250 | <dependency> |
| 154 | <groupId>org.projectlombok</groupId> | 251 | <groupId>org.projectlombok</groupId> |
| 155 | <artifactId>lombok</artifactId> | 252 | <artifactId>lombok</artifactId> |
| 253 | + <version>${lombok.version}</version> | ||
| 156 | </dependency> | 254 | </dependency> |
| 157 | 255 | ||
| 158 | <dependency> | 256 | <dependency> |
| 159 | <groupId>org.mapstruct</groupId> | 257 | <groupId>org.mapstruct</groupId> |
| 160 | <artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher --> | 258 | <artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher --> |
| 259 | + <version>${mapstruct.version}</version> | ||
| 161 | </dependency> | 260 | </dependency> |
| 162 | <dependency> | 261 | <dependency> |
| 163 | <groupId>org.mapstruct</groupId> | 262 | <groupId>org.mapstruct</groupId> |
| 164 | <artifactId>mapstruct-processor</artifactId> | 263 | <artifactId>mapstruct-processor</artifactId> |
| 264 | + <version>${mapstruct.version}</version> | ||
| 165 | <optional>true</optional> | 265 | <optional>true</optional> |
| 166 | </dependency> | 266 | </dependency> |
| 167 | <dependency> | 267 | <dependency> |
| 168 | <groupId>org.mapstruct</groupId> | 268 | <groupId>org.mapstruct</groupId> |
| 169 | <artifactId>mapstruct-jdk8</artifactId> | 269 | <artifactId>mapstruct-jdk8</artifactId> |
| 270 | + <version>${mapstruct.version}</version> | ||
| 170 | </dependency> | 271 | </dependency> |
| 171 | 272 | ||
| 172 | <dependency> | 273 | <dependency> |
| 173 | <groupId>cn.hutool</groupId> | 274 | <groupId>cn.hutool</groupId> |
| 174 | <artifactId>hutool-all</artifactId> | 275 | <artifactId>hutool-all</artifactId> |
| 276 | + <version>${hutool.version}</version> | ||
| 175 | </dependency> | 277 | </dependency> |
| 176 | 278 | ||
| 177 | <dependency> | 279 | <dependency> |
| 178 | <groupId>com.alibaba</groupId> | 280 | <groupId>com.alibaba</groupId> |
| 179 | <artifactId>easyexcel</artifactId> | 281 | <artifactId>easyexcel</artifactId> |
| 282 | + <version>${easyexcel.verion}</version> | ||
| 180 | </dependency> | 283 | </dependency> |
| 181 | 284 | ||
| 182 | <dependency> | 285 | <dependency> |
| 183 | <groupId>org.apache.velocity</groupId> | 286 | <groupId>org.apache.velocity</groupId> |
| 184 | <artifactId>velocity-engine-core</artifactId> | 287 | <artifactId>velocity-engine-core</artifactId> |
| 288 | + <version>${velocity.version}</version> | ||
| 185 | </dependency> | 289 | </dependency> |
| 186 | 290 | ||
| 187 | <dependency> | 291 | <dependency> |
| 188 | <groupId>cn.smallbun.screw</groupId> | 292 | <groupId>cn.smallbun.screw</groupId> |
| 189 | <artifactId>screw-core</artifactId> <!-- 实现数据库文档 --> | 293 | <artifactId>screw-core</artifactId> <!-- 实现数据库文档 --> |
| 294 | + <version>${screw.version}</version> | ||
| 190 | </dependency> | 295 | </dependency> |
| 191 | 296 | ||
| 192 | <!-- 三方云服务相关 --> | 297 | <!-- 三方云服务相关 --> |
| @@ -195,18 +300,67 @@ | @@ -195,18 +300,67 @@ | ||
| 195 | <dependency> | 300 | <dependency> |
| 196 | <groupId>com.yunpian.sdk</groupId> | 301 | <groupId>com.yunpian.sdk</groupId> |
| 197 | <artifactId>yunpian-java-sdk</artifactId> | 302 | <artifactId>yunpian-java-sdk</artifactId> |
| 303 | + <version>${yunpian-java-sdk.version}</version> | ||
| 198 | </dependency> | 304 | </dependency> |
| 199 | 305 | ||
| 200 | <dependency> | 306 | <dependency> |
| 201 | <groupId>com.aliyun</groupId> | 307 | <groupId>com.aliyun</groupId> |
| 202 | <artifactId>aliyun-java-sdk-core</artifactId> | 308 | <artifactId>aliyun-java-sdk-core</artifactId> |
| 309 | + <version>${aliyun-java-sdk-core.version}</version> | ||
| 203 | </dependency> | 310 | </dependency> |
| 204 | <dependency> | 311 | <dependency> |
| 205 | <groupId>com.aliyun</groupId> | 312 | <groupId>com.aliyun</groupId> |
| 206 | <artifactId>aliyun-java-sdk-dysmsapi</artifactId> | 313 | <artifactId>aliyun-java-sdk-dysmsapi</artifactId> |
| 314 | + <version>${aliyun-java-sdk-dysmsapi.version}</version> | ||
| 207 | </dependency> | 315 | </dependency> |
| 208 | <!-- SMS SDK end --> | 316 | <!-- SMS SDK end --> |
| 209 | 317 | ||
| 210 | </dependencies> | 318 | </dependencies> |
| 211 | 319 | ||
| 320 | + <build> | ||
| 321 | + <!-- 设置构建的 jar 包名 --> | ||
| 322 | + <finalName>${project.artifactId}</finalName> | ||
| 323 | + <plugins> | ||
| 324 | + <!-- 打包 --> | ||
| 325 | + <plugin> | ||
| 326 | + <groupId>org.springframework.boot</groupId> | ||
| 327 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
| 328 | + <version>${spring.boot.version}</version> | ||
| 329 | + <configuration> | ||
| 330 | + <fork>true</fork> | ||
| 331 | + </configuration> | ||
| 332 | + <executions> | ||
| 333 | + <execution> | ||
| 334 | + <goals> | ||
| 335 | + <goal>repackage</goal> <!-- 将原来的 jar 打入其中 --> | ||
| 336 | + </goals> | ||
| 337 | + </execution> | ||
| 338 | + </executions> | ||
| 339 | + </plugin> | ||
| 340 | + | ||
| 341 | + <!-- 提供给 mapstruct 使用 --> | ||
| 342 | + <plugin> | ||
| 343 | + <groupId>org.apache.maven.plugins</groupId> | ||
| 344 | + <artifactId>maven-compiler-plugin</artifactId> | ||
| 345 | + <version>${maven-compiler-plugin.version}</version> | ||
| 346 | + <configuration> | ||
| 347 | + <source>${java.version}</source> <!-- or higher, depending on your project --> | ||
| 348 | + <target>${java.version}</target> <!-- or higher, depending on your project --> | ||
| 349 | + <annotationProcessorPaths> | ||
| 350 | + <path> | ||
| 351 | + <groupId>org.mapstruct</groupId> | ||
| 352 | + <artifactId>mapstruct-processor</artifactId> | ||
| 353 | + <version>${mapstruct.version}</version> | ||
| 354 | + </path> | ||
| 355 | + <path> | ||
| 356 | + <groupId>org.projectlombok</groupId> | ||
| 357 | + <artifactId>lombok</artifactId> | ||
| 358 | + <version>${lombok.version}</version> | ||
| 359 | + </path> | ||
| 360 | + </annotationProcessorPaths> | ||
| 361 | + </configuration> | ||
| 362 | + </plugin> | ||
| 363 | + </plugins> | ||
| 364 | + </build> | ||
| 365 | + | ||
| 212 | </project> | 366 | </project> |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/apollo/core/ConfigConsts.java
| @@ -9,6 +9,10 @@ package cn.iocoder.dashboard.framework.apollo.core; | @@ -9,6 +9,10 @@ package cn.iocoder.dashboard.framework.apollo.core; | ||
| 9 | */ | 9 | */ |
| 10 | public class ConfigConsts { | 10 | public class ConfigConsts { |
| 11 | 11 | ||
| 12 | + /** | ||
| 13 | + * {@link cn.iocoder.dashboard.framework.apollo.internals.ConfigFrameworkDAO} 的实现类 | ||
| 14 | + */ | ||
| 15 | + public static final String APOLLO_JDBC_DAO = "apollo.jdbc.dao"; | ||
| 12 | public static final String APOLLO_JDBC_URL = "apollo.jdbc.url"; | 16 | public static final String APOLLO_JDBC_URL = "apollo.jdbc.url"; |
| 13 | public static final String APOLLO_JDBC_USERNAME = "apollo.jdbc.username"; | 17 | public static final String APOLLO_JDBC_USERNAME = "apollo.jdbc.username"; |
| 14 | public static final String APOLLO_JDBC_PASSWORD = "apollo.jdbc.password"; | 18 | public static final String APOLLO_JDBC_PASSWORD = "apollo.jdbc.password"; |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/ConfigFrameworkDAO.java
| 1 | package cn.iocoder.dashboard.framework.apollo.internals; | 1 | package cn.iocoder.dashboard.framework.apollo.internals; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO; | 3 | +import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; |
| 4 | 4 | ||
| 5 | import java.util.Date; | 5 | import java.util.Date; |
| 6 | import java.util.List; | 6 | import java.util.List; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * 配置 Framework DAO 接口 | 9 | * 配置 Framework DAO 接口 |
| 10 | + * | ||
| 11 | + * 注意,实现类必须提供 (String jdbcUrl, String username, String password) 构造方法 | ||
| 12 | + * | ||
| 13 | + * @author 芋道源码 | ||
| 10 | */ | 14 | */ |
| 11 | public interface ConfigFrameworkDAO { | 15 | public interface ConfigFrameworkDAO { |
| 12 | 16 | ||
| @@ -23,6 +27,6 @@ public interface ConfigFrameworkDAO { | @@ -23,6 +27,6 @@ public interface ConfigFrameworkDAO { | ||
| 23 | * | 27 | * |
| 24 | * @return 配置列表 | 28 | * @return 配置列表 |
| 25 | */ | 29 | */ |
| 26 | - List<InfConfigDO> selectList(); | 30 | + List<ConfigRespDTO> selectList(); |
| 27 | 31 | ||
| 28 | } | 32 | } |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DBConfigRepository.java
| @@ -2,9 +2,8 @@ package cn.iocoder.dashboard.framework.apollo.internals; | @@ -2,9 +2,8 @@ package cn.iocoder.dashboard.framework.apollo.internals; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.iocoder.dashboard.framework.apollo.core.ConfigConsts; | 4 | import cn.iocoder.dashboard.framework.apollo.core.ConfigConsts; |
| 5 | +import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; | ||
| 5 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | 6 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; |
| 6 | -import cn.iocoder.dashboard.modules.infra.dal.mysql.config.InfConfigDAOImpl; | ||
| 7 | -import cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO; | ||
| 8 | import com.ctrip.framework.apollo.Apollo; | 7 | import com.ctrip.framework.apollo.Apollo; |
| 9 | import com.ctrip.framework.apollo.build.ApolloInjector; | 8 | import com.ctrip.framework.apollo.build.ApolloInjector; |
| 10 | import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; | 9 | import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; |
| @@ -59,6 +58,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | @@ -59,6 +58,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | ||
| 59 | this.propertiesFactory = ApolloInjector.getInstance(PropertiesFactory.class); | 58 | this.propertiesFactory = ApolloInjector.getInstance(PropertiesFactory.class); |
| 60 | this.m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); | 59 | this.m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); |
| 61 | // 初始化 DB | 60 | // 初始化 DB |
| 61 | + cn.iocoder.dashboard.modules.infra.dal.mysql.config | ||
| 62 | this.configFrameworkDAO = new InfConfigDAOImpl(System.getProperty(ConfigConsts.APOLLO_JDBC_URL), | 62 | this.configFrameworkDAO = new InfConfigDAOImpl(System.getProperty(ConfigConsts.APOLLO_JDBC_URL), |
| 63 | System.getProperty(ConfigConsts.APOLLO_JDBC_USERNAME), System.getProperty(ConfigConsts.APOLLO_JDBC_PASSWORD)); | 63 | System.getProperty(ConfigConsts.APOLLO_JDBC_USERNAME), System.getProperty(ConfigConsts.APOLLO_JDBC_PASSWORD)); |
| 64 | 64 | ||
| @@ -84,7 +84,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | @@ -84,7 +84,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | ||
| 84 | @Override | 84 | @Override |
| 85 | protected void sync() { | 85 | protected void sync() { |
| 86 | // 第一步,尝试获取配置 | 86 | // 第一步,尝试获取配置 |
| 87 | - List<InfConfigDO> configs = this.loadConfigIfUpdate(this.maxUpdateTime); | 87 | + List<ConfigRespDTO> configs = this.loadConfigIfUpdate(this.maxUpdateTime); |
| 88 | if (CollUtil.isEmpty(configs)) { // 如果没有更新,则返回 | 88 | if (CollUtil.isEmpty(configs)) { // 如果没有更新,则返回 |
| 89 | return; | 89 | return; |
| 90 | } | 90 | } |
| @@ -94,7 +94,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | @@ -94,7 +94,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | ||
| 94 | this.m_configCache = newProperties; | 94 | this.m_configCache = newProperties; |
| 95 | // 第三步,获取最大的配置时间 | 95 | // 第三步,获取最大的配置时间 |
| 96 | assert configs.size() > 0; // 断言,避免告警 | 96 | assert configs.size() > 0; // 断言,避免告警 |
| 97 | - this.maxUpdateTime = configs.stream().max(Comparator.comparing(BaseDO::getUpdateTime)).get().getUpdateTime(); | 97 | + this.maxUpdateTime = configs.stream().max(Comparator.comparing(ConfigRespDTO::getUpdateTime)).get().getUpdateTime(); |
| 98 | // 第四部,触发配置刷新!重要!!!! | 98 | // 第四部,触发配置刷新!重要!!!! |
| 99 | super.fireRepositoryChange(m_namespace, newProperties); | 99 | super.fireRepositoryChange(m_namespace, newProperties); |
| 100 | log.info("[sync][缓存配置,数量为:{}]", configs.size()); | 100 | log.info("[sync][缓存配置,数量为:{}]", configs.size()); |
| @@ -120,9 +120,9 @@ public class DBConfigRepository extends AbstractConfigRepository { | @@ -120,9 +120,9 @@ public class DBConfigRepository extends AbstractConfigRepository { | ||
| 120 | return ConfigSourceType.REMOTE; | 120 | return ConfigSourceType.REMOTE; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | - private Properties buildProperties(List<InfConfigDO> configs) { | 123 | + private Properties buildProperties(List<ConfigRespDTO> configs) { |
| 124 | Properties properties = propertiesFactory.getPropertiesInstance(); | 124 | Properties properties = propertiesFactory.getPropertiesInstance(); |
| 125 | - configs.stream().filter(BaseDO::getDeleted) // 过滤掉被删除的配置 | 125 | + configs.stream().filter(ConfigRespDTO::getDeleted) // 过滤掉被删除的配置 |
| 126 | .forEach(config -> properties.put(config.getKey(), config.getValue())); | 126 | .forEach(config -> properties.put(config.getKey(), config.getValue())); |
| 127 | return properties; | 127 | return properties; |
| 128 | } | 128 | } |
| @@ -153,7 +153,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | @@ -153,7 +153,7 @@ public class DBConfigRepository extends AbstractConfigRepository { | ||
| 153 | * @param maxUpdateTime 当前配置的最大更新时间 | 153 | * @param maxUpdateTime 当前配置的最大更新时间 |
| 154 | * @return 配置列表 | 154 | * @return 配置列表 |
| 155 | */ | 155 | */ |
| 156 | - private List<InfConfigDO> loadConfigIfUpdate(Date maxUpdateTime) { | 156 | + private List<ConfigRespDTO> loadConfigIfUpdate(Date maxUpdateTime) { |
| 157 | // 第一步,判断是否要更新。 | 157 | // 第一步,判断是否要更新。 |
| 158 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 | 158 | if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 |
| 159 | log.info("[loadConfigIfUpdate][首次加载全量配置]"); | 159 | log.info("[loadConfigIfUpdate][首次加载全量配置]"); |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/dto/ConfigRespDTO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.apollo.internals.dto; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 5 | +import java.util.Date; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 配置 Response DTO | ||
| 9 | + * | ||
| 10 | + * @author 芋道源码 | ||
| 11 | + */ | ||
| 12 | +@Data | ||
| 13 | +public class ConfigRespDTO { | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 参数键名 | ||
| 17 | + */ | ||
| 18 | + private String key; | ||
| 19 | + /** | ||
| 20 | + * 参数键值 | ||
| 21 | + */ | ||
| 22 | + private String value; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 是否删除 | ||
| 26 | + */ | ||
| 27 | + private Boolean deleted; | ||
| 28 | + /** | ||
| 29 | + * 更新时间 | ||
| 30 | + */ | ||
| 31 | + private Date updateTime; | ||
| 32 | + | ||
| 33 | +} |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/dict/core/dto/DictDataRespDTO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.dict.core.dto; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 字典数据 Response DTO | ||
| 8 | + * | ||
| 9 | + * @author 芋道源码 | ||
| 10 | + */ | ||
| 11 | +@Data | ||
| 12 | +public class DictDataRespDTO { | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 字典标签 | ||
| 16 | + */ | ||
| 17 | + private String label; | ||
| 18 | + /** | ||
| 19 | + * 字典值 | ||
| 20 | + */ | ||
| 21 | + private String value; | ||
| 22 | + /** | ||
| 23 | + * 字典类型 | ||
| 24 | + */ | ||
| 25 | + private String dictType; | ||
| 26 | + /** | ||
| 27 | + * 状态 | ||
| 28 | + * | ||
| 29 | + * 枚举 {@link CommonStatusEnum} | ||
| 30 | + */ | ||
| 31 | + private Integer status; | ||
| 32 | + | ||
| 33 | +} |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/dict/core/service/DictDataFrameworkService.java
| 1 | package cn.iocoder.dashboard.framework.dict.core.service; | 1 | package cn.iocoder.dashboard.framework.dict.core.service; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictDataDO; | 3 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; |
| 4 | 4 | ||
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | 6 | ||
| @@ -13,7 +13,7 @@ public interface DictDataFrameworkService { | @@ -13,7 +13,7 @@ public interface DictDataFrameworkService { | ||
| 13 | * @param value 字典数据值 | 13 | * @param value 字典数据值 |
| 14 | * @return 字典数据 | 14 | * @return 字典数据 |
| 15 | */ | 15 | */ |
| 16 | - SysDictDataDO getDictDataFromCache(String type, String value); | 16 | + DictDataRespDTO getDictDataFromCache(String type, String value); |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * 解析获得指定的字典数据,从缓存中 | 19 | * 解析获得指定的字典数据,从缓存中 |
| @@ -22,7 +22,7 @@ public interface DictDataFrameworkService { | @@ -22,7 +22,7 @@ public interface DictDataFrameworkService { | ||
| 22 | * @param label 字典数据标签 | 22 | * @param label 字典数据标签 |
| 23 | * @return 字典数据 | 23 | * @return 字典数据 |
| 24 | */ | 24 | */ |
| 25 | - SysDictDataDO parseDictDataFromCache(String type, String label); | 25 | + DictDataRespDTO parseDictDataFromCache(String type, String label); |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * 获得指定类型的字典数据,从缓存中 | 28 | * 获得指定类型的字典数据,从缓存中 |
| @@ -30,6 +30,6 @@ public interface DictDataFrameworkService { | @@ -30,6 +30,6 @@ public interface DictDataFrameworkService { | ||
| 30 | * @param type 字典类型 | 30 | * @param type 字典类型 |
| 31 | * @return 字典数据列表 | 31 | * @return 字典数据列表 |
| 32 | */ | 32 | */ |
| 33 | - List<SysDictDataDO> listDictDatasFromCache(String type); | 33 | + List<DictDataRespDTO> listDictDatasFromCache(String type); |
| 34 | 34 | ||
| 35 | } | 35 | } |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/dict/core/util/DictUtils.java
| 1 | package cn.iocoder.dashboard.framework.dict.core.util; | 1 | package cn.iocoder.dashboard.framework.dict.core.util; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; | ||
| 3 | import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService; | 4 | import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService; |
| 4 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictDataDO; | ||
| 5 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| @@ -17,11 +17,11 @@ public class DictUtils { | @@ -17,11 +17,11 @@ public class DictUtils { | ||
| 17 | log.info("[init][初始化 DictUtils 成功]"); | 17 | log.info("[init][初始化 DictUtils 成功]"); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | - public static SysDictDataDO getDictDataFromCache(String type, String value) { | 20 | + public static DictDataRespDTO getDictDataFromCache(String type, String value) { |
| 21 | return service.getDictDataFromCache(type, value); | 21 | return service.getDictDataFromCache(type, value); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | - public static SysDictDataDO parseDictDataFromCache(String type, String label) { | 24 | + public static DictDataRespDTO parseDictDataFromCache(String type, String label) { |
| 25 | return service.getDictDataFromCache(type, label); | 25 | return service.getDictDataFromCache(type, label); |
| 26 | } | 26 | } |
| 27 | 27 |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/excel/core/convert/DictConvert.java
| @@ -2,9 +2,9 @@ package cn.iocoder.dashboard.framework.excel.core.convert; | @@ -2,9 +2,9 @@ package cn.iocoder.dashboard.framework.excel.core.convert; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import cn.hutool.core.convert.Convert; | 4 | import cn.hutool.core.convert.Convert; |
| 5 | +import cn.iocoder.dashboard.framework.dict.core.dto.DictDataRespDTO; | ||
| 5 | import cn.iocoder.dashboard.framework.dict.core.util.DictUtils; | 6 | import cn.iocoder.dashboard.framework.dict.core.util.DictUtils; |
| 6 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | 7 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 7 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.dict.SysDictDataDO; | ||
| 8 | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | 8 | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; |
| 9 | import com.alibaba.excel.converters.Converter; | 9 | import com.alibaba.excel.converters.Converter; |
| 10 | import com.alibaba.excel.enums.CellDataTypeEnum; | 10 | import com.alibaba.excel.enums.CellDataTypeEnum; |
| @@ -14,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; | @@ -14,7 +14,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; | ||
| 14 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| 17 | - * Excel {@link SysDictDataDO} 数据字典转换器 | 17 | + * Excel {@link DictDataRespDTO} 数据字典转换器 |
| 18 | * | 18 | * |
| 19 | * @author 芋道源码 | 19 | * @author 芋道源码 |
| 20 | */ | 20 | */ |
| @@ -37,7 +37,7 @@ public class DictConvert implements Converter<Object> { | @@ -37,7 +37,7 @@ public class DictConvert implements Converter<Object> { | ||
| 37 | // 使用字典解析 | 37 | // 使用字典解析 |
| 38 | SysDictTypeEnum type = getType(contentProperty); | 38 | SysDictTypeEnum type = getType(contentProperty); |
| 39 | String label = cellData.getStringValue(); | 39 | String label = cellData.getStringValue(); |
| 40 | - SysDictDataDO dictData = DictUtils.parseDictDataFromCache(type.getValue(), label); | 40 | + DictDataRespDTO dictData = DictUtils.parseDictDataFromCache(type.getValue(), label); |
| 41 | if (dictData == null) { | 41 | if (dictData == null) { |
| 42 | log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); | 42 | log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); |
| 43 | return null; | 43 | return null; |
| @@ -58,7 +58,7 @@ public class DictConvert implements Converter<Object> { | @@ -58,7 +58,7 @@ public class DictConvert implements Converter<Object> { | ||
| 58 | // 使用字典格式化 | 58 | // 使用字典格式化 |
| 59 | SysDictTypeEnum type = getType(contentProperty); | 59 | SysDictTypeEnum type = getType(contentProperty); |
| 60 | String value = String.valueOf(object); | 60 | String value = String.valueOf(object); |
| 61 | - SysDictDataDO dictData = DictUtils.getDictDataFromCache(type.getValue(), value); | 61 | + DictDataRespDTO dictData = DictUtils.getDictDataFromCache(type.getValue(), value); |
| 62 | if (dictData == null) { | 62 | if (dictData == null) { |
| 63 | log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); | 63 | log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); |
| 64 | return new CellData<>(""); | 64 | return new CellData<>(""); |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/file/config/FileProperties.java
| 1 | package cn.iocoder.dashboard.framework.file.config; | 1 | package cn.iocoder.dashboard.framework.file.config; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.infra.controller.file.InfFileController; | ||
| 4 | import lombok.Data; | 3 | import lombok.Data; |
| 5 | import org.springframework.boot.context.properties.ConfigurationProperties; | 4 | import org.springframework.boot.context.properties.ConfigurationProperties; |
| 6 | import org.springframework.validation.annotation.Validated; | 5 | import org.springframework.validation.annotation.Validated; |
| @@ -13,7 +12,7 @@ import javax.validation.constraints.NotNull; | @@ -13,7 +12,7 @@ import javax.validation.constraints.NotNull; | ||
| 13 | public class FileProperties { | 12 | public class FileProperties { |
| 14 | 13 | ||
| 15 | /** | 14 | /** |
| 16 | - * 对应 {@link InfFileController#} | 15 | + * 对应 InfFileController 的 getFile 方法 |
| 17 | */ | 16 | */ |
| 18 | @NotNull(message = "基础文件路径不能为空") | 17 | @NotNull(message = "基础文件路径不能为空") |
| 19 | private String basePath; | 18 | private String basePath; |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/logger/operatelog/core/aop/OperateLogAspect.java
| @@ -6,11 +6,11 @@ import cn.hutool.core.util.StrUtil; | @@ -6,11 +6,11 @@ import cn.hutool.core.util.StrUtil; | ||
| 6 | import cn.hutool.extra.servlet.ServletUtil; | 6 | import cn.hutool.extra.servlet.ServletUtil; |
| 7 | import cn.iocoder.dashboard.common.pojo.CommonResult; | 7 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 8 | import cn.iocoder.dashboard.framework.logger.operatelog.core.annotations.OperateLog; | 8 | import cn.iocoder.dashboard.framework.logger.operatelog.core.annotations.OperateLog; |
| 9 | +import cn.iocoder.dashboard.framework.logger.operatelog.core.dto.OperateLogCreateReqDTO; | ||
| 9 | import cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum; | 10 | import cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum; |
| 10 | import cn.iocoder.dashboard.framework.logger.operatelog.core.service.OperateLogFrameworkService; | 11 | import cn.iocoder.dashboard.framework.logger.operatelog.core.service.OperateLogFrameworkService; |
| 11 | import cn.iocoder.dashboard.framework.security.core.util.SecurityFrameworkUtils; | 12 | import cn.iocoder.dashboard.framework.security.core.util.SecurityFrameworkUtils; |
| 12 | import cn.iocoder.dashboard.framework.tracer.core.util.TracerUtils; | 13 | import cn.iocoder.dashboard.framework.tracer.core.util.TracerUtils; |
| 13 | -import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogCreateReqVO; | ||
| 14 | import cn.iocoder.dashboard.util.json.JsonUtils; | 14 | import cn.iocoder.dashboard.util.json.JsonUtils; |
| 15 | import cn.iocoder.dashboard.util.servlet.ServletUtils; | 15 | import cn.iocoder.dashboard.util.servlet.ServletUtils; |
| 16 | import com.google.common.collect.Maps; | 16 | import com.google.common.collect.Maps; |
| @@ -55,13 +55,13 @@ public class OperateLogAspect { | @@ -55,13 +55,13 @@ public class OperateLogAspect { | ||
| 55 | /** | 55 | /** |
| 56 | * 用于记录操作内容的上下文 | 56 | * 用于记录操作内容的上下文 |
| 57 | * | 57 | * |
| 58 | - * @see SysOperateLogCreateReqVO#getContent() | 58 | + * @see OperateLogCreateReqDTO#getContent() |
| 59 | */ | 59 | */ |
| 60 | private static final ThreadLocal<String> CONTENT = new ThreadLocal<>(); | 60 | private static final ThreadLocal<String> CONTENT = new ThreadLocal<>(); |
| 61 | /** | 61 | /** |
| 62 | * 用于记录拓展字段的上下文 | 62 | * 用于记录拓展字段的上下文 |
| 63 | * | 63 | * |
| 64 | - * @see SysOperateLogCreateReqVO#getExts() | 64 | + * @see OperateLogCreateReqDTO#getExts() |
| 65 | */ | 65 | */ |
| 66 | private static final ThreadLocal<Map<String, Object>> EXTS = new ThreadLocal<>(); | 66 | private static final ThreadLocal<Map<String, Object>> EXTS = new ThreadLocal<>(); |
| 67 | 67 | ||
| @@ -130,106 +130,106 @@ public class OperateLogAspect { | @@ -130,106 +130,106 @@ public class OperateLogAspect { | ||
| 130 | 130 | ||
| 131 | private void log0(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation, | 131 | private void log0(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation, |
| 132 | Date startTime, Object result, Throwable exception) { | 132 | Date startTime, Object result, Throwable exception) { |
| 133 | - SysOperateLogCreateReqVO operateLogVO = new SysOperateLogCreateReqVO(); | 133 | + OperateLogCreateReqDTO operateLogDTO = new OperateLogCreateReqDTO(); |
| 134 | // 补全通用字段 | 134 | // 补全通用字段 |
| 135 | - operateLogVO.setTraceId(TracerUtils.getTraceId()); | ||
| 136 | - operateLogVO.setStartTime(startTime); | 135 | + operateLogDTO.setTraceId(TracerUtils.getTraceId()); |
| 136 | + operateLogDTO.setStartTime(startTime); | ||
| 137 | // 补充用户信息 | 137 | // 补充用户信息 |
| 138 | - fillUserFields(operateLogVO); | 138 | + fillUserFields(operateLogDTO); |
| 139 | // 补全模块信息 | 139 | // 补全模块信息 |
| 140 | - fillModuleFields(operateLogVO, joinPoint, operateLog, apiOperation); | 140 | + fillModuleFields(operateLogDTO, joinPoint, operateLog, apiOperation); |
| 141 | // 补全请求信息 | 141 | // 补全请求信息 |
| 142 | - fillRequestFields(operateLogVO); | 142 | + fillRequestFields(operateLogDTO); |
| 143 | // 补全方法信息 | 143 | // 补全方法信息 |
| 144 | - fillMethodFields(operateLogVO, joinPoint, operateLog, startTime, result, exception); | 144 | + fillMethodFields(operateLogDTO, joinPoint, operateLog, startTime, result, exception); |
| 145 | 145 | ||
| 146 | // 异步记录日志 | 146 | // 异步记录日志 |
| 147 | - operateLogFrameworkService.createOperateLogAsync(operateLogVO); | 147 | + operateLogFrameworkService.createOperateLogAsync(operateLogDTO); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | - private static void fillUserFields(SysOperateLogCreateReqVO operateLogVO) { | ||
| 151 | - operateLogVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | 150 | + private static void fillUserFields(OperateLogCreateReqDTO operateLogDTO) { |
| 151 | + operateLogDTO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | - private static void fillModuleFields(SysOperateLogCreateReqVO operateLogVO, | 154 | + private static void fillModuleFields(OperateLogCreateReqDTO operateLogDTO, |
| 155 | ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation) { | 155 | ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation) { |
| 156 | // module 属性 | 156 | // module 属性 |
| 157 | if (operateLog != null) { | 157 | if (operateLog != null) { |
| 158 | - operateLogVO.setModule(operateLog.module()); | 158 | + operateLogDTO.setModule(operateLog.module()); |
| 159 | } | 159 | } |
| 160 | - if (StrUtil.isEmpty(operateLogVO.getModule())) { | 160 | + if (StrUtil.isEmpty(operateLogDTO.getModule())) { |
| 161 | Api api = getClassAnnotation(joinPoint, Api.class); | 161 | Api api = getClassAnnotation(joinPoint, Api.class); |
| 162 | if (api != null) { | 162 | if (api != null) { |
| 163 | // 优先读取 @API 的 name 属性 | 163 | // 优先读取 @API 的 name 属性 |
| 164 | if (StrUtil.isNotEmpty(api.value())) { | 164 | if (StrUtil.isNotEmpty(api.value())) { |
| 165 | - operateLogVO.setModule(api.value()); | 165 | + operateLogDTO.setModule(api.value()); |
| 166 | } | 166 | } |
| 167 | // 没有的话,读取 @API 的 tags 属性 | 167 | // 没有的话,读取 @API 的 tags 属性 |
| 168 | - if (StrUtil.isEmpty(operateLogVO.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { | ||
| 169 | - operateLogVO.setModule(api.tags()[0]); | 168 | + if (StrUtil.isEmpty(operateLogDTO.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { |
| 169 | + operateLogDTO.setModule(api.tags()[0]); | ||
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | // name 属性 | 173 | // name 属性 |
| 174 | if (operateLog != null) { | 174 | if (operateLog != null) { |
| 175 | - operateLogVO.setName(operateLog.name()); | 175 | + operateLogDTO.setName(operateLog.name()); |
| 176 | } | 176 | } |
| 177 | - if (StrUtil.isEmpty(operateLogVO.getName()) && apiOperation != null) { | ||
| 178 | - operateLogVO.setName(apiOperation.value()); | 177 | + if (StrUtil.isEmpty(operateLogDTO.getName()) && apiOperation != null) { |
| 178 | + operateLogDTO.setName(apiOperation.value()); | ||
| 179 | } | 179 | } |
| 180 | // type 属性 | 180 | // type 属性 |
| 181 | if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { | 181 | if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { |
| 182 | - operateLogVO.setType(operateLog.type()[0].getType()); | 182 | + operateLogDTO.setType(operateLog.type()[0].getType()); |
| 183 | } | 183 | } |
| 184 | - if (operateLogVO.getType() == null) { | 184 | + if (operateLogDTO.getType() == null) { |
| 185 | RequestMethod requestMethod = obtainFirstMatchRequestMethod(obtainRequestMethod(joinPoint)); | 185 | RequestMethod requestMethod = obtainFirstMatchRequestMethod(obtainRequestMethod(joinPoint)); |
| 186 | OperateTypeEnum operateLogType = convertOperateLogType(requestMethod); | 186 | OperateTypeEnum operateLogType = convertOperateLogType(requestMethod); |
| 187 | - operateLogVO.setType(operateLogType != null ? operateLogType.getType() : null); | 187 | + operateLogDTO.setType(operateLogType != null ? operateLogType.getType() : null); |
| 188 | } | 188 | } |
| 189 | // content 和 exts 属性 | 189 | // content 和 exts 属性 |
| 190 | - operateLogVO.setContent(CONTENT.get()); | ||
| 191 | - operateLogVO.setExts(EXTS.get()); | 190 | + operateLogDTO.setContent(CONTENT.get()); |
| 191 | + operateLogDTO.setExts(EXTS.get()); | ||
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | - private static void fillRequestFields(SysOperateLogCreateReqVO operateLogVO) { | 194 | + private static void fillRequestFields(OperateLogCreateReqDTO operateLogDTO) { |
| 195 | // 获得 Request 对象 | 195 | // 获得 Request 对象 |
| 196 | HttpServletRequest request = ServletUtils.getRequest(); | 196 | HttpServletRequest request = ServletUtils.getRequest(); |
| 197 | if (request == null) { | 197 | if (request == null) { |
| 198 | return; | 198 | return; |
| 199 | } | 199 | } |
| 200 | // 补全请求信息 | 200 | // 补全请求信息 |
| 201 | - operateLogVO.setRequestMethod(request.getMethod()); | ||
| 202 | - operateLogVO.setRequestUrl(request.getRequestURI()); | ||
| 203 | - operateLogVO.setUserIp(ServletUtil.getClientIP(request)); | ||
| 204 | - operateLogVO.setUserAgent(ServletUtils.getUserAgent(request)); | 201 | + operateLogDTO.setRequestMethod(request.getMethod()); |
| 202 | + operateLogDTO.setRequestUrl(request.getRequestURI()); | ||
| 203 | + operateLogDTO.setUserIp(ServletUtil.getClientIP(request)); | ||
| 204 | + operateLogDTO.setUserAgent(ServletUtils.getUserAgent(request)); | ||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | - private static void fillMethodFields(SysOperateLogCreateReqVO operateLogVO, | 207 | + private static void fillMethodFields(OperateLogCreateReqDTO operateLogDTO, |
| 208 | ProceedingJoinPoint joinPoint, OperateLog operateLog, | 208 | ProceedingJoinPoint joinPoint, OperateLog operateLog, |
| 209 | Date startTime, Object result, Throwable exception) { | 209 | Date startTime, Object result, Throwable exception) { |
| 210 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); | 210 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); |
| 211 | - operateLogVO.setJavaMethod(methodSignature.toString()); | 211 | + operateLogDTO.setJavaMethod(methodSignature.toString()); |
| 212 | if (operateLog == null || operateLog.logArgs()) { | 212 | if (operateLog == null || operateLog.logArgs()) { |
| 213 | - operateLogVO.setJavaMethodArgs(obtainMethodArgs(joinPoint)); | 213 | + operateLogDTO.setJavaMethodArgs(obtainMethodArgs(joinPoint)); |
| 214 | } | 214 | } |
| 215 | if (operateLog == null || operateLog.logResultData()) { | 215 | if (operateLog == null || operateLog.logResultData()) { |
| 216 | - operateLogVO.setResultData(obtainResultData(result)); | 216 | + operateLogDTO.setResultData(obtainResultData(result)); |
| 217 | } | 217 | } |
| 218 | - operateLogVO.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); | 218 | + operateLogDTO.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); |
| 219 | // (正常)处理 resultCode 和 resultMsg 字段 | 219 | // (正常)处理 resultCode 和 resultMsg 字段 |
| 220 | if (result != null) { | 220 | if (result != null) { |
| 221 | if (result instanceof CommonResult) { | 221 | if (result instanceof CommonResult) { |
| 222 | CommonResult<?> commonResult = (CommonResult<?>) result; | 222 | CommonResult<?> commonResult = (CommonResult<?>) result; |
| 223 | - operateLogVO.setResultCode(commonResult.getCode()); | ||
| 224 | - operateLogVO.setResultMsg(commonResult.getMsg()); | 223 | + operateLogDTO.setResultCode(commonResult.getCode()); |
| 224 | + operateLogDTO.setResultMsg(commonResult.getMsg()); | ||
| 225 | } else { | 225 | } else { |
| 226 | - operateLogVO.setResultCode(SUCCESS.getCode()); | 226 | + operateLogDTO.setResultCode(SUCCESS.getCode()); |
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| 229 | // (异常)处理 resultCode 和 resultMsg 字段 | 229 | // (异常)处理 resultCode 和 resultMsg 字段 |
| 230 | if (exception != null) { | 230 | if (exception != null) { |
| 231 | - operateLogVO.setResultCode(INTERNAL_SERVER_ERROR.getCode()); | ||
| 232 | - operateLogVO.setResultMsg(ExceptionUtil.getRootCauseMessage(exception)); | 231 | + operateLogDTO.setResultCode(INTERNAL_SERVER_ERROR.getCode()); |
| 232 | + operateLogDTO.setResultMsg(ExceptionUtil.getRootCauseMessage(exception)); | ||
| 233 | } | 233 | } |
| 234 | } | 234 | } |
| 235 | 235 |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/logger/operatelog/core/dto/OperateLogCreateReqDTO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.logger.operatelog.core.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModelProperty; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotEmpty; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import java.util.Date; | ||
| 9 | +import java.util.Map; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 操作日志创建 Request DTO | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +public class OperateLogCreateReqDTO { | ||
| 16 | + | ||
| 17 | + @ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||
| 18 | + @NotEmpty(message = "链路追踪编号不能为空") | ||
| 19 | + private String traceId; | ||
| 20 | + | ||
| 21 | + @ApiModelProperty(value = "用户编号", required = true, example = "1024") | ||
| 22 | + @NotNull(message = "用户编号不能为空") | ||
| 23 | + private Long userId; | ||
| 24 | + | ||
| 25 | + @ApiModelProperty(value = "操作模块", required = true, example = "订单") | ||
| 26 | + @NotEmpty(message = "操作模块不能为空") | ||
| 27 | + private String module; | ||
| 28 | + | ||
| 29 | + @ApiModelProperty(value = "操作名", required = true, example = "创建订单") | ||
| 30 | + @NotEmpty(message = "操作名") | ||
| 31 | + private String name; | ||
| 32 | + | ||
| 33 | + @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") | ||
| 34 | + @NotNull(message = "操作分类不能为空") | ||
| 35 | + private Integer type; | ||
| 36 | + | ||
| 37 | + @ApiModelProperty(value = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。") | ||
| 38 | + private String content; | ||
| 39 | + | ||
| 40 | + @ApiModelProperty(value = "拓展字段", example = "{'orderId': 1}") | ||
| 41 | + private Map<String, Object> exts; | ||
| 42 | + | ||
| 43 | + @ApiModelProperty(value = "请求方法名", required = true, example = "GET") | ||
| 44 | + @NotEmpty(message = "请求方法名不能为空") | ||
| 45 | + private String requestMethod; | ||
| 46 | + | ||
| 47 | + @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") | ||
| 48 | + @NotEmpty(message = "请求地址不能为空") | ||
| 49 | + private String requestUrl; | ||
| 50 | + | ||
| 51 | + @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") | ||
| 52 | + @NotEmpty(message = "用户 IP 不能为空") | ||
| 53 | + private String userIp; | ||
| 54 | + | ||
| 55 | + @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") | ||
| 56 | + @NotEmpty(message = "浏览器 UserAgent 不能为空") | ||
| 57 | + private String userAgent; | ||
| 58 | + | ||
| 59 | + @ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.dashboard.UserController.save(...)") | ||
| 60 | + @NotEmpty(message = "Java 方法名不能为空") | ||
| 61 | + private String javaMethod; | ||
| 62 | + | ||
| 63 | + @ApiModelProperty(value = "Java 方法的参数") | ||
| 64 | + private String javaMethodArgs; | ||
| 65 | + | ||
| 66 | + @ApiModelProperty(value = "开始时间", required = true) | ||
| 67 | + @NotNull(message = "开始时间不能为空") | ||
| 68 | + private Date startTime; | ||
| 69 | + | ||
| 70 | + @ApiModelProperty(value = "执行时长,单位:毫秒", required = true) | ||
| 71 | + @NotNull(message = "执行时长不能为空") | ||
| 72 | + private Integer duration; | ||
| 73 | + | ||
| 74 | + @ApiModelProperty(value = "结果码", required = true) | ||
| 75 | + @NotNull(message = "结果码不能为空") | ||
| 76 | + private Integer resultCode; | ||
| 77 | + | ||
| 78 | + @ApiModelProperty(value = "结果提示") | ||
| 79 | + private String resultMsg; | ||
| 80 | + | ||
| 81 | + @ApiModelProperty(value = "结果数据") | ||
| 82 | + private String resultData; | ||
| 83 | + | ||
| 84 | +} |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/logger/operatelog/core/service/OperateLogFrameworkService.java
| 1 | package cn.iocoder.dashboard.framework.logger.operatelog.core.service; | 1 | package cn.iocoder.dashboard.framework.logger.operatelog.core.service; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog.SysOperateLogCreateReqVO; | 3 | +import cn.iocoder.dashboard.framework.logger.operatelog.core.dto.OperateLogCreateReqDTO; |
| 4 | 4 | ||
| 5 | import java.util.concurrent.Future; | 5 | import java.util.concurrent.Future; |
| 6 | 6 | ||
| @@ -12,6 +12,6 @@ public interface OperateLogFrameworkService { | @@ -12,6 +12,6 @@ public interface OperateLogFrameworkService { | ||
| 12 | * @param reqVO 操作日志请求 | 12 | * @param reqVO 操作日志请求 |
| 13 | * @return true: 记录成功,false: 记录失败 | 13 | * @return true: 记录成功,false: 记录失败 |
| 14 | */ | 14 | */ |
| 15 | - Future<Boolean> createOperateLogAsync(SysOperateLogCreateReqVO reqVO); | 15 | + Future<Boolean> createOperateLogAsync(OperateLogCreateReqDTO reqVO); |
| 16 | 16 | ||
| 17 | } | 17 | } |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/mybatis/core/type/JsonLongSetTypeHandler.java
| 1 | package cn.iocoder.dashboard.framework.mybatis.core.type; | 1 | package cn.iocoder.dashboard.framework.mybatis.core.type; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.user.SysUserDO; | ||
| 4 | import cn.iocoder.dashboard.util.json.JsonUtils; | 3 | import cn.iocoder.dashboard.util.json.JsonUtils; |
| 5 | import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; | 4 | import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; |
| 6 | import com.fasterxml.jackson.core.type.TypeReference; | 5 | import com.fasterxml.jackson.core.type.TypeReference; |
| @@ -11,7 +10,7 @@ import java.util.Set; | @@ -11,7 +10,7 @@ import java.util.Set; | ||
| 11 | * 参考 {@link com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler} 实现 | 10 | * 参考 {@link com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler} 实现 |
| 12 | * 在我们将字符串反序列化为 Set 并且泛型为 Long 时,如果每个元素的数值太小,会被处理成 Integer 类型,导致可能存在隐性的 BUG。 | 11 | * 在我们将字符串反序列化为 Set 并且泛型为 Long 时,如果每个元素的数值太小,会被处理成 Integer 类型,导致可能存在隐性的 BUG。 |
| 13 | * | 12 | * |
| 14 | - * 例如说哦,{@link SysUserDO#getPostIds()} 属性 | 13 | + * 例如说哦,SysUserDO 的 postIds 属性 |
| 15 | * | 14 | * |
| 16 | * @author 芋道源码 | 15 | * @author 芋道源码 |
| 17 | */ | 16 | */ |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/security/core/filter/JwtAuthenticationTokenFilter.java
| @@ -4,9 +4,9 @@ import cn.hutool.core.util.StrUtil; | @@ -4,9 +4,9 @@ import cn.hutool.core.util.StrUtil; | ||
| 4 | import cn.iocoder.dashboard.common.pojo.CommonResult; | 4 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 5 | import cn.iocoder.dashboard.framework.security.config.SecurityProperties; | 5 | import cn.iocoder.dashboard.framework.security.config.SecurityProperties; |
| 6 | import cn.iocoder.dashboard.framework.security.core.LoginUser; | 6 | import cn.iocoder.dashboard.framework.security.core.LoginUser; |
| 7 | +import cn.iocoder.dashboard.framework.security.core.service.SecurityAuthFrameworkService; | ||
| 7 | import cn.iocoder.dashboard.framework.security.core.util.SecurityFrameworkUtils; | 8 | import cn.iocoder.dashboard.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | import cn.iocoder.dashboard.framework.web.core.handler.GlobalExceptionHandler; | 9 | import cn.iocoder.dashboard.framework.web.core.handler.GlobalExceptionHandler; |
| 9 | -import cn.iocoder.dashboard.modules.system.service.auth.SysAuthService; | ||
| 10 | import cn.iocoder.dashboard.util.servlet.ServletUtils; | 10 | import cn.iocoder.dashboard.util.servlet.ServletUtils; |
| 11 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
| 12 | import org.springframework.web.filter.OncePerRequestFilter; | 12 | import org.springframework.web.filter.OncePerRequestFilter; |
| @@ -30,7 +30,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { | @@ -30,7 +30,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { | ||
| 30 | @Resource | 30 | @Resource |
| 31 | private SecurityProperties securityProperties; | 31 | private SecurityProperties securityProperties; |
| 32 | @Resource | 32 | @Resource |
| 33 | - private SysAuthService authService; | 33 | + private SecurityAuthFrameworkService authService; |
| 34 | @Resource | 34 | @Resource |
| 35 | private GlobalExceptionHandler globalExceptionHandler; | 35 | private GlobalExceptionHandler globalExceptionHandler; |
| 36 | 36 |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/security/core/service/SecurityPermissionFrameworkService.java
| 1 | package cn.iocoder.dashboard.framework.security.core.service; | 1 | package cn.iocoder.dashboard.framework.security.core.service; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.permission.SysRoleDO; | ||
| 4 | - | ||
| 5 | /** | 3 | /** |
| 6 | * Security 框架 Permission Service 接口,定义 security 组件需要的功能 | 4 | * Security 框架 Permission Service 接口,定义 security 组件需要的功能 |
| 7 | * | 5 | * |
| @@ -28,7 +26,7 @@ public interface SecurityPermissionFrameworkService { | @@ -28,7 +26,7 @@ public interface SecurityPermissionFrameworkService { | ||
| 28 | /** | 26 | /** |
| 29 | * 判断是否有角色 | 27 | * 判断是否有角色 |
| 30 | * | 28 | * |
| 31 | - * 注意,角色使用的是 {@link SysRoleDO#getCode()} 标识 | 29 | + * 注意,角色使用的是 SysRoleDO 的 code 标识 |
| 32 | * | 30 | * |
| 33 | * @param role 角色 | 31 | * @param role 角色 |
| 34 | * @return 是否 | 32 | * @return 是否 |
yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java renamed to yudao-framework/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java
yudao-framework/src/main/java/cn/iocoder/dashboard/util/RandomUtils.java
| @@ -3,7 +3,6 @@ package cn.iocoder.dashboard.util; | @@ -3,7 +3,6 @@ package cn.iocoder.dashboard.util; | ||
| 3 | import cn.hutool.core.util.ArrayUtil; | 3 | import cn.hutool.core.util.ArrayUtil; |
| 4 | import cn.hutool.core.util.RandomUtil; | 4 | import cn.hutool.core.util.RandomUtil; |
| 5 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | 5 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; |
| 6 | -import cn.iocoder.dashboard.modules.system.dal.dataobject.user.SysUserDO; | ||
| 7 | import uk.co.jemos.podam.api.PodamFactory; | 6 | import uk.co.jemos.podam.api.PodamFactory; |
| 8 | import uk.co.jemos.podam.api.PodamFactoryImpl; | 7 | import uk.co.jemos.podam.api.PodamFactoryImpl; |
| 9 | 8 | ||
| @@ -72,11 +71,6 @@ public class RandomUtils { | @@ -72,11 +71,6 @@ public class RandomUtils { | ||
| 72 | } | 71 | } |
| 73 | 72 | ||
| 74 | @SafeVarargs | 73 | @SafeVarargs |
| 75 | - public static SysUserDO randomUserDO(Consumer<SysUserDO>... consumers) { | ||
| 76 | - return randomPojo(SysUserDO.class, consumers); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - @SafeVarargs | ||
| 80 | public static <T> T randomPojo(Class<T> clazz, Consumer<T>... consumers) { | 74 | public static <T> T randomPojo(Class<T> clazz, Consumer<T>... consumers) { |
| 81 | T pojo = PODAM_FACTORY.manufacturePojo(clazz); | 75 | T pojo = PODAM_FACTORY.manufacturePojo(clazz); |
| 82 | // 非空时,回调逻辑。通过它,可以实现 Pojo 的进一步处理 | 76 | // 非空时,回调逻辑。通过它,可以实现 Pojo 的进一步处理 |
yudao-framework/src/test/java/cn/iocoder/dashboard/BaseMockitoUnitTest.java
0 → 100644
yudao-admin-server/src/test/java/cn/iocoder/dashboard/framework/package-info.java renamed to yudao-framework/src/test/java/cn/iocoder/dashboard/framework/package-info.java
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java renamed to yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java renamed to yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java
yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/package-info.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.sms.core.client.impl; |
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java renamed to yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java
yudao-framework/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java renamed to yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java
yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/package-info.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.sms.core.client; |
yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/core/package-info.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.sms.core; |
yudao-framework/src/test/java/cn/iocoder/dashboard/framework/sms/package-info.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.sms; |
yudao-framework/src/test/java/cn/iocoder/dashboard/package-info.java
0 → 100644
| 1 | +package cn.iocoder.dashboard; |