Merge remote-tracking branch 'base-version/main' into dev
# Conflicts: # sql/mysql/ruoyi-vue-pro.sql # zt-module-infra/zt-module-infra-api/src/main/java/com/zt/plat/module/infra/api/websocket/WebSocketSenderApi.java # zt-module-infra/zt-module-infra-server/src/main/resources/application-dev.yaml
This commit is contained in:
@@ -11,7 +11,7 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - API 访问日志")
|
||||
public interface ApiAccessLogCommonApi {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - API 异常日志")
|
||||
public interface ApiErrorLogCommonApi {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 字典数据")
|
||||
public interface DictDataCommonApi {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DictDataRespDTO {
|
||||
|
||||
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "字典值", requiredMode = Schema.RequiredMode.REQUIRED, example = "iocoder")
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 操作日志")
|
||||
public interface OperateLogCommonApi {
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class OperateLogCreateReqDTO {
|
||||
@NotNull(message = "操作模块业务编号不能为空")
|
||||
private Long bizId;
|
||||
@Schema(description = "操作内容", requiredMode = Schema.RequiredMode.REQUIRED,
|
||||
example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码")
|
||||
example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码")
|
||||
@NotEmpty(message = "操作内容不能为空")
|
||||
private String action;
|
||||
@Schema(description = "拓展字段", example = "{\"orderId\": \"1\"}")
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - OAuth2.0 令牌")
|
||||
public interface OAuth2TokenCommonApi {
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class OAuth2AccessTokenCheckRespDTO implements Serializable {
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "用户信息", example = "{\"nickname\": \"芋道\"}")
|
||||
@Schema(description = "用户信息", example = "{\"nickname\": \"ZT\"}")
|
||||
private Map<String, String> userInfo;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME, primary = false) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 权限")
|
||||
public interface PermissionCommonApi {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME) // TODO 芋艿:fallbackFactory =
|
||||
@FeignClient(name = RpcConstants.SYSTEM_NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 多租户")
|
||||
public interface TenantCommonApi {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CacheUtils {
|
||||
// 只阻塞当前数据加载线程,其他线程返回旧值
|
||||
.refreshAfterWrite(duration)
|
||||
// 通过 asyncReloading 实现全异步加载,包括 refreshAfterWrite 被阻塞的加载线程
|
||||
.build(CacheLoader.asyncReloading(loader, Executors.newCachedThreadPool())); // TODO 芋艿:可能要思考下,未来要不要做成可配置
|
||||
.build(CacheLoader.asyncReloading(loader, Executors.newCachedThreadPool())); // TODO ZT:可能要思考下,未来要不要做成可配置
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Validation/?zt>
|
||||
@@ -152,7 +152,7 @@ public class DeptDataPermissionRule implements DataPermissionRule {
|
||||
// Expression deptExpression = buildDeptExpression(tableName, tableAlias, deptDataPermission.getDeptIds());
|
||||
Expression userExpression = buildUserExpression(tableName, tableAlias, deptDataPermission.getSelf(), loginUser.getId());
|
||||
if (deptExpression == null && userExpression == null) {
|
||||
// TODO 芋艿:获得不到条件的时候,暂时不抛出异常,而是不返回数据
|
||||
// TODO ZT:获得不到条件的时候,暂时不抛出异常,而是不返回数据
|
||||
log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]",
|
||||
JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(deptDataPermission));
|
||||
// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空",
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TenantJobAspect {
|
||||
AtomicBoolean success = new AtomicBoolean(true); // 标记,是否存在失败的情况
|
||||
XxlJobContext xxlJobContext = XxlJobContext.getXxlJobContext(); // XXL-Job 上下文
|
||||
tenantIds.parallelStream().forEach(tenantId -> {
|
||||
// TODO 芋艿:先通过 parallel 实现并行;1)多个租户,是一条执行日志;2)异常的情况
|
||||
// TODO ZT:先通过 parallel 实现并行;1)多个租户,是一条执行日志;2)异常的情况
|
||||
TenantUtils.execute(tenantId, () -> {
|
||||
try {
|
||||
XxlJobContext.setXxlJobContext(xxlJobContext);
|
||||
|
||||
@@ -40,7 +40,7 @@ import static com.zt.plat.framework.web.core.util.WebFrameworkUtils.HEADER_TENAN
|
||||
* {@link HandlerMethodArgumentResolver}.
|
||||
*
|
||||
* 针对 rabbitmq-spring 和 kafka-spring,不存在合适的拓展点,可以实现 Consumer 消费前,读取 Header 中的 tenant-id 设置到 {@link TenantContextHolder} 中
|
||||
* TODO 芋艿:持续跟进,看看有没新的拓展点
|
||||
* TODO ZT:持续跟进,看看有没新的拓展点
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -74,9 +74,9 @@ public class EnvLoadBalancerClient implements ReactorServiceInstanceLoadBalancer
|
||||
chooseInstances = instances;
|
||||
}
|
||||
|
||||
// TODO 芋艿:https://juejin.cn/post/7056770721858469896 想通网段
|
||||
// TODO ZT:https://juejin.cn/post/7056770721858469896 想通网段
|
||||
|
||||
// 随机 + 权重获取实例列表 TODO 芋艿:目前直接使用 Nacos 提供的方法,如果替换注册中心,需要重新失败该方法
|
||||
// 随机 + 权重获取实例列表 TODO ZT:目前直接使用 Nacos 提供的方法,如果替换注册中心,需要重新失败该方法
|
||||
return new DefaultResponse(NacosBalancer.getHostByRandomWeight3(chooseInstances));
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Job/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Async-Job/?zt>
|
||||
@@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean;
|
||||
@ConditionalOnProperty(prefix = "zt.tracer", value = "enable", matchIfMissing = true)
|
||||
public class ZtTracerAutoConfiguration {
|
||||
|
||||
// TODO @芋艿:重要。目前 opentracing 版本存在冲突,要么保证 skywalking,要么保证阿里云短信 sdk
|
||||
// TODO @ZT:重要。目前 opentracing 版本存在冲突,要么保证 skywalking,要么保证阿里云短信 sdk
|
||||
// @Bean
|
||||
// public TracerProperties bizTracerProperties() {
|
||||
// return new TracerProperties();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<https://www.iocoder.cn/Spring-Boot/Admin/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<https://www.iocoder.cn/Spring-Boot/Actuator/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/SkyWalking/?zt>
|
||||
@@ -63,7 +63,7 @@ public abstract class AbstractRedisStreamMessageListener<T extends AbstractRedis
|
||||
this.onMessage(messageObj);
|
||||
// ack 消息消费完成
|
||||
redisMQTemplate.getRedisTemplate().opsForStream().acknowledge(group, message);
|
||||
// TODO 芋艿:需要额外考虑以下几个点:
|
||||
// TODO ZT:需要额外考虑以下几个点:
|
||||
// 1. 处理异常的情况
|
||||
// 2. 发送日志;以及事务的结合
|
||||
// 3. 消费日志;以及通用的幂等性
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/RocketMQ/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Kafka/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/RabbitMQ/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/RocketMQ/?zt>
|
||||
@@ -38,7 +38,7 @@ public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor
|
||||
}
|
||||
|
||||
// 设置 Quartz JobStore 对应的 Driver
|
||||
// TODO 芋艿:暂时没有找到特别合适的地方,先放在这里
|
||||
// TODO ZT:暂时没有找到特别合适的地方,先放在这里
|
||||
setJobStoreDriverIfPresent(environment, dbType);
|
||||
|
||||
// 如果非 NONE,则不进行处理
|
||||
|
||||
@@ -142,7 +142,7 @@ public class QueryWrapperX<T> extends QueryWrapper<T> {
|
||||
/**
|
||||
* 设置只返回最后一条
|
||||
*
|
||||
* TODO 芋艿:不是完美解,需要在思考下。如果使用多数据源,并且数据源是多种类型时,可能会存在问题:实现之返回一条的语法不同
|
||||
* TODO ZT:不是完美解,需要在思考下。如果使用多数据源,并且数据源是多种类型时,可能会存在问题:实现之返回一条的语法不同
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/MyBatis/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/dynamic-datasource/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/datasource-pool/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Cache/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Redis/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Feign/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Cloud/Feign/?zt>
|
||||
@@ -62,7 +62,7 @@ public class LogRecordServiceImpl implements ILogRecordService {
|
||||
reqDTO.setType(logRecord.getType()); // 大模块类型,例如:CRM 客户
|
||||
reqDTO.setSubType(logRecord.getSubType());// 操作名称,例如:转移客户
|
||||
reqDTO.setBizId(Long.parseLong(logRecord.getBizNo())); // 业务编号,例如:客户编号
|
||||
reqDTO.setAction(logRecord.getAction());// 操作内容,例如:修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。
|
||||
reqDTO.setAction(logRecord.getAction());// 操作内容,例如:修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码。
|
||||
reqDTO.setExtra(logRecord.getExtra()); // 拓展字段,有些复杂的业务,需要记录一些字段 ( JSON 格式 ),例如说,记录订单编号,{ orderId: "1"}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
* 芋道 Spring Security 入门:<http://www.iocoder.cn/Spring-Boot/Spring-Security/?zt>
|
||||
* Spring Security 基本概念:<http://www.iocoder.cn/Fight/Spring-Security-4-1-0-Basic-concept-description/?zt>
|
||||
@@ -87,7 +87,7 @@ mybatis-plus:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
env: # 多环境的配置项
|
||||
tag: ${dollar}{HOSTNAME}
|
||||
|
||||
@@ -114,9 +114,9 @@ logging:
|
||||
# 配置自己写的 MyBatis Mapper 打印日志
|
||||
${basePackage}.${packageName}.dal.dao: debug
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
--- #################### ZT相关配置 ####################
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
demo: false # 开启演示模式
|
||||
# 附件加密相关配置
|
||||
|
||||
@@ -115,9 +115,9 @@ logging:
|
||||
${basePackage}.${packageName}.dal.dao: debug
|
||||
root: info
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
--- #################### ZT相关配置 ####################
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
# ZT配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
demo: false # 开启演示模式
|
||||
# 附件加密相关配置
|
||||
|
||||
@@ -65,7 +65,7 @@ spring:
|
||||
repositories:
|
||||
enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
--- #################### ZT相关配置 ####################
|
||||
|
||||
zt:
|
||||
info:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<https://www.iocoder.cn/Spring-Boot/Unit-Test/?zt>
|
||||
@@ -29,7 +29,7 @@ public class DesensitizeTest {
|
||||
public void test() {
|
||||
// 准备参数
|
||||
DesensitizeDemo desensitizeDemo = new DesensitizeDemo();
|
||||
desensitizeDemo.setNickname("芋道源码");
|
||||
desensitizeDemo.setNickname("ZT源码");
|
||||
desensitizeDemo.setBankCard("9988002866797031");
|
||||
desensitizeDemo.setCarLicense("粤A66666");
|
||||
desensitizeDemo.setFixedPhone("01086551122");
|
||||
@@ -40,9 +40,9 @@ public class DesensitizeTest {
|
||||
desensitizeDemo.setSlider2("ABCDEFG");
|
||||
desensitizeDemo.setSlider3("ABCDEFG");
|
||||
desensitizeDemo.setEmail("1@email.com");
|
||||
desensitizeDemo.setRegex("你好,我是芋道源码");
|
||||
desensitizeDemo.setRegex("你好,我是ZT源码");
|
||||
desensitizeDemo.setAddress("北京市海淀区上地十街10号");
|
||||
desensitizeDemo.setOrigin("芋道源码");
|
||||
desensitizeDemo.setOrigin("ZT源码");
|
||||
|
||||
// 调用
|
||||
DesensitizeDemo d = JsonUtils.parseObject(JsonUtils.toJsonString(desensitizeDemo), DesensitizeDemo.class);
|
||||
@@ -61,7 +61,7 @@ public class DesensitizeTest {
|
||||
assertEquals("1****@email.com", d.getEmail());
|
||||
assertEquals("你好,我是*", d.getRegex());
|
||||
assertEquals("北京市海淀区上地十街10号*", d.getAddress());
|
||||
assertEquals("芋道源码", d.getOrigin());
|
||||
assertEquals("ZT源码", d.getOrigin());
|
||||
}
|
||||
|
||||
@Data
|
||||
@@ -89,7 +89,7 @@ public class DesensitizeTest {
|
||||
private String slider3;
|
||||
@EmailDesensitize
|
||||
private String email;
|
||||
@RegexDesensitize(regex = "芋道源码", replacer = "*")
|
||||
@RegexDesensitize(regex = "ZT源码", replacer = "*")
|
||||
private String regex;
|
||||
@Address
|
||||
private String address;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Swagger/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/SpringMVC/?zt>
|
||||
@@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/WebSocket/?zt>
|
||||
Reference in New Issue
Block a user