feat: 修改部分 swagger 注解
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package cn.iocoder.yudao.module.system.api.dict;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
@@ -10,36 +14,36 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.Collection;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 字典数据")
|
||||
@Tag(name = "RPC 服务 - 字典数据")
|
||||
public interface DictDataApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/dict-data";
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiOperation("校验字典数据们是否有效")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", example = "SEX", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "values", value = "字典数据值的数组", example = "1,2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "校验字典数据们是否有效")
|
||||
@Parameters({
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true),
|
||||
@Parameter(name = "descriptions", description = "字典数据值的数组", example = "1,2", required = true)
|
||||
})
|
||||
CommonResult<Boolean> validateDictDatas(@RequestParam("dictType") String dictType,
|
||||
@RequestParam("values") Collection<String> values);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@ApiOperation("获得指定的字典数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", example = "SEX", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "value", value = "字典数据值", example = "1", required = true, dataTypeClass = String.class)
|
||||
@Operation(summary = "获得指定的字典数据")
|
||||
@Parameters({
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true),
|
||||
@Parameter(name = "description", description = "字典数据值", example = "1", required = true)
|
||||
})
|
||||
CommonResult<DictDataRespDTO> getDictData(@RequestParam("dictType") String dictType,
|
||||
@RequestParam("value") String value);
|
||||
|
||||
@GetMapping(PREFIX + "/parse")
|
||||
@ApiOperation("解析获得指定的字典数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", example = "SEX", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "label", value = "字典标签", example = "男", required = true, dataTypeClass = String.class)
|
||||
@Operation(summary = "解析获得指定的字典数据")
|
||||
@Parameters({
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true),
|
||||
@Parameter(name = "label", description = "字典标签", example = "男", required = true)
|
||||
})
|
||||
CommonResult<DictDataRespDTO> parseDictData(@RequestParam("dictType") String dictType,
|
||||
@RequestParam("label") String label);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.api.dict.dto;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("RPC 服务 - 字典数据 Response DTO")
|
||||
@Schema(description = "RPC 服务 - 字典数据 Response DTO")
|
||||
@Data
|
||||
public class DictDataRespDTO {
|
||||
|
||||
@ApiModelProperty(value = "字典标签", required = true, example = "芋道")
|
||||
@Schema(description = "字典标签", required = true, example = "芋道")
|
||||
private String label;
|
||||
@ApiModelProperty(value = "字典值", required = true, example = "iocoder")
|
||||
@Schema(description = "字典值", required = true, example = "iocoder")
|
||||
private String value;
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@Schema(description = "字典类型", required = true, example = "sys_common_sex")
|
||||
private String dictType;
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -20,22 +20,22 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 错误码")
|
||||
@Tag(name = "RPC 服务 - 错误码")
|
||||
public interface ErrorCodeApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/error-code";
|
||||
|
||||
@PostMapping(PREFIX + "/auto-generate")
|
||||
@ApiOperation("自动创建错误码")
|
||||
@Operation(summary = "自动创建错误码")
|
||||
CommonResult<Boolean> autoGenerateErrorCodes(@Valid @RequestBody List<ErrorCodeAutoGenerateReqDTO> autoGenerateDTOs);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@ApiOperation(value = "增量获得错误码数组", notes = "如果 minUpdateTime 为空时,则获取所有错误码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "applicationName", value = "应用名", example = "system-server", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "minUpdateTime", value = "最小更新时间", dataTypeClass = LocalDateTime.class)
|
||||
@Operation(summary = "增量获得错误码数组", description = "如果 minUpdateTime 为空时,则获取所有错误码")
|
||||
@Parameters({
|
||||
@Parameter(name = "applicationName", description = "应用名", example = "system-server", required = true),
|
||||
@Parameter(name = "minUpdateTime", description = "最小更新时间")
|
||||
})
|
||||
CommonResult<List<ErrorCodeRespDTO>> getErrorCodeList(@RequestParam(value = "applicationName") String applicationName,
|
||||
@RequestParam(value = "minUpdateTime", required = false) LocalDateTime minUpdateTime);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.api.logger;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 登录日志")
|
||||
@Tag(name = "RPC 服务 - 登录日志")
|
||||
public interface LoginLogApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/login-log";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("创建登录日志")
|
||||
@Operation(summary = "创建登录日志")
|
||||
CommonResult<Boolean> createLoginLog(@Valid @RequestBody LoginLogCreateReqDTO reqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.api.logger;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 操作日志")
|
||||
@Tag(name = "RPC 服务 - 操作日志")
|
||||
public interface OperateLogApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/operate-log";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("创建操作日志")
|
||||
@Operation(summary = "创建操作日志")
|
||||
CommonResult<Boolean> createOperateLog(@Valid @RequestBody OperateLogCreateReqDTO createReqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.api.logger.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -16,32 +16,32 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class LoginLogCreateReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 LoginLogTypeEnum 枚举类")
|
||||
@Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", required = true, example = "1" )
|
||||
@NotNull(message = "日志类型不能为空")
|
||||
private Integer logType;
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@Schema(description = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
private String traceId;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "666")
|
||||
@Schema(description = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2" )
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
@ApiModelProperty(value = "用户账号", required = true, example = "yudao")
|
||||
@Schema(description = "用户账号", required = true, example = "yudao")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(max = 30, message = "用户账号长度不能超过30个字符")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 LoginResultEnum 枚举类")
|
||||
@Schema(description = "登录结果,参见 LoginResultEnum 枚举类", required = true, example = "1")
|
||||
@NotNull(message = "登录结果不能为空")
|
||||
private Integer result;
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(description = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotEmpty(message = "用户 IP 不能为空")
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.api.logger.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -9,77 +9,77 @@ import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("RPC 服务 - 操作日志创建 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 操作日志创建 Request DTO")
|
||||
@Data
|
||||
public class OperateLogCreateReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
private String traceId;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
@Schema(description = "用户编号", required = true, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1")
|
||||
@Schema(description = "用户类型", required = true, example = "1")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "操作模块", required = true, example = "订单")
|
||||
@Schema(description = "操作模块", required = true, example = "订单")
|
||||
@NotEmpty(message = "操作模块不能为空")
|
||||
private String module;
|
||||
|
||||
@ApiModelProperty(value = "操作名", required = true, example = "创建订单")
|
||||
@Schema(description = "操作名", required = true, example = "创建订单")
|
||||
@NotEmpty(message = "操作名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类")
|
||||
@Schema(description = "操作分类,参见 SysOperateLogTypeEnum 枚举类", required = true, example = "1")
|
||||
@NotNull(message = "操作分类不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。")
|
||||
@Schema(description = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "拓展字段", example = "{'orderId': 1}")
|
||||
@Schema(description = "拓展字段", example = "{'orderId': 1}")
|
||||
private Map<String, Object> exts;
|
||||
|
||||
@ApiModelProperty(value = "请求方法名", required = true, example = "GET")
|
||||
@Schema(description = "请求方法名", required = true, example = "GET")
|
||||
@NotEmpty(message = "请求方法名不能为空")
|
||||
private String requestMethod;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@Schema(description = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@NotEmpty(message = "请求地址不能为空")
|
||||
private String requestUrl;
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(description = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotEmpty(message = "用户 IP 不能为空")
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@NotEmpty(message = "浏览器 UserAgent 不能为空")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.yudao.UserController.save(...)")
|
||||
@Schema(description = "Java 方法名", required = true, example = "cn.iocoder.yudao.UserController.save(...)")
|
||||
@NotEmpty(message = "Java 方法名不能为空")
|
||||
private String javaMethod;
|
||||
|
||||
@ApiModelProperty(value = "Java 方法的参数")
|
||||
@Schema(description = "Java 方法的参数")
|
||||
private String javaMethodArgs;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
@Schema(description = "开始时间", required = true)
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "执行时长,单位:毫秒", required = true)
|
||||
@Schema(description = "执行时长,单位:毫秒", required = true)
|
||||
@NotNull(message = "执行时长不能为空")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty(value = "结果码", required = true)
|
||||
@Schema(description = "结果码", required = true)
|
||||
@NotNull(message = "结果码不能为空")
|
||||
private Integer resultCode;
|
||||
|
||||
@ApiModelProperty(value = "结果提示")
|
||||
@Schema(description = "结果提示")
|
||||
private String resultMsg;
|
||||
|
||||
@ApiModelProperty(value = "结果数据")
|
||||
@Schema(description = "结果数据")
|
||||
private String resultData;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,25 +3,25 @@ package cn.iocoder.yudao.module.system.api.mail;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.mail.dto.MailSendSingleToUserReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 邮件发送")
|
||||
@Tag(name = "RPC 服务 - 邮件发送")
|
||||
public interface MailSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/mail/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@ApiOperation(value = "发送单条邮件给 Admin 用户", notes = "在 mail 为空时,使用 userId 加载对应 Admin 的邮箱")
|
||||
@Operation(summary = "发送单条邮件给 Admin 用户", description = "在 mail 为空时,使用 userId 加载对应 Admin 的邮箱")
|
||||
CommonResult<Long> sendSingleMailToAdmin(@Valid MailSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@ApiOperation(value = "发送单条邮件给 Member 用户", notes = "在 mail 为空时,使用 userId 加载对应 Member 的邮箱")
|
||||
@Operation(summary = "发送单条邮件给 Member 用户", description = "在 mail 为空时,使用 userId 加载对应 Member 的邮箱")
|
||||
CommonResult<Long> sendSingleMailToMember(@Valid MailSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
package cn.iocoder.yudao.module.system.api.mail.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("RPC 服务 - 邮件发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 邮件发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Data
|
||||
public class MailSendSingleToUserReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "1024")
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "15601691300")
|
||||
@Schema(description = "手机号", required = true, example = "15601691300")
|
||||
@Email
|
||||
private String mail;
|
||||
|
||||
@ApiModelProperty(value = "邮件模板编号", required = true, example = "USER_SEND")
|
||||
@Schema(description = "邮件模板编号", required = true, example = "USER_SEND")
|
||||
@NotNull(message = "邮件模板编号不能为空")
|
||||
private String templateCode;
|
||||
@ApiModelProperty(value = "邮件模板参数")
|
||||
@Schema(description = "邮件模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,25 +3,25 @@ package cn.iocoder.yudao.module.system.api.notify;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 站内信发送")
|
||||
@Tag(name = "RPC 服务 - 站内信发送")
|
||||
public interface NotifyMessageSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/notify/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@ApiOperation(value = "发送单条站内信给 Admin 用户")
|
||||
@Operation(summary = "发送单条站内信给 Admin 用户")
|
||||
CommonResult<Long> sendSingleMessageToAdmin(@Valid NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@ApiOperation(value = "发送单条站内信给 Member 用户")
|
||||
@Operation(summary = "发送单条站内信给 Member 用户")
|
||||
CommonResult<Long> sendSingleMessageToMember(@Valid NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.api.notify.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("RPC 服务 - 站内信发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 站内信发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Data
|
||||
public class NotifySendSingleToUserReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
@Schema(description = "用户编号", required = true, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "站内信模板编号", required = true, example = "USER_SEND")
|
||||
@Schema(description = "站内信模板编号", required = true, example = "USER_SEND")
|
||||
@NotEmpty(message = "站内信模板编号不能为空")
|
||||
private String templateCode;
|
||||
@ApiModelProperty(value = "邮件模板参数")
|
||||
@Schema(description = "邮件模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,17 @@ import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespD
|
||||
import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - OAuth2.0 令牌")
|
||||
@Tag(name = "RPC 服务 - OAuth2.0 令牌")
|
||||
public interface OAuth2TokenApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oauth2/token";
|
||||
@@ -27,26 +27,26 @@ public interface OAuth2TokenApi {
|
||||
String URL_CHECK = "http://" + ApiConstants.NAME + PREFIX + "/check";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("创建访问令牌")
|
||||
@Operation(summary = "创建访问令牌")
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@Valid @RequestBody OAuth2AccessTokenCreateReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/check")
|
||||
@ApiOperation("校验访问令牌")
|
||||
@ApiImplicitParam(name = "accessToken", value = "访问令牌", required = true, dataTypeClass = String.class, example = "tudou")
|
||||
@Operation(summary = "校验访问令牌")
|
||||
@Parameter(name = "accessToken", description = "访问令牌", required = true, example = "tudou")
|
||||
CommonResult<OAuth2AccessTokenCheckRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken);
|
||||
|
||||
@DeleteMapping(PREFIX + "/remove")
|
||||
@ApiOperation("移除访问令牌")
|
||||
@ApiImplicitParam(name = "accessToken", value = "访问令牌", required = true, dataTypeClass = String.class, example = "tudou")
|
||||
@Operation(summary = "移除访问令牌")
|
||||
@Parameter(name = "accessToken", description = "访问令牌", required = true, example = "tudou")
|
||||
CommonResult<OAuth2AccessTokenRespDTO> removeAccessToken(@RequestParam("accessToken") String accessToken);
|
||||
|
||||
@PutMapping(PREFIX + "/refresh")
|
||||
@ApiOperation("刷新访问令牌")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class, example = "haha"),
|
||||
@ApiImplicitParam(name = "clientId", value = "客户端编号", required = true, dataTypeClass = String.class, example = "yudaoyuanma")
|
||||
@Operation(summary = "刷新访问令牌")
|
||||
@Parameters({
|
||||
@Parameter(name = "refreshToken", description = "刷新令牌", required = true, example = "haha"),
|
||||
@Parameter(name = "clientId", description = "客户端编号", required = true, example = "yudaoyuanma")
|
||||
})
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestParam("refreshToken") String refreshToken,
|
||||
@RequestParam("clientId") String clientId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.api.oauth2.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("RPC 服务 - OAuth2 访问令牌的校验 Response DTO")
|
||||
@Schema(description = "RPC 服务 - OAuth2 访问令牌的校验 Response DTO")
|
||||
@Data
|
||||
public class OAuth2AccessTokenCheckRespDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "10")
|
||||
@Schema(description = "用户编号", required = true, example = "10")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "租户编号", required = true, example = "1024")
|
||||
@Schema(description = "租户编号", required = true, example = "1024")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "授权范围的数组", example = "user_info")
|
||||
@Schema(description = "授权范围的数组", example = "user_info")
|
||||
private List<String> scopes;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,32 +2,32 @@ package cn.iocoder.yudao.module.system.api.oauth2.dto;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("RPC 服务 - OAuth2 访问令牌创建 Request DTO")
|
||||
@Schema(description = "RPC 服务 - OAuth2 访问令牌创建 Request DTO")
|
||||
@Data
|
||||
public class OAuth2AccessTokenCreateReqDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "10")
|
||||
@Schema(description = "用户编号", required = true, example = "10")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
@InEnum(value = UserTypeEnum.class, message = "用户类型必须是 {value}")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "客户端编号", required = true, example = "yudaoyuanma")
|
||||
@Schema(description = "客户端编号", required = true, example = "yudaoyuanma")
|
||||
@NotNull(message = "客户端编号不能为空")
|
||||
private String clientId;
|
||||
|
||||
@ApiModelProperty(value = "授权范围的数组", example = "user_info")
|
||||
@Schema(description = "授权范围的数组", example = "user_info")
|
||||
private List<String> scopes;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.api.oauth2.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("RPC 服务 - OAuth2 访问令牌的信息 Response DTO")
|
||||
@Schema(description = "RPC 服务 - OAuth2 访问令牌的信息 Response DTO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OAuth2AccessTokenRespDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "访问令牌", required = true, example = "tudou")
|
||||
@Schema(description = "访问令牌", required = true, example = "tudou")
|
||||
private String accessToken;
|
||||
|
||||
@ApiModelProperty(value = "刷新令牌", required = true, example = "haha")
|
||||
@Schema(description = "刷新令牌", required = true, example = "haha")
|
||||
private String refreshToken;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "10")
|
||||
@Schema(description = "用户编号", required = true, example = "10")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "1" )
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "过期时间", required = true)
|
||||
@Schema(description = "过期时间", required = true)
|
||||
private LocalDateTime expiresTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.system.api.permission;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -15,37 +15,37 @@ import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 权限")
|
||||
@Tag(name = "RPC 服务 - 权限")
|
||||
public interface PermissionApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/permission";
|
||||
|
||||
@GetMapping(PREFIX + "/user-role-id-list-by-role-id")
|
||||
@ApiOperation("获得拥有多个角色的用户编号集合")
|
||||
@ApiImplicitParam(name = "roleIds", value = "角色编号集合", example = "1,2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "获得拥有多个角色的用户编号集合")
|
||||
@Parameter(name = "roleIds", description = "角色编号集合", example = "1,2", required = true)
|
||||
CommonResult<Set<Long>> getUserRoleIdListByRoleIds(@RequestParam("roleIds") Collection<Long> roleIds);
|
||||
|
||||
@GetMapping(PREFIX + "/has-any-permissions")
|
||||
@ApiOperation("判断是否有权限,任一一个即可")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "permissions", value = "权限", example = "read,write", required = true, allowMultiple = true)
|
||||
@Operation(summary = "判断是否有权限,任一一个即可")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true),
|
||||
@Parameter(name = "permissions", description = "权限", example = "read,write", required = true)
|
||||
})
|
||||
CommonResult<Boolean> hasAnyPermissions(@RequestParam("userId") Long userId,
|
||||
@RequestParam("permissions") String... permissions);
|
||||
|
||||
@GetMapping(PREFIX + "/has-any-roles")
|
||||
@ApiOperation("判断是否有角色,任一一个即可")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "roles", value = "角色数组", example = "2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "判断是否有角色,任一一个即可")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true),
|
||||
@Parameter(name = "roles", description = "角色数组", example = "2", required = true)
|
||||
})
|
||||
CommonResult<Boolean> hasAnyRoles(@RequestParam("userId") Long userId,
|
||||
@RequestParam("roles") String... roles);
|
||||
|
||||
@GetMapping(PREFIX + "/get-dept-data-permission")
|
||||
@ApiOperation("获得登陆用户的部门数据权限")
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "2", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得登陆用户的部门数据权限")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "2", required = true)
|
||||
CommonResult<DeptDataPermissionRespDTO> getDeptDataPermission(@RequestParam("userId") Long userId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.api.permission;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -12,14 +12,14 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.Collection;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 角色")
|
||||
@Tag(name = "RPC 服务 - 角色")
|
||||
public interface RoleApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/role";
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiOperation("校验角色是否合法")
|
||||
@ApiImplicitParam(name = "ids", value = "角色编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "校验角色是否合法")
|
||||
@Parameter(name = "ids", description = "角色编号数组", example = "1,2", required = true)
|
||||
CommonResult<Boolean> validRoleList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.system.api.sensitiveword;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -13,27 +13,27 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFacx`tory =
|
||||
@Api(tags = "RPC 服务 - 敏感词")
|
||||
@Tag(name = "RPC 服务 - 敏感词")
|
||||
public interface SensitiveWordApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/sensitive-word";
|
||||
|
||||
@GetMapping(PREFIX + "/validate-text")
|
||||
@ApiOperation("获得文本所包含的不合法的敏感词数组")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "text", value = "文本", example = "傻瓜", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", example = "product,life", required = true, allowMultiple = true)
|
||||
@Operation(summary = "获得文本所包含的不合法的敏感词数组")
|
||||
@Parameters({
|
||||
@Parameter(name = "text", description = "文本", example = "傻瓜", required = true),
|
||||
@Parameter(name = "tags", description = "标签数组", example = "product,life", required = true)
|
||||
})
|
||||
CommonResult<List<String>> validateText(@RequestParam("text") String text,
|
||||
@RequestParam("tags") List<String> tags);
|
||||
|
||||
@GetMapping(PREFIX + "/is-text-valid")
|
||||
@ApiOperation("判断文本是否包含敏感词")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "text", value = "文本", example = "傻瓜", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", example = "product,life", required = true, allowMultiple = true)
|
||||
@Operation(summary = "判断文本是否包含敏感词")
|
||||
@Parameters({
|
||||
@Parameter(name = "text", description = "文本", example = "傻瓜", required = true),
|
||||
@Parameter(name = "tags", description = "标签数组", example = "product,life", required = true)
|
||||
})
|
||||
CommonResult<Boolean> isTextValid(@RequestParam("text") String text,
|
||||
@RequestParam("tags") List<String> tags);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -16,21 +16,21 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 短信验证码")
|
||||
@Tag(name = "RPC 服务 - 短信验证码")
|
||||
public interface SmsCodeApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oauth2/sms/code";
|
||||
|
||||
@PostMapping(PREFIX + "/send")
|
||||
@ApiOperation("创建短信验证码,并进行发送")
|
||||
@Operation(summary = "创建短信验证码,并进行发送")
|
||||
CommonResult<Boolean> sendSmsCode(@Valid @RequestBody SmsCodeSendReqDTO reqDTO);
|
||||
|
||||
@PutMapping(PREFIX + "/use")
|
||||
@ApiOperation("验证短信验证码,并进行使用")
|
||||
@Operation(summary = "验证短信验证码,并进行使用")
|
||||
CommonResult<Boolean> useSmsCode(@Valid @RequestBody SmsCodeUseReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/validate")
|
||||
@ApiOperation("检查验证码是否有效")
|
||||
@Operation(summary = "检查验证码是否有效")
|
||||
CommonResult<Boolean> validateSmsCode(@Valid @RequestBody SmsCodeValidateReqDTO reqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.api.sms;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,17 +12,17 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 短信发送")
|
||||
@Tag(name = "RPC 服务 - 短信发送")
|
||||
public interface SmsSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/sms/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@ApiOperation(value = "发送单条短信给 Admin 用户", notes = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
@Operation(summary = "发送单条短信给 Admin 用户", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToAdmin(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@ApiOperation(value = "发送单条短信给 Member 用户", notes = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
@Operation(summary = "发送单条短信给 Member 用户", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToMember(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,27 +3,27 @@ package cn.iocoder.yudao.module.system.api.sms.dto.code;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("RPC 服务 - 短信验证码的发送 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 短信验证码的发送 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeSendReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "15601691300")
|
||||
@Schema(description = "手机号", required = true, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
@ApiModelProperty(value = "发送场景", required = true, example = "1")
|
||||
@Schema(description = "发送场景", required = true, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
@ApiModelProperty(value = "发送 IP", required = true, example = "10.20.30.40")
|
||||
@Schema(description = "发送 IP", required = true, example = "10.20.30.40")
|
||||
@NotEmpty(message = "发送 IP 不能为空")
|
||||
private String createIp;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,30 +3,30 @@ package cn.iocoder.yudao.module.system.api.sms.dto.code;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("RPC 服务 - 短信验证码的使用 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 短信验证码的使用 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeUseReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "15601691300")
|
||||
@Schema(description = "手机号", required = true, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
@ApiModelProperty(value = "发送场景", required = true, example = "1")
|
||||
@Schema(description = "发送场景", required = true, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
@ApiModelProperty(value = "验证码", required = true, example = "1024")
|
||||
@Schema(description = "验证码", required = true, example = "1024")
|
||||
@NotEmpty(message = "验证码")
|
||||
private String code;
|
||||
@ApiModelProperty(value = "发送 IP", required = true, example = "10.20.30.40")
|
||||
@Schema(description = "发送 IP", required = true, example = "10.20.30.40")
|
||||
@NotEmpty(message = "使用 IP 不能为空")
|
||||
private String usedIp;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,27 +3,27 @@ package cn.iocoder.yudao.module.system.api.sms.dto.code;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("RPC 服务 - 短信验证码的校验 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 短信验证码的校验 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeValidateReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "15601691300")
|
||||
@Schema(description = "手机号", required = true, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
@ApiModelProperty(value = "发送场景", required = true, example = "1")
|
||||
@Schema(description = "发送场景", required = true, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
@ApiModelProperty(value = "验证码", required = true, example = "1024")
|
||||
@Schema(description = "验证码", required = true, example = "1024")
|
||||
@NotEmpty(message = "验证码")
|
||||
private String code;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.api.sms.dto.send;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("RPC 服务 - 短信发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 短信发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Data
|
||||
public class SmsSendSingleToUserReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "1024")
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "15601691300")
|
||||
@Schema(description = "手机号", required = true, example = "15601691300")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "短信模板编号", required = true, example = "USER_SEND")
|
||||
@Schema(description = "短信模板编号", required = true, example = "USER_SEND")
|
||||
@NotEmpty(message = "短信模板编号不能为空")
|
||||
private String templateCode;
|
||||
@ApiModelProperty(value = "短信模板参数")
|
||||
@Schema(description = "短信模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,49 +4,49 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserUnbindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 社交用户")
|
||||
@Tag(name = "RPC 服务 - 社交用户")
|
||||
public interface SocialUserApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/social-user";
|
||||
|
||||
@GetMapping("/get-authorize-url")
|
||||
@ApiOperation("获得社交平台的授权 URL")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "社交平台的类型", example = "1", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "redirectUri", value = "重定向 URL", example = "https://www.iocoder.cn",required = true, dataTypeClass = String.class)
|
||||
@Operation(summary = "获得社交平台的授权 URL")
|
||||
@Parameters({
|
||||
@Parameter(name = "type", description = "社交平台的类型", example = "1", required = true),
|
||||
@Parameter(name = "redirectUri", description = "重定向 URL", example = "https://www.iocoder.cn",required = true)
|
||||
})
|
||||
CommonResult<String> getAuthorizeUrl(@RequestParam("type") Integer type,
|
||||
@RequestParam("redirectUri") String redirectUri);
|
||||
|
||||
@PostMapping("/bind")
|
||||
@ApiOperation("绑定社交用户")
|
||||
@Operation(summary = "绑定社交用户")
|
||||
CommonResult<Boolean> bindSocialUser(@Valid @RequestBody SocialUserBindReqDTO reqDTO);
|
||||
|
||||
@DeleteMapping("/unbind")
|
||||
@ApiOperation("取消绑定社交用户")
|
||||
@Operation(summary = "取消绑定社交用户")
|
||||
CommonResult<Boolean> unbindSocialUser(@Valid @RequestBody SocialUserUnbindReqDTO reqDTO);
|
||||
|
||||
@GetMapping("/get-bind-user-id")
|
||||
@ApiOperation("获得社交用户的绑定用户编号")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userType", value = "用户类型", example = "2", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "type", value = "社交平台的类型", example = "1", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "code", value = "授权码", required = true, example = "tudou", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "state", value = "state", required = true, example = "coke", dataTypeClass = String.class)
|
||||
@Operation(summary = "获得社交用户的绑定用户编号")
|
||||
@Parameters({
|
||||
@Parameter(name = "userType", description = "用户类型", example = "2", required = true),
|
||||
@Parameter(name = "type", description = "社交平台的类型", example = "1", required = true),
|
||||
@Parameter(name = "code", description = "授权码", required = true, example = "tudou"),
|
||||
@Parameter(name = "state", description = "state", required = true, example = "coke")
|
||||
})
|
||||
CommonResult<Long> getBindUserId(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("type") Integer type,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("state") String state);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.api.tenant;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -12,18 +12,18 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 多租户")
|
||||
@Tag(name = "RPC 服务 - 多租户")
|
||||
public interface TenantApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/tenant";
|
||||
|
||||
@GetMapping(PREFIX + "/id-list")
|
||||
@ApiOperation("获得所有租户编号")
|
||||
@Operation(summary = "获得所有租户编号")
|
||||
CommonResult<List<Long>> getTenantIds();
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiOperation("校验租户是否合法")
|
||||
@ApiImplicitParam(name = "id", value = "租户编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "校验租户是否合法")
|
||||
@Parameter(name = "id", description = "租户编号", required = true, example = "1024")
|
||||
CommonResult<Boolean> validTenant(@RequestParam("id") Long id);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -17,29 +17,29 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 管理员用户")
|
||||
@Tag(name = "RPC 服务 - 管理员用户")
|
||||
public interface AdminUserApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/user";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@ApiOperation("通过用户 ID 查询用户")
|
||||
@ApiImplicitParam(name = "id", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "通过用户 ID 查询用户")
|
||||
@Parameter(name = "id", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<AdminUserRespDTO> getUser(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@ApiOperation("通过用户 ID 查询用户们")
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "通过用户 ID 查询用户们")
|
||||
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsers(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-dept-id")
|
||||
@ApiOperation("获得指定部门的用户数组")
|
||||
@ApiImplicitParam(name = "deptIds", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
@Operation(summary = "获得指定部门的用户数组")
|
||||
@Parameter(name = "deptIds", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsersByDeptIds(@RequestParam("deptIds") Collection<Long> deptIds);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-post-id")
|
||||
@ApiOperation("获得指定岗位的用户数组")
|
||||
@ApiImplicitParam(name = "postIds", value = "岗位编号数组", example = "2,3", required = true, allowMultiple = true)
|
||||
@Operation(summary = "获得指定岗位的用户数组")
|
||||
@Parameter(name = "postIds", description = "岗位编号数组", example = "2,3", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsersByPostIds(@RequestParam("postIds") Collection<Long> postIds);
|
||||
|
||||
/**
|
||||
@@ -53,8 +53,8 @@ public interface AdminUserApi {
|
||||
}
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiOperation("校验用户们是否有效")
|
||||
@ApiImplicitParam(name = "ids", value = "用户编号数组", example = "3,5", required = true)
|
||||
@Operation(summary = "校验用户们是否有效")
|
||||
@Parameter(name = "ids", description = "用户编号数组", example = "3,5", required = true)
|
||||
CommonResult<Boolean> validUsers(@RequestParam("ids") Set<Long> ids);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user