From 08c5248757500ce422d8649608dbc8e5c5c744e4 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 22 Oct 2023 14:30:50 +0800 Subject: [PATCH] =?UTF-8?q?cloud=EF=BC=9A=E5=AE=8C=E5=96=84=20system?= =?UTF-8?q?=E3=80=81infra=E3=80=81bpm=20=E7=9A=84=20api=20swagger=20?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-module-bpm/yudao-module-bpm-api/pom.xml | 14 +++++++ .../bpm/api/task/BpmProcessInstanceApi.java | 30 +++++++------ .../dto/BpmProcessInstanceCreateReqDTO.java | 27 ++++-------- .../yudao/module/bpm/enums/ApiConstants.java | 23 ++++++++++ .../infra/api/file/dto/FileCreateReqDTO.java | 4 +- .../logger/dto/ApiAccessLogCreateReqDTO.java | 26 ++++++------ .../logger/dto/ApiErrorLogCreateReqDTO.java | 36 ++++++++-------- .../system/api/dept/dto/DeptRespDTO.java | 36 ++++++---------- .../system/api/dict/dto/DictDataRespDTO.java | 19 +++++---- .../dto/ErrorCodeAutoGenerateReqDTO.java | 23 ++++------ .../api/errorcode/dto/ErrorCodeRespDTO.java | 10 ++--- .../api/logger/dto/LoginLogCreateReqDTO.java | 20 ++++----- .../logger/dto/OperateLogCreateReqDTO.java | 26 ++++++------ .../mail/dto/MailSendSingleToUserReqDTO.java | 7 ++-- .../dto/NotifySendSingleToUserReqDTO.java | 6 +-- .../dto/OAuth2AccessTokenCheckRespDTO.java | 6 +-- .../dto/OAuth2AccessTokenCreateReqDTO.java | 6 +-- .../oauth2/dto/OAuth2AccessTokenRespDTO.java | 10 ++--- .../dto/DeptDataPermissionRespDTO.java | 21 ++++------ .../api/sms/dto/code/SmsCodeSendReqDTO.java | 10 +++-- .../api/sms/dto/code/SmsCodeUseReqDTO.java | 13 +++--- .../sms/dto/code/SmsCodeValidateReqDTO.java | 10 +++-- .../dto/send/SmsSendSingleToUserReqDTO.java | 6 +-- .../api/social/dto/SocialUserBindReqDTO.java | 27 ++++-------- .../api/social/dto/SocialUserRespDTO.java | 15 ++----- .../social/dto/SocialUserUnbindReqDTO.java | 30 ++++--------- .../dto/SocialWxJsapiSignatureRespDTO.java | 31 +++++--------- .../dto/SocialWxPhoneNumberInfoRespDTO.java | 19 +++------ .../system/api/user/dto/AdminUserRespDTO.java | 42 +++++++------------ .../system/api/social/SocialUserApiImpl.java | 2 +- 30 files changed, 251 insertions(+), 304 deletions(-) create mode 100644 yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ApiConstants.java diff --git a/yudao-module-bpm/yudao-module-bpm-api/pom.xml b/yudao-module-bpm/yudao-module-bpm-api/pom.xml index ba89fc7f6..470b4b533 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/pom.xml +++ b/yudao-module-bpm/yudao-module-bpm-api/pom.xml @@ -22,12 +22,26 @@ yudao-common + + + org.springdoc + springdoc-openapi-ui + provided + + org.springframework.boot spring-boot-starter-validation true + + + + org.springframework.cloud + spring-cloud-starter-openfeign + true + diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/BpmProcessInstanceApi.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/BpmProcessInstanceApi.java index e94a2c84f..152e605dd 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/BpmProcessInstanceApi.java +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/BpmProcessInstanceApi.java @@ -1,23 +1,27 @@ package cn.iocoder.yudao.module.bpm.api.task; import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import cn.iocoder.yudao.module.bpm.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import javax.validation.Valid; -/** - * 流程实例 Api 接口 - * - * @author 芋道源码 - */ +@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = +@Tag(name = "RPC 服务 - 流程实例") public interface BpmProcessInstanceApi { - /** - * 创建流程实例(提供给内部) - * - * @param userId 用户编号 - * @param reqDTO 创建信息 - * @return 实例的编号 - */ - String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqDTO reqDTO); + String PREFIX = ApiConstants.PREFIX + "/process-instance"; + + @PostMapping(PREFIX + "/create") + @Operation(summary = "创建流程实例(提供给内部),返回实例编号") + @Parameter(name = "userId", description = "用户编号", required = true, example = "1") + String createProcessInstance(@RequestParam("userId") Long userId, + @Valid @RequestBody BpmProcessInstanceCreateReqDTO reqDTO); } diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/dto/BpmProcessInstanceCreateReqDTO.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/dto/BpmProcessInstanceCreateReqDTO.java index 5d7edbe80..c637e90ee 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/dto/BpmProcessInstanceCreateReqDTO.java +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/api/task/dto/BpmProcessInstanceCreateReqDTO.java @@ -1,33 +1,24 @@ package cn.iocoder.yudao.module.bpm.api.task.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import java.util.Map; -/** - * 流程实例的创建 Request DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 流程实例的创建 Request DTO") @Data public class BpmProcessInstanceCreateReqDTO { - /** - * 流程定义的标识 - */ + @Schema(description = "流程定义的标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "leave") @NotEmpty(message = "流程定义的标识不能为空") private String processDefinitionKey; - /** - * 变量实例 - */ + + @Schema(description = "变量实例", requiredMode = Schema.RequiredMode.REQUIRED) private Map variables; - /** - * 业务的唯一标识 - * - * 例如说,请假申请的编号。通过它,可以查询到对应的实例 - */ - @NotEmpty(message = "业务的唯一标识") - private String businessKey; + @Schema(description = "业务的唯一标识", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "业务的唯一标识不能为空") + private String businessKey; // 例如说,请假申请的编号。通过它,可以查询到对应的实例 + } diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ApiConstants.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ApiConstants.java new file mode 100644 index 000000000..b7c7de9fc --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ApiConstants.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.bpm.enums; + +import cn.iocoder.yudao.framework.common.enums.RpcConstants; + +/** + * API 相关的枚举 + * + * @author 芋道源码 + */ +public class ApiConstants { + + /** + * 服务名 + * + * 注意,需要保证和 spring.application.name 保持一致 + */ + public static final String NAME = "bpm-server"; + + public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/bpm"; + + public static final String VERSION = "1.0.0"; + +} diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/dto/FileCreateReqDTO.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/dto/FileCreateReqDTO.java index 56eab1bee..1f554e653 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/dto/FileCreateReqDTO.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/dto/FileCreateReqDTO.java @@ -15,8 +15,8 @@ public class FileCreateReqDTO { @Schema(description = "文件路径", example = "xxx.png") private String path; - @Schema(description = "文件内容", required = true) + @Schema(description = "文件内容", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "文件内容不能为空") private byte[] content; -} \ No newline at end of file +} diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java index 29129dfd6..40102ea32 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java @@ -13,43 +13,43 @@ public class ApiAccessLogCreateReqDTO { @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") private String traceId; - @Schema(description = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long userId; - @Schema(description = "用户类型", required = true, example = "1") + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer userType; - @Schema(description = "应用名", required = true, example = "system-server") + @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "system-server") @NotNull(message = "应用名不能为空") private String applicationName; - @Schema(description = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", requiredMode = Schema.RequiredMode.REQUIRED, example = "GET") @NotNull(message = "http 请求方法不能为空") private String requestMethod; - @Schema(description = "请求地址", required = true, example = "/xxx/yyy") + @Schema(description = "请求地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "/xxx/yyy") @NotNull(message = "访问地址不能为空") private String requestUrl; - @Schema(description = "请求参数", required = true) + @Schema(description = "请求参数", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "请求参数不能为空") private String requestParams; - @Schema(description = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1") @NotNull(message = "ip 不能为空") private String userIp; - @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0") @NotNull(message = "User-Agent 不能为空") private String userAgent; - @Schema(description = "开始时间", required = true) + @Schema(description = "开始时间",requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "开始请求时间不能为空") private LocalDateTime beginTime; - @Schema(description = "结束时间", required = true) + @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "结束请求时间不能为空") private LocalDateTime endTime; - @Schema(description = "执行时长,单位:毫秒", required = true) + @Schema(description = "执行时长,单位:毫秒", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "执行时长不能为空") private Integer duration; - @Schema(description = "结果码", required = true) + @Schema(description = "结果码", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "错误码不能为空") private Integer resultCode; @Schema(description = "结果提示") private String resultMsg; -} \ No newline at end of file +} diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java index 9cc6caeb4..20cbb8849 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java @@ -13,56 +13,56 @@ public class ApiErrorLogCreateReqDTO { @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") private String traceId; - @Schema(description = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long userId; - @Schema(description = "用户类型", required = true, example = "1") + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer userType; - @Schema(description = "应用名", required = true, example = "system-server") + @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "system-server") @NotNull(message = "应用名不能为空") private String applicationName; - @Schema(description = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", requiredMode = Schema.RequiredMode.REQUIRED, example = "GET") @NotNull(message = "http 请求方法不能为空") private String requestMethod; - @Schema(description = "请求地址", required = true, example = "/xxx/yyy") + @Schema(description = "请求地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "/xxx/yyy") @NotNull(message = "访问地址不能为空") private String requestUrl; - @Schema(description = "请求参数", required = true) + @Schema(description = "请求参数", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "请求参数不能为空") private String requestParams; - @Schema(description = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1") @NotNull(message = "ip 不能为空") private String userIp; - @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0") @NotNull(message = "User-Agent 不能为空") private String userAgent; - @Schema(description = "异常时间", required = true) + @Schema(description = "异常时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常时间不能为空") private LocalDateTime exceptionTime; - @Schema(description = "异常名", required = true) + @Schema(description = "异常名", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常名不能为空") private String exceptionName; - @Schema(description = "异常发生的类全名", required = true) + @Schema(description = "异常发生的类全名", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常发生的类全名不能为空") private String exceptionClassName; - @Schema(description = "异常发生的类文件", required = true) + @Schema(description = "异常发生的类文件", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常发生的类文件不能为空") private String exceptionFileName; - @Schema(description = "异常发生的方法名", required = true) + @Schema(description = "异常发生的方法名", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常发生的方法名不能为空") private String exceptionMethodName; - @Schema(description = "异常发生的方法所在行", required = true) + @Schema(description = "异常发生的方法所在行", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常发生的方法所在行不能为空") private Integer exceptionLineNumber; - @Schema(description = "异常的栈轨迹异常的栈轨迹", required = true) + @Schema(description = "异常的栈轨迹异常的栈轨迹", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常的栈轨迹不能为空") private String exceptionStackTrace; - @Schema(description = "异常导致的根消息", required = true) + @Schema(description = "异常导致的根消息", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常导致的根消息不能为空") private String exceptionRootCauseMessage; - @Schema(description = "异常导致的消息", required = true) + @Schema(description = "异常导致的消息", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "异常导致的消息不能为空") private String exceptionMessage; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java index d3e66fdd8..b8312469e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java @@ -1,37 +1,25 @@ package cn.iocoder.yudao.module.system.api.dept.dto; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -/** - * 部门 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 部门 Response DTO") @Data public class DeptRespDTO { - /** - * 部门编号 - */ + @Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Long id; - /** - * 部门名称 - */ + + @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部") private String name; - /** - * 父部门编号 - */ + + @Schema(description = "父部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Long parentId; - /** - * 负责人的用户编号 - */ + + @Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Long leaderUserId; - /** - * 部门状态 - * - * 枚举 {@link CommonStatusEnum} - */ - private Integer status; + + @Schema(description = "部门状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private Integer status; // 参见 CommonStatusEnum 枚举 } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java index 429517933..4ccc6a784 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java @@ -7,13 +7,16 @@ import lombok.Data; @Data public class DictDataRespDTO { - @Schema(description = "字典标签", required = true, example = "芋道") + @Schema(description = "字典标签", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道") private String label; - @Schema(description = "字典值", required = true, example = "iocoder") - private String value; - @Schema(description = "字典类型", required = true, example = "sys_common_sex") - private String dictType; - @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") - private Integer status; -} \ No newline at end of file + @Schema(description = "字典值", requiredMode = Schema.RequiredMode.REQUIRED, example = "iocoder") + private String value; + + @Schema(description = "字典类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "sys_common_sex") + private String dictType; + + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private Integer status; // 参见 CommonStatusEnum 枚举 + +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java index da4df83ca..c209a516e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeAutoGenerateReqDTO.java @@ -1,33 +1,24 @@ package cn.iocoder.yudao.module.system.api.errorcode.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import lombok.experimental.Accessors; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -/** - * 错误码自动生成 DTO - * - * @author dylan - */ +@Schema(description = "RPC 服务 - 错误码自动生成 Request DTO") @Data -@Accessors(chain = true) public class ErrorCodeAutoGenerateReqDTO { - /** - * 应用名 - */ + @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao") @NotNull(message = "应用名不能为空") private String applicationName; - /** - * 错误码编码 - */ + + @Schema(description = "错误码编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") @NotNull(message = "错误码编码不能为空") private Integer code; - /** - * 错误码错误提示 - */ + + @Schema(description = "错误码错误提示", requiredMode = Schema.RequiredMode.REQUIRED, example = "业务不能为空") @NotEmpty(message = "错误码错误提示不能为空") private String message; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java index 99372300b..e22dc3533 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/dto/ErrorCodeRespDTO.java @@ -1,28 +1,28 @@ package cn.iocoder.yudao.module.system.api.errorcode.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; -/** - * 错误码的 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 错误码 Response DTO") @Data public class ErrorCodeRespDTO { /** * 错误码编码 */ + @Schema(description = "错误码编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") private Integer code; /** * 错误码错误提示 */ + @Schema(description = "错误码错误提示", requiredMode = Schema.RequiredMode.REQUIRED, example = "业务不能为空") private String message; /** * 更新时间 */ + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime updateTime; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/LoginLogCreateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/LoginLogCreateReqDTO.java index c79167a4a..2954c863a 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/LoginLogCreateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/LoginLogCreateReqDTO.java @@ -8,40 +8,36 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -/** - * 登录日志创建 Request DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 登录日志创建 Request DTO") @Data public class LoginLogCreateReqDTO { - @Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", required = true, example = "1" ) + @Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1" ) @NotNull(message = "日志类型不能为空") private Integer logType; - @Schema(description = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") + @Schema(description = "链路追踪编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "89aca178-a370-411c-ae02-3f0d672be4ab") private String traceId; @Schema(description = "用户编号", example = "666") private Long userId; - @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2" ) + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2" ) @NotNull(message = "用户类型不能为空") private Integer userType; - @Schema(description = "用户账号", required = true, example = "yudao") + @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao") @NotBlank(message = "用户账号不能为空") @Size(max = 30, message = "用户账号长度不能超过30个字符") private String username; - @Schema(description = "登录结果,参见 LoginResultEnum 枚举类", required = true, example = "1") + @Schema(description = "登录结果,参见 LoginResultEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "登录结果不能为空") private Integer result; - @Schema(description = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1") @NotEmpty(message = "用户 IP 不能为空") private String userIp; - @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0") private String userAgent; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java index d0d69164e..15d9558fb 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java @@ -15,22 +15,22 @@ public class OperateLogCreateReqDTO { @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") private String traceId; - @Schema(description = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "用户编号不能为空") private Long userId; - @Schema(description = "用户类型", required = true, example = "1") + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "用户类型不能为空") private Integer userType; - @Schema(description = "操作模块", required = true, example = "订单") + @Schema(description = "操作模块", requiredMode = Schema.RequiredMode.REQUIRED, example = "订单") @NotEmpty(message = "操作模块不能为空") private String module; - @Schema(description = "操作名", required = true, example = "创建订单") + @Schema(description = "操作名", requiredMode = Schema.RequiredMode.REQUIRED, example = "创建订单") @NotEmpty(message = "操作名") private String name; - @Schema(description = "操作分类,参见 SysOperateLogTypeEnum 枚举类", required = true, example = "1") + @Schema(description = "操作分类,参见 SysOperateLogTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "操作分类不能为空") private Integer type; @@ -40,38 +40,38 @@ public class OperateLogCreateReqDTO { @Schema(description = "拓展字段", example = "{'orderId': 1}") private Map exts; - @Schema(description = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", requiredMode = Schema.RequiredMode.REQUIRED, example = "GET") @NotEmpty(message = "请求方法名不能为空") private String requestMethod; - @Schema(description = "请求地址", required = true, example = "/xxx/yyy") + @Schema(description = "请求地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "/xxx/yyy") @NotEmpty(message = "请求地址不能为空") private String requestUrl; - @Schema(description = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1") @NotEmpty(message = "用户 IP 不能为空") private String userIp; - @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0") @NotEmpty(message = "浏览器 UserAgent 不能为空") private String userAgent; - @Schema(description = "Java 方法名", required = true, example = "cn.iocoder.yudao.UserController.save(...)") + @Schema(description = "Java 方法名", requiredMode = Schema.RequiredMode.REQUIRED, example = "cn.iocoder.yudao.UserController.save(...)") @NotEmpty(message = "Java 方法名不能为空") private String javaMethod; @Schema(description = "Java 方法的参数") private String javaMethodArgs; - @Schema(description = "开始时间", required = true) + @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "开始时间不能为空") private LocalDateTime startTime; - @Schema(description = "执行时长,单位:毫秒", required = true) + @Schema(description = "执行时长,单位:毫秒", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "执行时长不能为空") private Integer duration; - @Schema(description = "结果码", required = true) + @Schema(description = "结果码", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "结果码不能为空") private Integer resultCode; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/dto/MailSendSingleToUserReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/dto/MailSendSingleToUserReqDTO.java index 4fce5c592..80e6ab812 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/dto/MailSendSingleToUserReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/dto/MailSendSingleToUserReqDTO.java @@ -13,14 +13,15 @@ public class MailSendSingleToUserReqDTO { @Schema(description = "用户编号", example = "1024") private Long userId; - @Schema(description = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") @Email private String mail; - @Schema(description = "邮件模板编号", required = true, example = "USER_SEND") + @Schema(description = "邮件模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND") @NotNull(message = "邮件模板编号不能为空") private String templateCode; + @Schema(description = "邮件模板参数") private Map templateParams; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/dto/NotifySendSingleToUserReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/dto/NotifySendSingleToUserReqDTO.java index 95c7146a8..a7110f6cf 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/dto/NotifySendSingleToUserReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/dto/NotifySendSingleToUserReqDTO.java @@ -11,13 +11,13 @@ import java.util.Map; @Data public class NotifySendSingleToUserReqDTO { - @Schema(description = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "用户编号不能为空") private Long userId; - @Schema(description = "站内信模板编号", required = true, example = "USER_SEND") + @Schema(description = "站内信模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND") @NotEmpty(message = "站内信模板编号不能为空") private String templateCode; @Schema(description = "邮件模板参数") private Map templateParams; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java index e2b4b9ad0..1fd9993c4 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java @@ -10,13 +10,13 @@ import java.util.List; @Data public class OAuth2AccessTokenCheckRespDTO implements Serializable { - @Schema(description = "用户编号", required = true, example = "10") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") private Long userId; - @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer userType; - @Schema(description = "租户编号", required = true, example = "1024") + @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long tenantId; @Schema(description = "授权范围的数组", example = "user_info") diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java index 55a40a33e..0a4cf4fd8 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java @@ -13,16 +13,16 @@ import java.util.List; @Data public class OAuth2AccessTokenCreateReqDTO implements Serializable { - @Schema(description = "用户编号", required = true, example = "10") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @NotNull(message = "用户编号不能为空") private Long userId; - @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "用户类型不能为空") @InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}") private Integer userType; - @Schema(description = "客户端编号", required = true, example = "yudaoyuanma") + @Schema(description = "客户端编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudaoyuanma") @NotNull(message = "客户端编号不能为空") private String clientId; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java index 014840758..e2ae5ae46 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java @@ -12,19 +12,19 @@ import java.time.LocalDateTime; @Accessors(chain = true) public class OAuth2AccessTokenRespDTO implements Serializable { - @Schema(description = "访问令牌", required = true, example = "tudou") + @Schema(description = "访问令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "tudou") private String accessToken; - @Schema(description = "刷新令牌", required = true, example = "haha") + @Schema(description = "刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "haha") private String refreshToken; - @Schema(description = "用户编号", required = true, example = "10") + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") private Long userId; - @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1" ) + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1" ) private Integer userType; - @Schema(description = "过期时间", required = true) + @Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime expiresTime; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java index 5650e89b9..ce505fee0 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java @@ -1,29 +1,22 @@ package cn.iocoder.yudao.module.system.api.permission.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.HashSet; import java.util.Set; -/** - * 部门的数据权限 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 部门的数据权限 Response DTO") @Data public class DeptDataPermissionRespDTO { - /** - * 是否可查看全部数据 - */ + @Schema(description = "是否可查看全部数据", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") private Boolean all; - /** - * 是否可查看自己的数据 - */ + + @Schema(description = "是否可查看自己的数据", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") private Boolean self; - /** - * 可查看的部门编号数组 - */ + + @Schema(description = "可查看的部门编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]") private Set deptIds; public DeptDataPermissionRespDTO() { diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java index aeea15ab6..62bda91cd 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java @@ -13,16 +13,18 @@ import javax.validation.constraints.NotNull; @Data public class SmsCodeSendReqDTO { - @Schema(description = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") @Mobile @NotEmpty(message = "手机号不能为空") private String mobile; - @Schema(description = "发送场景", required = true, example = "1") + + @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) + private Integer scene; - @Schema(description = "发送 IP", required = true, example = "10.20.30.40") + @Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40") @NotEmpty(message = "发送 IP 不能为空") private String createIp; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java index 960bfee5a..cb4bfc2f2 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeUseReqDTO.java @@ -13,19 +13,22 @@ import javax.validation.constraints.NotNull; @Data public class SmsCodeUseReqDTO { - @Schema(description = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") @Mobile @NotEmpty(message = "手机号不能为空") private String mobile; - @Schema(description = "发送场景", required = true, example = "1") + + @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; - @Schema(description = "验证码", required = true, example = "1024") + + @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotEmpty(message = "验证码") private String code; - @Schema(description = "发送 IP", required = true, example = "10.20.30.40") + + @Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40") @NotEmpty(message = "使用 IP 不能为空") private String usedIp; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java index a3dda0bdd..6b4059829 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java @@ -13,16 +13,18 @@ import javax.validation.constraints.NotNull; @Data public class SmsCodeValidateReqDTO { - @Schema(description = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") @Mobile @NotEmpty(message = "手机号不能为空") private String mobile; - @Schema(description = "发送场景", required = true, example = "1") + + @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; - @Schema(description = "验证码", required = true, example = "1024") + + @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotEmpty(message = "验证码") private String code; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java index 076384811..14e37228a 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java @@ -13,14 +13,14 @@ public class SmsSendSingleToUserReqDTO { @Schema(description = "用户编号", example = "1024") private Long userId; - @Schema(description = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") @Mobile private String mobile; - @Schema(description = "短信模板编号", required = true, example = "USER_SEND") + @Schema(description = "短信模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND") @NotEmpty(message = "短信模板编号不能为空") private String templateCode; @Schema(description = "短信模板参数") private Map templateParams; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java index a89c12ad6..8afa69d1a 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserBindReqDTO.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.api.social.dto; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -10,42 +11,28 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -/** - * 取消绑定社交用户 Request DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 取消绑定社交用户 Request DTO") @Data @NoArgsConstructor @AllArgsConstructor public class SocialUserBindReqDTO { - /** - * 用户编号 - */ + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "用户编号不能为空") private Long userId; - /** - * 用户类型 - */ + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @InEnum(UserTypeEnum.class) @NotNull(message = "用户类型不能为空") private Integer userType; - /** - * 社交平台的类型 - */ + @Schema(description = "社交平台的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer socialType; - /** - * 授权码 - */ + @Schema(description = "授权码", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw") @NotEmpty(message = "授权码不能为空") private String code; - /** - * state - */ + @Schema(description = "state", requiredMode = Schema.RequiredMode.REQUIRED, example = "qtw") @NotEmpty(message = "state 不能为空") private String state; diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserRespDTO.java index ac25b148e..b983ad782 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserRespDTO.java @@ -1,27 +1,20 @@ package cn.iocoder.yudao.module.system.api.social.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -/** - * 社交用户 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 社交用户 Response DTO") @Data @NoArgsConstructor @AllArgsConstructor public class SocialUserRespDTO { - /** - * 社交用户 openid - */ + @Schema(description = "社交用户 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw") private String openid; - /** - * 关联的用户编号 - */ + @Schema(description = "关联的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long userId; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserUnbindReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserUnbindReqDTO.java index 56398a8ae..9fd0927e4 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserUnbindReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialUserUnbindReqDTO.java @@ -3,42 +3,30 @@ package cn.iocoder.yudao.module.system.api.social.dto; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -/** - * 社交绑定 Request DTO,使用 code 授权码 - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 取消绑定社交用户 Request DTO") @Data public class SocialUserUnbindReqDTO { - /** - * 用户编号 - */ + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "用户编号不能为空") private Long userId; - /** - * 用户类型 - */ + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @InEnum(UserTypeEnum.class) @NotNull(message = "用户类型不能为空") private Integer userType; - /** - * 社交平台的类型 - */ + @Schema(description = "社交平台的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") - private Integer type; - - /** - * 社交平台的 unionId - */ - @NotEmpty(message = "社交平台的 unionId 不能为空") - private String unionId; + private Integer socialType; + @Schema(description = "社交平台的 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw") + @NotEmpty(message = "社交平台的 openid 不能为空") + private String openid; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxJsapiSignatureRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxJsapiSignatureRespDTO.java index 7d332e926..6c67eec09 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxJsapiSignatureRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxJsapiSignatureRespDTO.java @@ -1,34 +1,25 @@ package cn.iocoder.yudao.module.system.api.social.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -/** - * 微信公众号 JSAPI 签名 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 微信公众号 JSAPI 签名 Response DTO") @Data public class SocialWxJsapiSignatureRespDTO { - /** - * 微信公众号的 appId - */ + @Schema(description = "微信公众号的 appId", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx123456") private String appId; - /** - * 匿名串 - */ + + @Schema(description = "匿名串", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw") private String nonceStr; - /** - * 时间戳 - */ + + @Schema(description = "时间戳", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456789") private Long timestamp; - /** - * URL - */ + + @Schema(description = "URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") private String url; - /** - * 签名 - */ + + @Schema(description = "签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw") private String signature; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxPhoneNumberInfoRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxPhoneNumberInfoRespDTO.java index 9d404b3c1..c1a0e777d 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxPhoneNumberInfoRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxPhoneNumberInfoRespDTO.java @@ -1,27 +1,18 @@ package cn.iocoder.yudao.module.system.api.social.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -/** - * 微信小程序的手机信息 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - 微信小程序的手机信息 Response DTO") @Data public class SocialWxPhoneNumberInfoRespDTO { - /** - * 用户绑定的手机号(国外手机号会有区号) - */ + @Schema(description = "用户绑定的手机号(国外手机号会有区号)", requiredMode = Schema.RequiredMode.REQUIRED, example = "021-13579246810") private String phoneNumber; - /** - * 没有区号的手机号 - */ + @Schema(description = "没有区号的手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13579246810") private String purePhoneNumber; - /** - * 区号 - */ + @Schema(description = "区号", requiredMode = Schema.RequiredMode.REQUIRED, example = "021") private String countryCode; } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java index ac13c3a8b..a2e5e4a1a 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java @@ -1,44 +1,30 @@ package cn.iocoder.yudao.module.system.api.user.dto; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Set; -/** - * Admin 用户 Response DTO - * - * @author 芋道源码 - */ +@Schema(description = "RPC 服务 - Admin 用户 Response DTO") @Data public class AdminUserRespDTO { - /** - * 用户ID - */ + @Schema(description = "用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long id; - /** - * 用户昵称 - */ - private String nickname; - /** - * 帐号状态 - * - * 枚举 {@link CommonStatusEnum} - */ - private Integer status; - /** - * 部门ID - */ + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王") + private String nickname; + + @Schema(description = "帐号状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private Integer status; // 参见 CommonStatusEnum 枚举 + + @Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Long deptId; - /** - * 岗位编号数组 - */ + + @Schema(description = "岗位编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]") private Set postIds; - /** - * 手机号码 - */ + + @Schema(description = "手机号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") private String mobile; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/social/SocialUserApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/social/SocialUserApiImpl.java index 43ebc829f..6cdf55a87 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/social/SocialUserApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/social/SocialUserApiImpl.java @@ -27,7 +27,7 @@ public class SocialUserApiImpl implements SocialUserApi { @Override public CommonResult unbindSocialUser(SocialUserUnbindReqDTO reqDTO) { socialUserService.unbindSocialUser(reqDTO.getUserId(), reqDTO.getUserType(), - reqDTO.getType(), reqDTO.getUnionId()); + reqDTO.getSocialType(), reqDTO.getOpenid()); return success(true); }