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:
chenbowen
2025-12-01 10:21:34 +08:00
438 changed files with 859 additions and 1650219 deletions

View File

@@ -15,7 +15,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 部门")
public interface DeptApi {

View File

@@ -18,7 +18,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 岗位")
public interface PostApi {

View File

@@ -15,7 +15,7 @@ public class CompanyDeptInfoRespDTO {
@Schema(description = "公司编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long companyId;
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
private String companyName;
@Schema(description = "公司编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxx")

View File

@@ -17,7 +17,7 @@ public class DeptDetailRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")

View File

@@ -14,7 +14,7 @@ import java.util.List;
@Data
public class DeptListReqDTO {
@Schema(description = "部门名称,模糊匹配", example = "芋道")
@Schema(description = "部门名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")

View File

@@ -15,7 +15,7 @@ public class DeptSaveReqDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")

View File

@@ -15,7 +15,7 @@ public class DeptSimpleRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
@Schema(description = "部门名称", example = "ZT")
private String name;
@Schema(description = "父部门 ID", example = "1024")

View File

@@ -18,7 +18,7 @@ public class PostPageReqDTO extends PageParam {
@Schema(description = "岗位编码,模糊匹配", example = "zt")
private String code;
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
@Schema(description = "岗位名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")

View File

@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 字典数据")
public interface DictDataApi extends DictDataCommonApi {

View File

@@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class DictDataPageReqDTO extends PageParam {
@Schema(description = "字典标签", example = "芋道")
@Schema(description = "字典标签", example = "ZT")
private String label;
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import jakarta.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 登录日志")
public interface LoginLogApi {

View File

@@ -12,7 +12,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 操作日志")
public interface OperateLogApi extends OperateLogCommonApi {

View File

@@ -21,7 +21,7 @@ public class OperateLogRespDTO implements VO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "userName")
private Long userId;
@Schema(description = "用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String userName;
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2" )
private Integer userType;
@@ -32,7 +32,7 @@ public class OperateLogRespDTO implements VO {
@Schema(description = "操作模块业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "188")
private Long bizId;
@Schema(description = "操作内容", requiredMode = Schema.RequiredMode.REQUIRED,
example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码")
example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码")
private String action;
@Schema(description = "拓展字段", example = "{\"orderId\": \"1\"}")
private String extra;

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 邮件发送")
public interface MailSendApi {

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 站内信发送")
public interface NotifyMessageSendApi {

View File

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Set;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 权限")
public interface PermissionApi extends PermissionCommonApi {

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 角色")
public interface RoleApi {

View File

@@ -17,7 +17,7 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
public class RolePageReqDTO extends PageParam {
@Schema(description = "角色名称,模糊匹配", example = "芋道")
@Schema(description = "角色名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "角色标识,模糊匹配", example = "admin")

View File

@@ -14,7 +14,7 @@ import java.util.List;
/**
* @author chenbowen
*/
@FeignClient(name = ApiConstants.NAME, primary = false) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME, primary = false) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 序列号")
public interface SequenceApi extends SequenceCommonApi {

View File

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import jakarta.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 短信验证码")
public interface SmsCodeApi {

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import jakarta.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 短信发送")
public interface SmsSendApi {

View File

@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 社交应用")
public interface SocialClientApi {

View File

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
import jakarta.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 社交用户")
public interface SocialUserApi {

View File

@@ -14,7 +14,7 @@ public class SocialUserRespDTO {
@Schema(description = "社交用户 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
private String openid;
@Schema(description = "社交用户的昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "社交用户的昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
private String nickname;
@Schema(description = "社交用户的头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.jpg")

View File

@@ -24,7 +24,7 @@ import java.util.Map;
import static com.zt.plat.module.system.api.user.AdminUserApi.PREFIX;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 管理员用户")
@AutoTrans(namespace = PREFIX, fields = {"nickname"})
public interface AdminUserApi extends AutoTransable<AdminUserRespDTO> {

View File

@@ -22,7 +22,7 @@ public class AdminUserDetailRespDTO {
@Schema(description = "用户账号", example = "zt")
private String username;
@Schema(description = "用户昵称", example = "芋艿")
@Schema(description = "用户昵称", example = "ZT")
private String nickname;
@Schema(description = "备注", example = "我是一个用户")

View File

@@ -20,7 +20,7 @@ public class AdminUserSaveReqDTO {
@Schema(description = "用户账号", example = "zt")
private String username;
@Schema(description = "用户昵称", example = "芋艿")
@Schema(description = "用户昵称", example = "ZT")
private String nickname;
@Schema(description = "备注", example = "我是一个用户")

View File

@@ -15,7 +15,7 @@ public class AdminUserSimpleRespDTO {
@Schema(description = "用户编号", example = "1024")
private Long id;
@Schema(description = "用户昵称", example = "芋道")
@Schema(description = "用户昵称", example = "ZT")
private String nickname;
@Schema(description = "部门ID", example = "1")

View File

@@ -108,7 +108,7 @@
<artifactId>zt-spring-boot-starter-mq</artifactId>
</dependency>
<!-- 服务保障相关 TODO 芋艿:暂时去掉 -->
<!-- 服务保障相关 TODO ZT:暂时去掉 -->
<!-- <dependency>-->
<!-- <groupId>com.zt.plat</groupId>-->
<!-- <artifactId>zt-spring-boot-starter-protection</artifactId>-->

View File

@@ -15,13 +15,13 @@ import java.util.List;
@Builder
public class AuthMenuRespVO {
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private Long id;
@Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long parentId;
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")

View File

@@ -38,7 +38,7 @@ public class AuthPermissionInfoRespVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
private String nickname;
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
@@ -62,13 +62,13 @@ public class AuthPermissionInfoRespVO {
@Builder
public static class MenuVO {
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private Long id;
@Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long parentId;
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")

View File

@@ -20,7 +20,7 @@ public class AuthRegisterReqVO extends CaptchaVerificationReqVO {
@Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符")
private String username;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "用户昵称不能为空")
@Size(max = 30, message = "用户昵称长度不能超过 30 个字符")
private String nickname;

View File

@@ -9,7 +9,7 @@ import java.util.List;
@Data
public class DeptListReqVO {
@Schema(description = "部门名称,模糊匹配", example = "芋道")
@Schema(description = "部门名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "部门编码,精确匹配", example = "ZT001")

View File

@@ -18,10 +18,10 @@ public class DeptRespVO {
@Schema(description = "部门编码", example = "DEPT_001")
private String code;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "部门简称", example = "芋道科技")
@Schema(description = "部门简称", example = "ZT科技")
private String shortName;
@Schema(description = "父部门 ID", example = "1024")

View File

@@ -23,7 +23,7 @@ public class DeptSaveReqVO {
@Size(max = 50, message = "部门编码长度不能超过 50 个字符")
private String code;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "部门名称不能为空")
@Size(max = 30, message = "部门名称长度不能超过 30 个字符")
private String name;

View File

@@ -20,7 +20,7 @@ public class DeptSimpleRespVO {
@Schema(description = "部门编码", example = "DEPT_001")
private String code;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "父部门 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")

View File

@@ -13,7 +13,7 @@ public class PostPageReqVO extends PageParam {
@Schema(description = "岗位编码,模糊匹配", example = "zt")
private String code;
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
@Schema(description = "岗位名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")

View File

@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class DictDataPageReqVO extends PageParam {
@Schema(description = "字典标签", example = "芋道")
@Schema(description = "字典标签", example = "ZT")
@Size(max = 100, message = "字典标签长度不能超过100个字符")
private String label;

View File

@@ -23,7 +23,7 @@ public class DictDataRespVO {
@ExcelProperty("字典排序")
private Integer sort;
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@ExcelProperty("字典标签")
private String label;

View File

@@ -19,7 +19,7 @@ public class DictDataSaveReqVO {
@NotNull(message = "显示顺序不能为空")
private Integer sort;
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "字典标签不能为空")
@Size(max = 100, message = "字典标签长度不能超过100个字符")
private String label;

View File

@@ -16,7 +16,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@EqualsAndHashCode(callSuper = true)
public class DictTypePageReqVO extends PageParam {
@Schema(description = "字典类型名称,模糊匹配", example = "芋道")
@Schema(description = "字典类型名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")

View File

@@ -10,7 +10,7 @@ public class DictTypeSimpleRespVO {
@Schema(description = "字典类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "字典类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "字典类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "字典类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "sys_common_sex")

View File

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.annotation.security.PermitAll;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@@ -55,6 +56,13 @@ public class IWorkIntegrationController {
return success(integrationService.createWorkflow(reqVO));
}
@PermitAll
@PostMapping("/callback/file")
@Operation(summary = "iWork 文件回调:根据文件 URL 保存为附件并创建业务附件关联")
public CommonResult<Long> callbackFile(@Valid @RequestBody IWorkFileCallbackReqVO reqVO) {
return success(integrationService.handleFileCallback(reqVO));
}
@PostMapping("/workflow/void")
@Operation(summary = "作废 / 干预 iWork 流程")
public CommonResult<IWorkOperationRespVO> voidWorkflow(@Valid @RequestBody IWorkWorkflowVoidReqVO reqVO) {

View File

@@ -0,0 +1,21 @@
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@Schema(name = "IWorkFileCallbackReqVO", description = "iWork 文件回调请求 VO")
@Data
public class IWorkFileCallbackReqVO {
@Schema(description = "文件下载 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://example.com/file.pdf")
@NotBlank(message = "文件 URL 不能为空")
private String fileUrl;
@Schema(description = "业务 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
@NotBlank(message = "业务 ID 不能为空")
private String businessId;
@Schema(description = "文件名称,可选", example = "合同附件.pdf")
private String fileName;
}

View File

@@ -36,6 +36,9 @@ public class IWorkFullSyncReqVO {
@Schema(description = "是否包含已失效canceled=1的记录", example = "false")
private Boolean includeCanceled = Boolean.FALSE;
@Schema(description = "是否允许更新已存在的本地实体", example = "false")
private Boolean allowUpdate = Boolean.FALSE;
public Set<IWorkSyncEntityTypeEnum> resolveScopes() {
EnumSet<IWorkSyncEntityTypeEnum> defaults = EnumSet.allOf(IWorkSyncEntityTypeEnum.class);
if (scopes == null || scopes.isEmpty()) {

View File

@@ -18,7 +18,7 @@ public class LoginLogPageReqVO extends PageParam {
@Schema(description = "用户 IP模拟匹配", example = "127.0.0.1")
private String userIp;
@Schema(description = "用户账号,模拟匹配", example = "芋道")
@Schema(description = "用户账号,模拟匹配", example = "ZT")
private String username;
@Schema(description = "操作状态", example = "true")

View File

@@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class OperateLogPageReqVO extends PageParam {
@Schema(description = "用户编号", example = "芋道")
@Schema(description = "用户编号", example = "ZT")
private Long userId;
@Schema(description = "操作模块业务编号", example = "1")

View File

@@ -27,7 +27,7 @@ public class OperateLogRespVO implements VO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "userName")
private Long userId;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@ExcelProperty("操作人")
private String userName;
@@ -43,7 +43,7 @@ public class OperateLogRespVO implements VO {
@ExcelProperty("操作模块业务编号")
private Long bizId;
@Schema(description = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。")
@Schema(description = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码。")
private String action;
@Schema(description = "拓展字段", example = "{'orderId': 1}")

View File

@@ -10,7 +10,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class NoticePageReqVO extends PageParam {
@Schema(description = "通知公告名称,模糊匹配", example = "芋道")
@Schema(description = "通知公告名称,模糊匹配", example = "ZT")
private String title;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")

View File

@@ -25,7 +25,7 @@ public class NotifyMessageRespVO {
@Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "test_01")
private String templateCode;
@Schema(description = "模版发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "模版发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String templateNickname;
@Schema(description = "模版内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试内容")

View File

@@ -7,7 +7,7 @@ tenant-id: {{adminTenantId}}
{
"id": "1",
"secret": "admin123",
"name": "芋道源码",
"name": "ZT源码",
"logo": "https://www.iocoder.cn/images/favicon.ico",
"description": "我是描述",
"status": 0,

View File

@@ -10,5 +10,5 @@ Authorization: Bearer 47f9c74ec11041f193b777ebb95c3b0d
tenant-id: {{adminTenantId}}
{
"nickname": "芋道源码"
"nickname": "ZT源码"
}

View File

@@ -19,10 +19,10 @@ public class OAuth2UserInfoRespVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String username;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String nickname;
@Schema(description = "用户邮箱", example = "zt@iocoder.cn")

View File

@@ -14,7 +14,7 @@ import org.hibernate.validator.constraints.Length;
@AllArgsConstructor
public class OAuth2UserUpdateReqVO {
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@Size(max = 30, message = "用户昵称长度不能超过 30 个字符")
private String nickname;

View File

@@ -7,7 +7,7 @@ import lombok.Data;
@Data
public class MenuListReqVO {
@Schema(description = "菜单名称,模糊匹配", example = "芋道")
@Schema(description = "菜单名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")

View File

@@ -15,7 +15,7 @@ public class MenuRespVO {
@Schema(description = "菜单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "菜单名称不能为空")
@Size(max = 50, message = "菜单名称长度不能超过50个字符")
private String name;

View File

@@ -13,7 +13,7 @@ public class MenuSaveVO {
@Schema(description = "菜单编号", example = "1024")
private Long id;
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "菜单名称不能为空")
@Size(max = 50, message = "菜单名称长度不能超过50个字符")
private String name;

View File

@@ -10,7 +10,7 @@ public class MenuSimpleRespVO {
@Schema(description = "菜单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
@Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")

View File

@@ -15,7 +15,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@EqualsAndHashCode(callSuper = true)
public class RolePageReqVO extends PageParam {
@Schema(description = "角色名称,模糊匹配", example = "芋道")
@Schema(description = "角色名称,模糊匹配", example = "ZT")
private String name;
@Schema(description = "角色标识,模糊匹配", example = "zt")

View File

@@ -10,7 +10,7 @@ public class RoleSimpleRespVO {
@Schema(description = "角色编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String name;
}

View File

@@ -20,7 +20,7 @@ public class SmsChannelPageReqVO extends PageParam {
@Schema(description = "任务状态", example = "1")
private Integer status;
@Schema(description = "短信签名,模糊匹配", example = "芋道源码")
@Schema(description = "短信签名,模糊匹配", example = "ZT源码")
private String signature;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

View File

@@ -14,7 +14,7 @@ public class SmsChannelRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
@NotNull(message = "短信签名不能为空")
private String signature;

View File

@@ -12,7 +12,7 @@ public class SmsChannelSaveReqVO {
@Schema(description = "编号", example = "1024")
private Long id;
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
@NotNull(message = "短信签名不能为空")
private String signature;

View File

@@ -10,7 +10,7 @@ public class SmsChannelSimpleRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
@Schema(description = "短信签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
private String signature;
@Schema(description = "渠道编码,参见 SmsChannelEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "YUN_PIAN")

View File

@@ -24,7 +24,7 @@ public class SocialUserRespVO {
@Schema(description = "原始 Token 数据,一般是 JSON 格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "{}")
private String rawTokenInfo;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String nickname;
@Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png")

View File

@@ -1,5 +1,5 @@
### 获取租户编号 /admin-api/system/get-id-by-name
GET {{baseUrl}}/system/tenant/get-id-by-name?name=芋道源码
GET {{baseUrl}}/system/tenant/get-id-by-name?name=ZT源码
### 创建租户 /admin-api/system/tenant/create
POST {{baseUrl}}/system/tenant/create
@@ -8,8 +8,8 @@ Authorization: Bearer {{token}}
tenant-id: {{adminTenantId}}
{
"name": "芋道",
"contactName": "芋艿",
"name": "ZT",
"contactName": "ZT",
"contactMobile": "15601691300",
"status": 0,
"domain": "https://www.iocoder.cn",

View File

@@ -17,10 +17,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@ToString(callSuper = true)
public class TenantPageReqVO extends PageParam {
@Schema(description = "租户名", example = "芋道")
@Schema(description = "租户名", example = "ZT")
private String name;
@Schema(description = "联系人", example = "芋艿")
@Schema(description = "联系人", example = "ZT")
private String contactName;
@Schema(description = "联系手机", example = "15601691300")

View File

@@ -22,11 +22,11 @@ public class TenantRespVO {
@ExcelProperty("租户编号")
private Long id;
@Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@ExcelProperty("租户名")
private String name;
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@ExcelProperty("联系人")
private String contactName;

View File

@@ -19,11 +19,11 @@ public class TenantSaveReqVO {
@Schema(description = "租户编号", example = "1024")
private Long id;
@Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotNull(message = "租户名不能为空")
private String name;
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotNull(message = "联系人不能为空")
private String contactName;

View File

@@ -129,7 +129,7 @@ public class UserController {
// 手动创建导出 demo
List<UserImportExcelVO> list = Arrays.asList(
UserImportExcelVO.builder().username("yunai").deptId(1L).email("yunai@iocoder.cn").mobile("15601691300")
.nickname("芋道").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex()).build(),
.nickname("ZT").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex()).build(),
UserImportExcelVO.builder().username("yuanma").deptId(2L).email("yuanma@iocoder.cn").mobile("15601701300")
.nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SexEnum.FEMALE.getSex()).build()
);

View File

@@ -22,7 +22,7 @@ public class UserProfileRespVO {
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "zt")
private String username;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String nickname;
@Schema(description = "用户邮箱", example = "zt@iocoder.cn")

View File

@@ -14,7 +14,7 @@ import org.hibernate.validator.constraints.URL;
@Data
public class UserProfileUpdateReqVO {
@Schema(description = "用户昵称", example = "芋艿")
@Schema(description = "用户昵称", example = "ZT")
@Size(max = 30, message = "用户昵称长度不能超过 30 个字符")
private String nickname;

View File

@@ -25,7 +25,7 @@ public class UserRespVO{
@ExcelProperty("用户名称")
private String username;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@ExcelProperty("用户昵称")
private String nickname;

View File

@@ -33,7 +33,7 @@ public class UserSaveReqVO {
@DiffLogField(name = "用户账号")
private String username;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@Size(max = 30, message = "用户昵称长度不能超过30个字符")
@DiffLogField(name = "用户昵称")
private String nickname;

View File

@@ -14,7 +14,7 @@ public class UserSimpleRespVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
private String nickname;
@Schema(description = "部门ID", example = "我是一个用户")

View File

@@ -14,7 +14,7 @@ public class AppDictDataRespVO {
@Schema(description = "字典数据编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@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")

View File

@@ -56,7 +56,7 @@ public class OperateLogDO extends BaseDO {
/**
* 日志内容,记录整个操作的明细
*
* 例如说,修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。
* 例如说,修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码。
*/
private String action;
/**

View File

@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
/**
* JustAuth 配置类 TODO 芋艿:等 justauth 1.4.1 版本发布!!!
* JustAuth 配置类 TODO ZT:等 justauth 1.4.1 版本发布!!!
*
* @author ZT
*/

View File

@@ -43,7 +43,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
// TODO @芋艿:等官方发布 1.4.1
// TODO @ZT:等官方发布 1.4.1
/**
* <p>
* AuthRequest工厂类

View File

@@ -40,7 +40,7 @@ public class AdminUserParseFunction implements IParseFunction {
log.warn("[apply][获取用户{{}}为空", value);
return "";
}
// 返回格式 芋道源码(13888888888)
// 返回格式 ZT源码(13888888888)
String nickname = user.getNickname();
if (StrUtil.isEmpty(user.getMobile())) {
return nickname;

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.system.framework.rpc.config;
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
import com.zt.plat.module.infra.api.config.ConfigApi;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.infra.api.websocket.WebSocketSenderApi;
@@ -7,6 +8,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(value = "systemRpcConfiguration", proxyBeanMethods = false)
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class})
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class, BusinessFileApi.class})
public class RpcConfiguration {
}

View File

@@ -19,7 +19,7 @@ public class SecurityConfiguration {
@Override
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
// TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案
// TODO ZT:这个每个项目都需要重复配置,得捉摸有没通用的方案
// Swagger 接口文档
registry.requestMatchers("/v3/api-docs/**").permitAll()
.requestMatchers("/webjars/**").permitAll()

View File

@@ -4,6 +4,7 @@ import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkAuth
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkAuthRegisterRespVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkAuthTokenReqVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkAuthTokenRespVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkFileCallbackReqVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkOperationRespVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkUserInfoReqVO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.IWorkUserInfoRespVO;
@@ -39,4 +40,12 @@ public interface IWorkIntegrationService {
* 在 iWork 中对已有流程执行作废或干预。
*/
IWorkOperationRespVO voidWorkflow(IWorkWorkflowVoidReqVO reqVO);
/**
* 处理来自 iWork 的文件回调:根据文件 URL 下载并保存为附件,同时创建业务附件关联记录。
*
* @param reqVO 回调请求
* @return 创建的业务附件关联记录 ID 或附件 ID视实现而定
*/
Long handleFileCallback(IWorkFileCallbackReqVO reqVO);
}

View File

@@ -36,15 +36,7 @@ public interface IWorkSyncProcessor {
this.createIfMissing = createIfMissing;
}
public static SyncOptions full(boolean includeCanceled) {
return new SyncOptions(includeCanceled, false, true);
}
public static SyncOptions single(boolean createIfMissing) {
return new SyncOptions(true, true, Boolean.TRUE.equals(createIfMissing));
}
public static SyncOptions custom(boolean includeCanceled, boolean allowUpdate, boolean createIfMissing) {
public static SyncOptions custom(boolean includeCanceled, boolean allowUpdate,boolean createIfMissing) {
return new SyncOptions(includeCanceled, allowUpdate, createIfMissing);
}

View File

@@ -9,6 +9,12 @@ import com.github.benmanes.caffeine.cache.Caffeine;
import com.zt.plat.framework.common.exception.ErrorCode;
import com.zt.plat.framework.common.exception.ServiceException;
import com.zt.plat.framework.common.exception.util.ServiceExceptionUtil;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
import com.zt.plat.module.system.controller.admin.integration.iwork.vo.*;
import com.zt.plat.module.system.framework.integration.iwork.config.IWorkProperties;
import com.zt.plat.module.system.service.integration.iwork.IWorkIntegrationService;
@@ -24,6 +30,8 @@ import org.springframework.util.StringUtils;
import javax.crypto.Cipher;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.spec.X509EncodedKeySpec;
@@ -43,10 +51,14 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService {
private static final TypeReference<Map<String, Object>> MAP_TYPE = new TypeReference<>() {
};
private static final okhttp3.MediaType JSON_MEDIA_TYPE = okhttp3.MediaType.get("application/json; charset=UTF-8");
private static final int MAX_REASON_LENGTH = 400;
private final IWorkProperties properties;
private final ObjectMapper objectMapper;
private final FileApi fileApi;
private final BusinessFileApi businessFileApi;
private final Cache<SessionKey, IWorkSession> sessionCache = Caffeine.newBuilder()
.maximumSize(256)
.build();
@@ -148,6 +160,92 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService {
return buildOperationResponse(responseBody);
}
@Override
public Long handleFileCallback(IWorkFileCallbackReqVO reqVO) {
if (reqVO == null) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "回调请求不能为空");
}
String fileUrl = Optional.ofNullable(reqVO.getFileUrl()).map(String::trim).orElse("");
String businessIdStr = Optional.ofNullable(reqVO.getBusinessId()).map(String::trim).orElse("");
if (!StringUtils.hasText(fileUrl)) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "文件 URL 不能为空");
}
if (!StringUtils.hasText(businessIdStr)) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "业务 ID 不能为空");
}
Long businessId;
try {
businessId = Long.valueOf(businessIdStr);
} catch (NumberFormatException ex) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "业务 ID 必须是数字: " + businessIdStr);
}
// 通过文件 API 创建文件
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
fileCreateReqDTO.setName(resolveFileName(reqVO.getFileName(), fileUrl));
fileCreateReqDTO.setDirectory(null);
fileCreateReqDTO.setType(null);
fileCreateReqDTO.setContent(downloadFileBytes(fileUrl));
CommonResult<FileRespDTO> fileResult = fileApi.createFileWithReturn(fileCreateReqDTO);
if (fileResult == null || !fileResult.isSuccess() || fileResult.getData() == null) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "通过文件服务创建附件失败: " + Optional.ofNullable(fileResult).map(CommonResult::getMsg).orElse("未知错误"));
}
Long fileId = fileResult.getData().getId();
BusinessFileSaveReqDTO businessReq = BusinessFileSaveReqDTO.builder()
.businessId(businessId)
.fileId(fileId)
.fileName(fileResult.getData().getName())
.source("iwork")
.build();
CommonResult<Long> bizResult = businessFileApi.createBusinessFile(businessReq);
if (bizResult == null || !bizResult.isSuccess() || bizResult.getData() == null) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "创建业务附件关联失败: " + Optional.ofNullable(bizResult).map(CommonResult::getMsg).orElse("未知错误"));
}
return bizResult.getData();
}
private byte[] downloadFileBytes(String fileUrl) {
OkHttpClient client = okHttpClient();
Request request = new Request.Builder().url(fileUrl).get().build();
try (Response response = client.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "下载文件失败HTTP 状态码: " + response.code());
}
ResponseBody body = response.body();
if (body == null) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "下载文件失败,响应体为空");
}
return body.bytes();
} catch (IOException ex) {
throw new ServiceException(IWORK_CONFIGURATION_INVALID.getCode(), "下载文件异常: " + ex.getMessage());
}
}
private String resolveFileName(String overrideName, String fileUrl) {
if (StringUtils.hasText(overrideName)) {
return overrideName;
}
try {
URI uri = new URI(fileUrl);
String path = uri.getPath();
if (!StringUtils.hasText(path)) {
return "iwork-file";
}
int idx = path.lastIndexOf('/');
if (idx >= 0 && idx + 1 < path.length()) {
return path.substring(idx + 1);
}
return path;
} catch (URISyntaxException ex) {
return "iwork-file";
}
}
private void assertConfigured() {
if (!StringUtils.hasText(properties.getBaseUrl())) {
throw ServiceExceptionUtil.exception(IWORK_BASE_URL_MISSING);
@@ -594,6 +692,18 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService {
if (node.has("errmsg")) {
return node.get("errmsg").asText();
}
if (node.has("errorMsg")) {
return node.get("errorMsg").asText();
}
if (node.has("error")) {
return node.get("error").asText();
}
if (node.has("detail")) {
return node.get("detail").asText();
}
if (node.has("info")) {
return node.get("info").asText();
}
return null;
}
@@ -730,15 +840,70 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService {
String responseBody = response.body() != null ? response.body().string() : null;
if (!response.isSuccessful()) {
log.error("[iWork] request {} failed. status={} body={}", request.url(), response.code(), responseBody);
throw ServiceExceptionUtil.exception(errorCode, response.code(), responseBody);
throw buildRemoteException(errorCode, response.code(), responseBody);
}
return responseBody;
} catch (IOException ex) {
log.error("[iWork] request {} failed", request.url(), ex);
throw ServiceExceptionUtil.exception(errorCode, ex.getMessage());
throw buildRemoteException(errorCode, -1, ex.getMessage());
}
}
private ServiceException buildRemoteException(ErrorCode errorCode, int statusCode, String responseBody) {
StringBuilder message = new StringBuilder(errorCode.getMsg());
if (statusCode > 0) {
message.append("HTTP ").append(statusCode).append("");
}
String reason = extractReadableReason(responseBody);
if (StringUtils.hasText(reason)) {
message.append("").append(reason);
}
return ServiceExceptionUtil.exception0(errorCode.getCode(), message.toString());
}
private String extractReadableReason(String responseBody) {
if (!StringUtils.hasText(responseBody)) {
return null;
}
String trimmed = responseBody.trim();
if (isJsonLike(trimmed)) {
try {
JsonNode node = objectMapper.readTree(trimmed);
String resolved = resolveMessage(node);
if (!StringUtils.hasText(resolved) && node.has("data")) {
JsonNode data = node.get("data");
if (data.has("message")) {
resolved = data.get("message").asText();
} else if (data.has("msg")) {
resolved = data.get("msg").asText();
}
}
if (StringUtils.hasText(resolved)) {
return abbreviate(resolved, MAX_REASON_LENGTH);
}
trimmed = objectMapper.writeValueAsString(node);
} catch (Exception ignored) {
// fall through to plain text handling
}
}
return abbreviate(trimmed.replaceAll("\\s+", " "), MAX_REASON_LENGTH);
}
private boolean isJsonLike(String text) {
if (!StringUtils.hasText(text)) {
return false;
}
char firstChar = text.charAt(0);
return firstChar == '{' || firstChar == '[';
}
private String abbreviate(String value, int maxLength) {
if (!StringUtils.hasText(value) || value.length() <= maxLength) {
return value;
}
return value.substring(0, maxLength) + "...";
}
private void logCurlCommand(Request request) {
if (request == null || !log.isInfoEnabled()) {
return;

View File

@@ -182,7 +182,9 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
}
private IWorkSyncProcessor.SyncOptions buildFullSyncOptions(IWorkFullSyncReqVO reqVO) {
return IWorkSyncProcessor.SyncOptions.full(Boolean.TRUE.equals(reqVO.getIncludeCanceled()));
boolean includeCanceled = Boolean.TRUE.equals(reqVO.getIncludeCanceled());
boolean allowUpdate = Boolean.TRUE.equals(reqVO.getAllowUpdate());
return IWorkSyncProcessor.SyncOptions.custom(includeCanceled, allowUpdate, true);
}
private void ensureIWorkSuccess(String action, boolean success, String remoteMessage) {

View File

@@ -86,7 +86,7 @@ public class OAuth2GrantServiceImpl implements OAuth2GrantService {
@Override
public OAuth2AccessTokenDO grantClientCredentials(String clientId, List<String> scopes) {
// TODO 芋艿:项目中使用 OAuth2 解决的是三方应用的授权,内部的 SSO 等问题,所以暂时不考虑 client_credentials 这个场景
// TODO ZT:项目中使用 OAuth2 解决的是三方应用的授权,内部的 SSO 等问题,所以暂时不考虑 client_credentials 这个场景
throw new UnsupportedOperationException("暂时不支持 client_credentials 授权模式");
}

View File

@@ -62,8 +62,8 @@ public class SmsCodeServiceImpl implements SmsCodeService {
lastSmsCode.getTodayIndex() >= smsCodeProperties.getSendMaximumQuantityPerDay()) { // 超过当天发送的上限。
throw exception(SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY);
}
// TODO 芋艿:提升,每个 IP 每天可发送数量
// TODO 芋艿:提升,每个 IP 每小时可发送数量
// TODO ZT:提升,每个 IP 每天可发送数量
// TODO ZT:提升,每个 IP 每小时可发送数量
}
// 创建验证码记录

View File

@@ -34,9 +34,9 @@ import com.zt.plat.module.system.service.dept.PostService;
import com.zt.plat.module.system.service.permission.PermissionService;
import com.zt.plat.module.system.service.tenant.TenantService;
import com.zt.plat.module.system.service.userdept.UserDeptService;
import org.apache.seata.spring.annotation.GlobalTransactional;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.seata.spring.annotation.GlobalTransactional;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@@ -46,7 +46,6 @@ import org.springframework.util.DigestUtils;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Locale;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -107,7 +106,7 @@ public class AdminUserServiceImpl implements AdminUserService {
tenantService.handleTenantInfo(tenant -> {
long count = userMapper.selectCount();
if (count >= tenant.getAccountCount()) {
throw exception(USER_COUNT_MAX, tenant.getAccountCount());
// throw exception(USER_COUNT_MAX, tenant.getAccountCount());
}
});
// 1.2 校验正确性
@@ -156,7 +155,7 @@ public class AdminUserServiceImpl implements AdminUserService {
tenantService.handleTenantInfo(tenant -> {
long count = userMapper.selectCount();
if (count >= tenant.getAccountCount()) {
throw exception(USER_COUNT_MAX, tenant.getAccountCount());
// throw exception(USER_COUNT_MAX, tenant.getAccountCount());
}
});
// 1.3 校验正确性

View File

@@ -133,7 +133,7 @@ wx:
key-prefix: wa # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
--- #################### 芋道相关配置 ####################
--- #################### ZT相关配置 ####################

View File

@@ -103,7 +103,7 @@ logging:
# 配置自己写的 MyBatis Mapper 打印日志
com.zt.plat.module.system.dal.mysql: debug
com.zt.plat.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO ZT先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
--- #################### 微信公众号、小程序相关配置 ####################
wx:
@@ -133,9 +133,9 @@ wx:
key-prefix: wa # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
--- #################### 芋道相关配置 ####################
--- #################### ZT相关配置 ####################
# 芋道配置项,设置当前项目所有自定义的配置
# ZT配置项,设置当前项目所有自定义的配置
zt:
env: # 多环境的配置项
tag: ${HOSTNAME}

View File

@@ -68,7 +68,7 @@ springdoc:
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
knife4j:
enable: false # TODO 芋艿需要关闭增强具体原因见https://github.com/xiaoymin/knife4j/issues/874
enable: false # TODO ZT需要关闭增强具体原因见https://github.com/xiaoymin/knife4j/issues/874
setting:
language: zh_cn
@@ -194,7 +194,7 @@ aj:
req-check-minute-limit: 60 # check 接口一分钟内请求数限制
req-verify-minute-limit: 60 # verify 接口一分钟内请求数限制
--- #################### 芋道相关配置 ####################
--- #################### ZT相关配置 ####################
zt:
info:

View File

@@ -34,7 +34,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest {
private final SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(randomString()) // 随机一个 apiKey避免构建报错
.setApiSecret(randomString()) // 随机一个 apiSecret避免构建报错
.setSignature("芋道源码");
.setSignature("ZT源码");
@InjectMocks
private final AliyunSmsClient smsClient = new AliyunSmsClient(properties);

View File

@@ -31,7 +31,7 @@ public class HuaweiSmsClientTest extends BaseMockitoUnitTest {
private final SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(randomString() + " " + randomString()) // 随机一个 apiKey避免构建报错
.setApiSecret(randomString()) // 随机一个 apiSecret避免构建报错
.setSignature("芋道源码");
.setSignature("ZT源码");
@InjectMocks
private HuaweiSmsClient smsClient = new HuaweiSmsClient(properties);

View File

@@ -33,7 +33,7 @@ public class QiniuSmsClientTest extends BaseMockitoUnitTest {
private final SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(randomString())// 随机一个 apiKey避免构建报错
.setApiSecret(randomString()) // 随机一个 apiSecret避免构建报错
.setSignature("芋道源码");
.setSignature("ZT源码");
@InjectMocks
private QiniuSmsClient smsClient = new QiniuSmsClient(properties);

View File

@@ -62,7 +62,7 @@ public class SmsClientTests {
SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(System.getenv("SMS_TENCENT_ACCESS_KEY") + " " + sdkAppId)
.setApiSecret(System.getenv("SMS_TENCENT_SECRET_KEY"))
.setSignature("芋道源码");
.setSignature("ZT源码");
TencentSmsClient client = new TencentSmsClient(properties);
// 准备参数
Long sendLogId = System.currentTimeMillis();
@@ -81,7 +81,7 @@ public class SmsClientTests {
SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(System.getenv("SMS_TENCENT_ACCESS_KEY") + " " + sdkAppId)
.setApiSecret(System.getenv("SMS_TENCENT_SECRET_KEY"))
.setSignature("芋道源码");
.setSignature("ZT源码");
TencentSmsClient client = new TencentSmsClient(properties);
// 准备参数
String apiTemplateId = "358212";

View File

@@ -33,7 +33,7 @@ public class TencentSmsClientTest extends BaseMockitoUnitTest {
private final SmsChannelProperties properties = new SmsChannelProperties()
.setApiKey(randomString() + " " + randomString()) // 随机一个 apiKey避免构建报错
.setApiSecret(randomString()) // 随机一个 apiSecret避免构建报错
.setSignature("芋道源码");
.setSignature("ZT源码");
@InjectMocks
private TencentSmsClient smsClient = new TencentSmsClient(properties);

View File

@@ -69,7 +69,7 @@ public class DictDataServiceImplTest extends BaseDbUnitTest {
public void testGetDictDataPage() {
// mock 数据
DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到
o.setLabel("芋艿");
o.setLabel("ZT");
o.setDictType("yunai");
o.setStatus(CommonStatusEnum.ENABLE.getStatus());
o.setValue("testValue");

View File

@@ -44,7 +44,7 @@ public class DictTypeServiceImplTest extends BaseDbUnitTest {
// mock 数据
DictTypeDO dbDictType = randomPojo(DictTypeDO.class, o -> { // 等会查询到
o.setName("yunai");
o.setType("芋艿");
o.setType("ZT");
o.setStatus(CommonStatusEnum.ENABLE.getStatus());
o.setCreateTime(buildTime(2021, 1, 15));
});

Some files were not shown because too many files have changed in this diff Show More