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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.yudao.module.system.convert.auth.OAuth2TokenConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
|
||||
import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -26,7 +26,7 @@ public class OAuth2TokenApiImpl implements OAuth2TokenApi {
|
||||
private OAuth2TokenService oauth2TokenService;
|
||||
|
||||
@Override
|
||||
@ApiOperation("创建访问令牌")
|
||||
@Operation(description = "创建访问令牌")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2AccessTokenCreateReqDTO reqDTO) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(
|
||||
reqDTO.getUserId(), reqDTO.getUserType(), reqDTO.getClientId(), reqDTO.getScopes());
|
||||
|
||||
@@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import cn.iocoder.yudao.module.system.service.social.SocialUserService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -38,7 +38,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.obtainAuthorization;
|
||||
import static java.util.Collections.singleton;
|
||||
|
||||
@Api(tags = "管理后台 - 认证")
|
||||
@Tag(name = "管理后台 - 认证")
|
||||
@RestController
|
||||
@RequestMapping("/system/auth")
|
||||
@Validated
|
||||
@@ -61,7 +61,7 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/login")
|
||||
@PermitAll
|
||||
@ApiOperation("使用账号密码登录")
|
||||
@Operation(summary = "使用账号密码登录")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> login(@RequestBody @Valid AuthLoginReqVO reqVO) {
|
||||
return success(authService.login(reqVO));
|
||||
@@ -69,7 +69,7 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/logout")
|
||||
@PermitAll
|
||||
@ApiOperation("登出系统")
|
||||
@Operation(summary = "登出系统")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<Boolean> logout(HttpServletRequest request) {
|
||||
String token = obtainAuthorization(request, securityProperties.getTokenHeader());
|
||||
@@ -81,15 +81,15 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/refresh-token")
|
||||
@PermitAll
|
||||
@ApiOperation("刷新令牌")
|
||||
@ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class)
|
||||
@Operation(summary = "刷新令牌")
|
||||
@Parameter(name = "refreshToken", description = "刷新令牌", required = true)
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> refreshToken(@RequestParam("refreshToken") String refreshToken) {
|
||||
return success(authService.refreshToken(refreshToken));
|
||||
}
|
||||
|
||||
@GetMapping("/get-permission-info")
|
||||
@ApiOperation("获取登录用户的权限信息")
|
||||
@Operation(summary = "获取登录用户的权限信息")
|
||||
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() {
|
||||
// 获得用户信息
|
||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||
@@ -108,7 +108,7 @@ public class AuthController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-menus")
|
||||
@ApiOperation("获得登录用户的菜单列表")
|
||||
@Operation(summary = "获得登录用户的菜单列表")
|
||||
public CommonResult<List<AuthMenuRespVO>> getMenus() {
|
||||
// 获得角色列表
|
||||
Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
@@ -124,7 +124,7 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/sms-login")
|
||||
@PermitAll
|
||||
@ApiOperation("使用短信验证码登录")
|
||||
@Operation(summary = "使用短信验证码登录")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> smsLogin(@RequestBody @Valid AuthSmsLoginReqVO reqVO) {
|
||||
return success(authService.smsLogin(reqVO));
|
||||
@@ -132,7 +132,7 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/send-sms-code")
|
||||
@PermitAll
|
||||
@ApiOperation(value = "发送手机验证码")
|
||||
@Operation(summary = "发送手机验证码")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<Boolean> sendLoginSmsCode(@RequestBody @Valid AuthSmsSendReqVO reqVO) {
|
||||
authService.sendSmsCode(reqVO);
|
||||
@@ -143,10 +143,10 @@ public class AuthController {
|
||||
|
||||
@GetMapping("/social-auth-redirect")
|
||||
@PermitAll
|
||||
@ApiOperation("社交授权的跳转")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class)
|
||||
@Operation(summary = "社交授权的跳转")
|
||||
@Parameters({
|
||||
@Parameter(name = "type", description = "社交类型", required = true),
|
||||
@Parameter(name = "redirectUri", description = "回调路径")
|
||||
})
|
||||
public CommonResult<String> socialLogin(@RequestParam("type") Integer type,
|
||||
@RequestParam("redirectUri") String redirectUri) {
|
||||
@@ -155,10 +155,10 @@ public class AuthController {
|
||||
|
||||
@PostMapping("/social-login")
|
||||
@PermitAll
|
||||
@ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户")
|
||||
@Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> socialQuickLogin(@RequestBody @Valid AuthSocialLoginReqVO reqVO) {
|
||||
return success(authService.socialLogin(reqVO));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -15,48 +15,48 @@ import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@ApiModel(value = "管理后台 - 账号密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数")
|
||||
@Schema(description = "管理后台 - 账号密码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma")
|
||||
@Schema(description = "账号", required = true, example = "yudaoyuanma")
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
@Length(min = 4, max = 16, message = "账号长度为 4-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "buzhidao")
|
||||
@Schema(description = "密码", required = true, example = "buzhidao")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
// ========== 图片验证码相关 ==========
|
||||
|
||||
@ApiModelProperty(value = "验证码", required = true,
|
||||
example = "PfcH6mgr8tpXuMWFjvW6YVaqrswIuwmWI5dsVZSg7sGpWtDCUbHuDEXl3cFB1+VvCC/rAkSwK8Fad52FSuncVg==",
|
||||
notes = "验证码开启时,需要传递")
|
||||
@Schema(description = "验证码,验证码开启时,需要传递", required = true,
|
||||
example = "PfcH6mgr8tpXuMWFjvW6YVaqrswIuwmWI5dsVZSg7sGpWtDCUbHuDEXl3cFB1+VvCC/rAkSwK8Fad52FSuncVg==")
|
||||
@NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class)
|
||||
private String captchaVerification;
|
||||
|
||||
// ========== 绑定社交登录时,需要传递如下参数 ==========
|
||||
|
||||
@ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
|
||||
@Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
private Integer socialType;
|
||||
|
||||
@ApiModelProperty(value = "授权码", required = true, example = "1024")
|
||||
@Schema(description = "授权码", required = true, example = "1024")
|
||||
private String socialCode;
|
||||
|
||||
@ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
private String socialState;
|
||||
|
||||
/**
|
||||
* 开启验证码的 Group
|
||||
*/
|
||||
public interface CodeEnableGroup {}
|
||||
public interface CodeEnableGroup {
|
||||
}
|
||||
|
||||
@AssertTrue(message = "授权码不能为空")
|
||||
public boolean isSocialCodeValid() {
|
||||
@@ -68,4 +68,4 @@ public class AuthLoginReqVO {
|
||||
return socialType == null || StrUtil.isNotEmpty(socialState);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,23 +9,23 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 登录 Response VO")
|
||||
@Schema(description = "管理后台 - 登录 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthLoginRespVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
@Schema(description = "用户编号", required = true, example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "访问令牌", required = true, example = "happy")
|
||||
@Schema(description = "访问令牌", required = true, example = "happy")
|
||||
private String accessToken;
|
||||
|
||||
@ApiModelProperty(value = "刷新令牌", required = true, example = "nice")
|
||||
@Schema(description = "刷新令牌", required = true, example = "nice")
|
||||
private String refreshToken;
|
||||
|
||||
@ApiModelProperty(value = "过期时间", required = true)
|
||||
@Schema(description = "过期时间", required = true)
|
||||
private LocalDateTime expiresTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,35 +9,35 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 登录用户的菜单信息 Response VO")
|
||||
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthMenuRespVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
|
||||
@Schema(description = "父菜单 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
@Schema(description = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
|
||||
@Schema(description = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
|
||||
private String component;
|
||||
|
||||
@ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
@Schema(description = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty(value = "是否可见", required = true, example = "false")
|
||||
@Schema(description = "是否可见", required = true, example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
@ApiModelProperty(value = "是否缓存", required = true, example = "false")
|
||||
@Schema(description = "是否缓存", required = true, example = "false")
|
||||
private Boolean keepAlive;
|
||||
|
||||
/**
|
||||
@@ -45,4 +45,4 @@ public class AuthMenuRespVO {
|
||||
*/
|
||||
private List<AuthMenuRespVO> children;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,38 +9,38 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ApiModel(value = "管理后台 - 登录用户的权限信息 Response VO", description = "额外包括用户信息和角色列表")
|
||||
@Schema(description = "管理后台 - 登录用户的权限信息 Response VO,额外包括用户信息和角色列表")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthPermissionInfoRespVO {
|
||||
|
||||
@ApiModelProperty(value = "用户信息", required = true)
|
||||
@Schema(description = "用户信息", required = true)
|
||||
private UserVO user;
|
||||
|
||||
@ApiModelProperty(value = "角色标识数组", required = true)
|
||||
@Schema(description = "角色标识数组", required = true)
|
||||
private Set<String> roles;
|
||||
|
||||
@ApiModelProperty(value = "操作权限数组", required = true)
|
||||
@Schema(description = "操作权限数组", required = true)
|
||||
private Set<String> permissions;
|
||||
|
||||
@ApiModel("用户信息 VO")
|
||||
@Schema(description = "用户信息 VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class UserVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
@Schema(description = "用户编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", required = true, example = "芋道源码")
|
||||
@Schema(description = "用户昵称", required = true, example = "芋道源码")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像", required = true, example = "http://www.iocoder.cn/xx.jpg")
|
||||
@Schema(description = "用户头像", required = true, example = "http://www.iocoder.cn/xx.jpg")
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -10,20 +10,20 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("管理后台 - 短信验证码的登录 Request VO")
|
||||
@Schema(description = "管理后台 - 短信验证码的登录 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSmsLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "yudaoyuanma")
|
||||
@Schema(description = "手机号", required = true, example = "yudaoyuanma")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "短信验证码", required = true, example = "1024")
|
||||
@Schema(description = "短信验证码", required = true, example = "1024")
|
||||
@NotEmpty(message = "验证码不能为空")
|
||||
private String code;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -13,21 +13,21 @@ import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 发送手机验证码 Request VO")
|
||||
@Schema(description = "管理后台 - 发送手机验证码 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSmsSendReqVO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "yudaoyuanma")
|
||||
@Schema(description = "手机号", required = true, example = "yudaoyuanma")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "短信场景", required = true, example = "1")
|
||||
@Schema(description = "短信场景", required = true, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -14,35 +14,35 @@ import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码")
|
||||
@Schema(description = "管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSocialBindLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值")
|
||||
@Schema(description = "社交平台的类型,参见 UserSocialTypeEnum 枚举值", required = true, example = "10" )
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "授权码", required = true, example = "1024")
|
||||
@Schema(description = "授权码", required = true, example = "1024")
|
||||
@NotEmpty(message = "授权码不能为空")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@NotEmpty(message = "state 不能为空")
|
||||
private String state;
|
||||
|
||||
@ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma")
|
||||
@Schema(description = "账号", required = true, example = "yudaoyuanma")
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
@Length(min = 4, max = 16, message = "账号长度为 4-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "buzhidao")
|
||||
@Schema(description = "密码", required = true, example = "buzhidao")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -12,24 +12,24 @@ import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码")
|
||||
@Schema(description = "管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSocialLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值")
|
||||
@Schema(description = "社交平台的类型,参见 UserSocialTypeEnum 枚举值", required = true, example = "10")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "授权码", required = true, example = "1024")
|
||||
@Schema(description = "授权码", required = true, example = "1024")
|
||||
@NotEmpty(message = "授权码不能为空")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@NotEmpty(message = "state 不能为空")
|
||||
private String state;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.xingyuv.captcha.model.common.ResponseModel;
|
||||
import com.xingyuv.captcha.model.vo.CaptchaVO;
|
||||
import com.xingyuv.captcha.service.CaptchaService;
|
||||
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.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Api(tags = "管理后台 - 验证码")
|
||||
@Tag(name = "管理后台 - 验证码")
|
||||
@RestController("adminCaptchaController")
|
||||
@RequestMapping("/system/captcha")
|
||||
public class CaptchaController {
|
||||
@@ -31,7 +31,7 @@ public class CaptchaController {
|
||||
private CaptchaService captchaService;
|
||||
|
||||
@PostMapping({"/get"})
|
||||
@ApiOperation("获得验证码")
|
||||
@Operation(summary = "获得验证码")
|
||||
@PermitAll
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
||||
@@ -41,7 +41,7 @@ public class CaptchaController {
|
||||
}
|
||||
|
||||
@PostMapping("/check")
|
||||
@ApiOperation("校验验证码")
|
||||
@Operation(summary = "校验验证码")
|
||||
@PermitAll
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
||||
@@ -58,4 +58,4 @@ public class CaptchaController {
|
||||
return request.getRemoteAddr() + ua;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*;
|
||||
import cn.iocoder.yudao.module.system.convert.dept.DeptConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 部门")
|
||||
@Tag(name = "管理后台 - 部门")
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
@Validated
|
||||
@@ -30,7 +30,7 @@ public class DeptController {
|
||||
private DeptService deptService;
|
||||
|
||||
@PostMapping("create")
|
||||
@ApiOperation("创建部门")
|
||||
@Operation(summary = "创建部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||
public CommonResult<Long> createDept(@Valid @RequestBody DeptCreateReqVO reqVO) {
|
||||
Long deptId = deptService.createDept(reqVO);
|
||||
@@ -38,7 +38,7 @@ public class DeptController {
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("更新部门")
|
||||
@Operation(summary = "更新部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||
public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptUpdateReqVO reqVO) {
|
||||
deptService.updateDept(reqVO);
|
||||
@@ -46,8 +46,8 @@ public class DeptController {
|
||||
}
|
||||
|
||||
@DeleteMapping("delete")
|
||||
@ApiOperation("删除部门")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除部门")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:delete')")
|
||||
public CommonResult<Boolean> deleteDept(@RequestParam("id") Long id) {
|
||||
deptService.deleteDept(id);
|
||||
@@ -55,7 +55,7 @@ public class DeptController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获取部门列表")
|
||||
@Operation(summary = "获取部门列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) {
|
||||
List<DeptDO> list = deptService.getDeptList(reqVO);
|
||||
@@ -64,7 +64,7 @@ public class DeptController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
public CommonResult<List<DeptSimpleRespVO>> getSimpleDepts() {
|
||||
// 获得部门列表,只要开启状态的
|
||||
DeptListReqVO reqVO = new DeptListReqVO();
|
||||
@@ -76,11 +76,11 @@ public class DeptController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得部门信息")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得部门信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) {
|
||||
return success(DeptConvert.INSTANCE.convert(deptService.getDept(id)));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*;
|
||||
import cn.iocoder.yudao.module.system.convert.dept.PostConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||
import cn.iocoder.yudao.module.system.service.dept.PostService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,7 +27,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 岗位")
|
||||
@Tag(name = "管理后台 - 岗位")
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
@Validated
|
||||
@@ -37,7 +37,7 @@ public class PostController {
|
||||
private PostService postService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建岗位")
|
||||
@Operation(summary = "创建岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:create')")
|
||||
public CommonResult<Long> createPost(@Valid @RequestBody PostCreateReqVO reqVO) {
|
||||
Long postId = postService.createPost(reqVO);
|
||||
@@ -45,7 +45,7 @@ public class PostController {
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改岗位")
|
||||
@Operation(summary = "修改岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:update')")
|
||||
public CommonResult<Boolean> updatePost(@Valid @RequestBody PostUpdateReqVO reqVO) {
|
||||
postService.updatePost(reqVO);
|
||||
@@ -53,7 +53,7 @@ public class PostController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除岗位")
|
||||
@Operation(summary = "删除岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:delete')")
|
||||
public CommonResult<Boolean> deletePost(@RequestParam("id") Long id) {
|
||||
postService.deletePost(id);
|
||||
@@ -61,15 +61,15 @@ public class PostController {
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get")
|
||||
@ApiOperation("获得岗位信息")
|
||||
@ApiImplicitParam(name = "id", value = "岗位编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得岗位信息")
|
||||
@Parameter(name = "id", description = "岗位编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
public CommonResult<PostRespVO> getPost(@RequestParam("id") Long id) {
|
||||
return success(PostConvert.INSTANCE.convert(postService.getPost(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项")
|
||||
@Operation(summary = "获取岗位精简信息列表", description = "只包含被开启的岗位,主要用于前端的下拉选项")
|
||||
public CommonResult<List<PostSimpleRespVO>> getSimplePosts() {
|
||||
// 获得岗位列表,只要开启状态的
|
||||
List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
@@ -79,14 +79,14 @@ public class PostController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得岗位分页列表")
|
||||
@Operation(summary = "获得岗位分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
public CommonResult<PageResult<PostRespVO>> getPostPage(@Validated PostPageReqVO reqVO) {
|
||||
return success(PostConvert.INSTANCE.convertPage(postService.getPostPage(reqVO)));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("岗位管理")
|
||||
@Operation(summary = "岗位管理")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException {
|
||||
@@ -96,4 +96,4 @@ public class PostController {
|
||||
ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
@@ -15,33 +15,33 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(max = 30, message = "部门名称长度不能超过30个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父菜单 ID", example = "1024")
|
||||
@Schema(description = "父菜单 ID", example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@Schema(description = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人的用户编号", example = "2048")
|
||||
@Schema(description = "负责人的用户编号", example = "2048")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话", example = "15601691000")
|
||||
@Schema(description = "联系电话", example = "15601691000")
|
||||
@Size(max = 11, message = "联系电话长度不能超过11个字符")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", example = "yudao@iocoder.cn")
|
||||
@Schema(description = "邮箱", example = "yudao@iocoder.cn")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(max = 50, message = "邮箱长度不能超过50个字符")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1")
|
||||
@NotNull(message = "状态不能为空")
|
||||
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 部门创建 Request VO")
|
||||
@Schema(description = "管理后台 - 部门创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
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("管理后台 - 部门列表 Request VO")
|
||||
@Schema(description = "管理后台 - 部门列表 Request VO")
|
||||
@Data
|
||||
public class DeptListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "部门名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 部门信息 Response VO")
|
||||
@Schema(description = "管理后台 - 部门信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptRespVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
@Schema(description = "部门编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
@Schema(description = "创建时间", required = true, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 部门精简信息 Response VO")
|
||||
@Schema(description = "管理后台 - 部门精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeptSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
@Schema(description = "部门编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true, example = "芋道")
|
||||
@Schema(description = "部门名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门 ID", required = true, example = "1024")
|
||||
@Schema(description = "父部门 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 部门更新 Request VO")
|
||||
@Schema(description = "管理后台 - 部门更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptUpdateReqVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
@Schema(description = "部门编号", required = true, example = "1024")
|
||||
@NotNull(message = "部门编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -14,24 +14,24 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", required = true, example = "小博主")
|
||||
@Schema(description = "岗位名称", required = true, example = "小博主")
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", required = true, example = "yudao")
|
||||
@Schema(description = "岗位编码", required = true, example = "yudao")
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@Schema(description = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "快乐的备注")
|
||||
@Schema(description = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位创建 Request VO")
|
||||
@Schema(description = "管理后台 - 岗位创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostCreateReqVO extends PostBaseVO {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
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(value = "管理后台 - 岗位导出 Request VO", description = "参数和 PostExcelVO 是一致的")
|
||||
@Schema(description = "管理后台 - 岗位导出 Request VO,参数和 PostExcelVO 是一致的")
|
||||
@Data
|
||||
public class PostExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配")
|
||||
@Schema(description = "岗位编码,模糊匹配", example = "yudao")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位列表 Request VO")
|
||||
@Schema(description = "管理后台 - 岗位列表 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostListReqVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位分页 Request VO")
|
||||
@Schema(description = "管理后台 - 岗位分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配")
|
||||
@Schema(description = "岗位编码,模糊匹配", example = "yudao")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 岗位信息 Response VO")
|
||||
@Schema(description = "管理后台 - 岗位信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostRespVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位序号", required = true, example = "1024")
|
||||
@Schema(description = "岗位序号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
@Schema(description = "创建时间", required = true, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 岗位精简信息 Response VO")
|
||||
@Schema(description = "管理后台 - 岗位精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PostSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编号", required = true, example = "1024")
|
||||
@Schema(description = "岗位编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", required = true, example = "芋道")
|
||||
@Schema(description = "岗位名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 岗位更新 Request VO")
|
||||
@Schema(description = "管理后台 - 岗位更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostUpdateReqVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编号", required = true, example = "1024")
|
||||
@Schema(description = "岗位编号", required = true, example = "1024")
|
||||
@NotNull(message = "岗位编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*;
|
||||
import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 字典数据")
|
||||
@Tag(name = "管理后台 - 字典数据")
|
||||
@RestController
|
||||
@RequestMapping("/system/dict-data")
|
||||
@Validated
|
||||
@@ -34,7 +34,7 @@ public class DictDataController {
|
||||
private DictDataService dictDataService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("新增字典数据")
|
||||
@Operation(summary = "新增字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:create')")
|
||||
public CommonResult<Long> createDictData(@Valid @RequestBody DictDataCreateReqVO reqVO) {
|
||||
Long dictDataId = dictDataService.createDictData(reqVO);
|
||||
@@ -42,7 +42,7 @@ public class DictDataController {
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("修改字典数据")
|
||||
@Operation(summary = "修改字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:update')")
|
||||
public CommonResult<Boolean> updateDictData(@Valid @RequestBody DictDataUpdateReqVO reqVO) {
|
||||
dictDataService.updateDictData(reqVO);
|
||||
@@ -50,8 +50,8 @@ public class DictDataController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除字典数据")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除字典数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:delete')")
|
||||
public CommonResult<Boolean> deleteDictData(Long id) {
|
||||
dictDataService.deleteDictData(id);
|
||||
@@ -59,7 +59,7 @@ public class DictDataController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地")
|
||||
@Operation(summary = "获得全部字典数据列表", description = "一般用于管理后台缓存字典数据在本地")
|
||||
// 无需添加权限认证,因为前端全局都需要
|
||||
public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() {
|
||||
List<DictDataDO> list = dictDataService.getDictDataList();
|
||||
@@ -67,22 +67,22 @@ public class DictDataController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("/获得字典类型的分页列表")
|
||||
@Operation(summary = "/获得字典类型的分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<PageResult<DictDataRespVO>> getDictTypePage(@Valid DictDataPageReqVO reqVO) {
|
||||
return success(DictDataConvert.INSTANCE.convertPage(dictDataService.getDictDataPage(reqVO)));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get")
|
||||
@ApiOperation("/查询字典数据详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "/查询字典数据详细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<DictDataRespVO> getDictData(@RequestParam("id") Long id) {
|
||||
return success(DictDataConvert.INSTANCE.convert(dictDataService.getDictData(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("导出字典数据")
|
||||
@Operation(summary = "导出字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException {
|
||||
@@ -92,4 +92,4 @@ public class DictDataController {
|
||||
ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.*;
|
||||
import cn.iocoder.yudao.module.system.convert.dict.DictTypeConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 字典类型")
|
||||
@Tag(name = "管理后台 - 字典类型")
|
||||
@RestController
|
||||
@RequestMapping("/system/dict-type")
|
||||
@Validated
|
||||
@@ -34,7 +34,7 @@ public class DictTypeController {
|
||||
private DictTypeService dictTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建字典类型")
|
||||
@Operation(summary = "创建字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:create')")
|
||||
public CommonResult<Long> createDictType(@Valid @RequestBody DictTypeCreateReqVO reqVO) {
|
||||
Long dictTypeId = dictTypeService.createDictType(reqVO);
|
||||
@@ -42,7 +42,7 @@ public class DictTypeController {
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改字典类型")
|
||||
@Operation(summary = "修改字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:update')")
|
||||
public CommonResult<Boolean> updateDictType(@Valid @RequestBody DictTypeUpdateReqVO reqVO) {
|
||||
dictTypeService.updateDictType(reqVO);
|
||||
@@ -50,23 +50,23 @@ public class DictTypeController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除字典类型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:delete')")
|
||||
public CommonResult<Boolean> deleteDictType(Long id) {
|
||||
dictTypeService.deleteDictType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("/获得字典类型的分页列表")
|
||||
@Operation(summary = "/获得字典类型的分页列表")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<PageResult<DictTypeRespVO>> pageDictTypes(@Valid DictTypePageReqVO reqVO) {
|
||||
return success(DictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO)));
|
||||
}
|
||||
|
||||
@ApiOperation("/查询字典类型详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "/查询字典类型详细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@GetMapping(value = "/get")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<DictTypeRespVO> getDictType(@RequestParam("id") Long id) {
|
||||
@@ -74,14 +74,14 @@ public class DictTypeController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项")
|
||||
@Operation(summary = "获得全部字典类型列表", description = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项")
|
||||
// 无需添加权限认证,因为前端全局都需要
|
||||
public CommonResult<List<DictTypeSimpleRespVO>> listSimpleDictTypes() {
|
||||
List<DictTypeDO> list = dictTypeService.getDictTypeList();
|
||||
return success(DictTypeConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据类型")
|
||||
@Operation(summary = "导出数据类型")
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
@OperateLog(type = EXPORT)
|
||||
@@ -92,4 +92,4 @@ public class DictTypeController {
|
||||
ExcelUtils.write(response, "字典类型.xls", "类型列表", DictTypeExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -16,36 +16,36 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class DictDataBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@Schema(description = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "字典标签", required = true, example = "芋道")
|
||||
@Schema(description = "字典标签", required = true, example = "芋道")
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "字典值", required = true, example = "iocoder")
|
||||
@Schema(description = "字典值", required = true, example = "iocoder")
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(max = 100, message = "字典键值长度不能超过100个字符")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@Schema(description = "字典类型", required = true, example = "sys_common_sex")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(max = 100, message = "字典类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@Schema(description = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
@Schema(description = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
private String colorType;
|
||||
@ApiModelProperty(value = "css 样式", example = "btn-visible")
|
||||
@Schema(description = "css 样式", example = "btn-visible")
|
||||
private String cssClass;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是一个角色")
|
||||
@Schema(description = "备注", example = "我是一个角色")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 字典数据创建 Request VO")
|
||||
@Schema(description = "管理后台 - 字典数据创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictDataCreateReqVO extends DictDataBaseVO {
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
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.Size;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型导出 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型导出 Request VO")
|
||||
@Data
|
||||
public class DictDataExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "字典标签", example = "芋道")
|
||||
@Schema(description = "字典标签", example = "芋道")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型分页列表 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictDataPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "字典标签", example = "芋道")
|
||||
@Schema(description = "字典标签", example = "芋道")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -9,17 +9,17 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 字典数据信息 Response VO")
|
||||
@Schema(description = "管理后台 - 字典数据信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictDataRespVO extends DictDataBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典数据编号", required = true, example = "1024")
|
||||
@Schema(description = "字典数据编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
@Schema(description = "创建时间", required = true, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
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("管理后台 - 数据字典精简 Response VO")
|
||||
@Schema(description = "管理后台 - 数据字典精简 Response VO")
|
||||
@Data
|
||||
public class DictDataSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "gender")
|
||||
@Schema(description = "字典类型", required = true, example = "gender")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "字典键值", required = true, example = "1")
|
||||
@Schema(description = "字典键值", required = true, example = "1")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "字典标签", required = true, example = "男")
|
||||
@Schema(description = "字典标签", required = true, example = "男")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
@Schema(description = "颜色类型,default、primary、success、info、warning、danger", example = "default" )
|
||||
private String colorType;
|
||||
@ApiModelProperty(value = "css 样式", example = "btn-visible")
|
||||
@Schema(description = "css 样式", example = "btn-visible")
|
||||
private String cssClass;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 字典数据更新 Request VO")
|
||||
@Schema(description = "管理后台 - 字典数据更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictDataUpdateReqVO extends DictDataBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典数据编号", required = true, example = "1024")
|
||||
@Schema(description = "字典数据编号", required = true, example = "1024")
|
||||
@NotNull(message = "字典数据编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -14,16 +14,16 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class DictTypeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典名称", required = true, example = "性别")
|
||||
@Schema(description = "字典名称", required = true, example = "性别")
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@Size(max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "快乐的备注")
|
||||
@Schema(description = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型创建 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictTypeCreateReqVO extends DictTypeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@Schema(description = "字典类型", required = true, example = "sys_common_sex")
|
||||
@NotNull(message = "字典类型不能为空")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,21 +9,21 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型分页列表 Request VO")
|
||||
@Data
|
||||
public class DictTypeExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -12,23 +12,23 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型分页列表 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictTypePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Schema(description = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(description = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -9,20 +9,20 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型信息 Response VO")
|
||||
@Schema(description = "管理后台 - 字典类型信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictTypeRespVO extends DictTypeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型编号", required = true, example = "1024")
|
||||
@Schema(description = "字典类型编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@Schema(description = "字典类型", required = true, example = "sys_common_sex")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
@Schema(description = "创建时间", required = true, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型精简信息 Response VO")
|
||||
@Schema(description = "管理后台 - 字典类型精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DictTypeSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型编号", required = true, example = "1024")
|
||||
@Schema(description = "字典类型编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "字典类型名称", required = true, example = "芋道")
|
||||
@Schema(description = "字典类型名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@Schema(description = "字典类型", required = true, example = "sys_common_sex")
|
||||
private String type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型更新 Request VO")
|
||||
@Schema(description = "管理后台 - 字典类型更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictTypeUpdateReqVO extends DictTypeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型编号", required = true, example = "1024")
|
||||
@Schema(description = "字典类型编号", required = true, example = "1024")
|
||||
@NotNull(message = "字典类型编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO;
|
||||
import cn.iocoder.yudao.module.system.service.errorcode.ErrorCodeService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 错误码")
|
||||
@Tag(name = "管理后台 - 错误码")
|
||||
@RestController
|
||||
@RequestMapping("/system/error-code")
|
||||
@Validated
|
||||
@@ -34,14 +34,14 @@ public class ErrorCodeController {
|
||||
private ErrorCodeService errorCodeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建错误码")
|
||||
@Operation(summary = "创建错误码")
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:create')")
|
||||
public CommonResult<Long> createErrorCode(@Valid @RequestBody ErrorCodeCreateReqVO createReqVO) {
|
||||
return success(errorCodeService.createErrorCode(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新错误码")
|
||||
@Operation(summary = "更新错误码")
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:update')")
|
||||
public CommonResult<Boolean> updateErrorCode(@Valid @RequestBody ErrorCodeUpdateReqVO updateReqVO) {
|
||||
errorCodeService.updateErrorCode(updateReqVO);
|
||||
@@ -49,8 +49,8 @@ public class ErrorCodeController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除错误码")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除错误码")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:delete')")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("id") Long id) {
|
||||
errorCodeService.deleteErrorCode(id);
|
||||
@@ -58,8 +58,8 @@ public class ErrorCodeController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得错误码")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得错误码")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:query')")
|
||||
public CommonResult<ErrorCodeRespVO> getErrorCode(@RequestParam("id") Long id) {
|
||||
ErrorCodeDO errorCode = errorCodeService.getErrorCode(id);
|
||||
@@ -67,7 +67,7 @@ public class ErrorCodeController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得错误码分页")
|
||||
@Operation(summary = "获得错误码分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:query')")
|
||||
public CommonResult<PageResult<ErrorCodeRespVO>> getErrorCodePage(@Valid ErrorCodePageReqVO pageVO) {
|
||||
PageResult<ErrorCodeDO> pageResult = errorCodeService.getErrorCodePage(pageVO);
|
||||
@@ -75,7 +75,7 @@ public class ErrorCodeController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出错误码 Excel")
|
||||
@Operation(summary = "导出错误码 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:error-code:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportErrorCodeExcel(@Valid ErrorCodeExportReqVO exportReqVO,
|
||||
@@ -86,4 +86,4 @@ public class ErrorCodeController {
|
||||
ExcelUtils.write(response, "错误码.xls", "数据", ErrorCodeExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,19 +12,19 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ErrorCodeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "dashboard")
|
||||
@Schema(description = "应用名", required = true, example = "dashboard")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "错误码编码", required = true, example = "1234")
|
||||
@Schema(description = "错误码编码", required = true, example = "1234")
|
||||
@NotNull(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty(value = "错误码错误提示", required = true, example = "帅气")
|
||||
@Schema(description = "错误码错误提示", required = true, example = "帅气")
|
||||
@NotNull(message = "错误码错误提示不能为空")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "哈哈哈")
|
||||
@Schema(description = "备注", example = "哈哈哈")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 错误码创建 Request VO")
|
||||
@Schema(description = "管理后台 - 错误码创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,24 +9,24 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 错误码 Excel 导出 Request VO", description = "参数和 InfErrorCodePageReqVO 是一致的")
|
||||
@Schema(description = "管理后台 - 错误码 Excel 导出 Request VO,参数和 InfErrorCodePageReqVO 是一致的")
|
||||
@Data
|
||||
public class ErrorCodeExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "错误码类型", example = "1")
|
||||
@Schema(description = "错误码类型", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(description = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "错误码编码", example = "1234")
|
||||
@Schema(description = "错误码编码", example = "1234")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty(value = "错误码错误提示", example = "帅气")
|
||||
@Schema(description = "错误码错误提示", example = "帅气")
|
||||
private String message;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,26 +12,26 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 错误码分页 Request VO")
|
||||
@Schema(description = "管理后台 - 错误码分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErrorCodePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类")
|
||||
@Schema(description = "错误码类型,参见 ErrorCodeTypeEnum 枚举类", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(description = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "错误码编码", example = "1234")
|
||||
@Schema(description = "错误码编码", example = "1234")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty(value = "错误码错误提示", example = "帅气")
|
||||
@Schema(description = "错误码错误提示", example = "帅气")
|
||||
private String message;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 错误码 Response VO")
|
||||
@Schema(description = "管理后台 - 错误码 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErrorCodeRespVO extends ErrorCodeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "错误码编号", required = true, example = "1024")
|
||||
@Schema(description = "错误码编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类")
|
||||
@Schema(description = "错误码类型,参见 ErrorCodeTypeEnum 枚举类", required = true, example = "1")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 错误码更新 Request VO")
|
||||
@Schema(description = "管理后台 - 错误码更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErrorCodeUpdateReqVO extends ErrorCodeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "错误码编号", required = true, example = "1024")
|
||||
@Schema(description = "错误码编号", required = true, example = "1024")
|
||||
@NotNull(message = "错误码编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.IPUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO;
|
||||
import cn.iocoder.yudao.module.system.convert.ip.AreaConvert;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -20,14 +20,14 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 地区")
|
||||
@Tag(name = "管理后台 - 地区")
|
||||
@RestController
|
||||
@RequestMapping("/system/area")
|
||||
@Validated
|
||||
public class AreaController {
|
||||
|
||||
@GetMapping("/tree")
|
||||
@ApiOperation("获得地区树")
|
||||
@Operation(summary = "获得地区树")
|
||||
public CommonResult<List<AreaNodeRespVO>> getAreaTree() {
|
||||
Area area = AreaUtils.getArea(Area.ID_CHINA);
|
||||
Assert.notNull(area, "获取不到中国");
|
||||
@@ -35,8 +35,8 @@ public class AreaController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-by-ip")
|
||||
@ApiOperation("获得 IP 对应的地区名")
|
||||
@ApiImplicitParam(name = "ip", value = "IP", required = true, dataTypeClass = String.class)
|
||||
@Operation(summary = "获得 IP 对应的地区名")
|
||||
@Parameter(name = "ip", description = "IP", required = true)
|
||||
public CommonResult<String> getAreaByIp(@RequestParam("ip") String ip) {
|
||||
// 获得城市
|
||||
Area area = IPUtils.getArea(ip);
|
||||
@@ -47,4 +47,4 @@ public class AreaController {
|
||||
return success(AreaUtils.format(area.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ip.vo;
|
||||
|
||||
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.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 地区节点 Response VO")
|
||||
@Schema(description = "管理后台 - 地区节点 Response VO")
|
||||
@Data
|
||||
public class AreaNodeRespVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "110000")
|
||||
@Schema(description = "编号", required = true, example = "110000")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "名字", required = true, example = "北京")
|
||||
@Schema(description = "名字", required = true, example = "北京")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@@ -21,4 +21,4 @@ public class AreaNodeRespVO {
|
||||
*/
|
||||
private List<AreaNodeRespVO> children;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginL
|
||||
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogRespVO;
|
||||
import cn.iocoder.yudao.module.system.convert.logger.LoginLogConvert;
|
||||
import cn.iocoder.yudao.module.system.service.logger.LoginLogService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -27,7 +27,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 登录日志")
|
||||
@Tag(name = "管理后台 - 登录日志")
|
||||
@RestController
|
||||
@RequestMapping("/system/login-log")
|
||||
@Validated
|
||||
@@ -37,7 +37,7 @@ public class LoginLogController {
|
||||
private LoginLogService loginLogService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得登录日志分页列表")
|
||||
@Operation(summary = "获得登录日志分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:login-log:query')")
|
||||
public CommonResult<PageResult<LoginLogRespVO>> getLoginLogPage(@Valid LoginLogPageReqVO reqVO) {
|
||||
PageResult<LoginLogDO> page = loginLogService.getLoginLogPage(reqVO);
|
||||
@@ -45,7 +45,7 @@ public class LoginLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("导出登录日志 Excel")
|
||||
@Operation(summary = "导出登录日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:login-log:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportLoginLog(HttpServletResponse response, @Valid LoginLogExportReqVO reqVO) throws IOException {
|
||||
@@ -56,4 +56,4 @@ public class LoginLogController {
|
||||
ExcelUtils.write(response, "登录日志.xls", "数据列表", LoginLogExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -35,7 +35,7 @@ import java.util.Map;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 操作日志")
|
||||
@Tag(name = "管理后台 - 操作日志")
|
||||
@RestController
|
||||
@RequestMapping("/system/operate-log")
|
||||
@Validated
|
||||
@@ -47,7 +47,7 @@ public class OperateLogController {
|
||||
private AdminUserService userService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("查看操作日志分页列表")
|
||||
@Operation(summary = "查看操作日志分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:operate-log:query')")
|
||||
public CommonResult<PageResult<OperateLogRespVO>> pageOperateLog(@Valid OperateLogPageReqVO reqVO) {
|
||||
PageResult<OperateLogDO> pageResult = operateLogService.getOperateLogPage(reqVO);
|
||||
@@ -66,7 +66,7 @@ public class OperateLogController {
|
||||
return success(new PageResult<>(list, pageResult.getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出操作日志")
|
||||
@Operation(summary = "导出操作日志")
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermission('system:operate-log:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
@@ -82,4 +82,4 @@ public class OperateLogController {
|
||||
ExcelUtils.write(response, "操作日志.xls", "数据列表", OperateLogExcelVO.class, excelDataList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -15,28 +15,28 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class LoginLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 LoginLogTypeEnum 枚举类")
|
||||
@Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", required = true, example = "1" )
|
||||
@NotNull(message = "日志类型不能为空")
|
||||
private Integer logType;
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@NotEmpty(message = "链路追踪编号不能为空")
|
||||
private String traceId;
|
||||
|
||||
@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 = "登录结果,参见 LoginLogTypeEnum 枚举类", 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", example = "Mozilla/5.0")
|
||||
@Schema(description = "浏览器 UserAgent", example = "Mozilla/5.0")
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog;
|
||||
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,21 +9,21 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 登录日志分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 登录日志分页列表 Request VO")
|
||||
@Data
|
||||
public class LoginLogExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配")
|
||||
@Schema(description = "用户 IP,模拟匹配", example = "127.0.0.1" )
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配")
|
||||
@Schema(description = "用户账号,模拟匹配", example = "芋道" )
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "操作状态", example = "true")
|
||||
@Schema(description = "操作状态", example = "true")
|
||||
private Boolean status;
|
||||
|
||||
@ApiModelProperty(value = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(description = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -11,22 +11,22 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 登录日志分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 登录日志分页列表 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LoginLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配")
|
||||
@Schema(description = "用户 IP,模拟匹配", example = "127.0.0.1" )
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配")
|
||||
@Schema(description = "用户账号,模拟匹配", example = "芋道" )
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "操作状态", example = "true")
|
||||
@Schema(description = "操作状态", example = "true")
|
||||
private Boolean status;
|
||||
|
||||
@ApiModelProperty(value = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(description = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,23 +9,23 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 登录日志 Response VO")
|
||||
@Schema(description = "管理后台 - 登录日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class LoginLogRespVO extends LoginLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "日志编号", required = true, example = "1024")
|
||||
@Schema(description = "日志编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@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)
|
||||
@Schema(description = "登录时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -15,71 +15,71 @@ import java.util.Map;
|
||||
@Data
|
||||
public class OperateLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@Schema(description = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
@NotEmpty(message = "链路追踪编号不能为空")
|
||||
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 = "订单")
|
||||
@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 = "参见 OperateLogTypeEnum 枚举类")
|
||||
@Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", 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.adminserver.UserController.save(...)")
|
||||
@Schema(description = "Java 方法名", required = true, example = "cn.iocoder.yudao.adminserver.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;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog;
|
||||
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,24 +9,24 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 操作日志分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 操作日志分页列表 Request VO")
|
||||
@Data
|
||||
public class OperateLogExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配")
|
||||
@Schema(description = "操作模块,模拟匹配", example = "订单" )
|
||||
private String module;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配")
|
||||
@Schema(description = "用户昵称,模拟匹配", example = "芋道" )
|
||||
private String userNickname;
|
||||
|
||||
@ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类")
|
||||
@Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1" )
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "操作状态", example = "true")
|
||||
@Schema(description = "操作状态", example = "true")
|
||||
private Boolean success;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(description = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -10,24 +10,24 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 操作日志分页列表 Request VO")
|
||||
@Schema(description = "管理后台 - 操作日志分页列表 Request VO")
|
||||
@Data
|
||||
public class OperateLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配")
|
||||
@Schema(description = "操作模块,模拟匹配", example = "订单")
|
||||
private String module;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配")
|
||||
@Schema(description = "用户昵称,模拟匹配", example = "芋道")
|
||||
private String userNickname;
|
||||
|
||||
@ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类")
|
||||
@Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "操作状态", example = "true")
|
||||
@Schema(description = "操作状态", example = "true")
|
||||
private Boolean success;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(description = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 操作日志 Response VO")
|
||||
@Schema(description = "管理后台 - 操作日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OperateLogRespVO extends OperateLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "日志编号", required = true, example = "1024")
|
||||
@Schema(description = "日志编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", required = true, example = "芋艿")
|
||||
@Schema(description = "用户昵称", required = true, example = "芋艿")
|
||||
private String userNickname;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.*;
|
||||
import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO;
|
||||
import cn.iocoder.yudao.module.system.service.mail.MailAccountService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 邮箱账号")
|
||||
@Tag(name = "管理后台 - 邮箱账号")
|
||||
@RestController
|
||||
@RequestMapping("/system/mail-account")
|
||||
public class MailAccountController {
|
||||
@@ -28,14 +28,14 @@ public class MailAccountController {
|
||||
private MailAccountService mailAccountService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建邮箱账号")
|
||||
@Operation(summary = "创建邮箱账号")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-account:create')")
|
||||
public CommonResult<Long> createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) {
|
||||
return success(mailAccountService.createMailAccount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改邮箱账号")
|
||||
@Operation(summary = "修改邮箱账号")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-account:update')")
|
||||
public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) {
|
||||
mailAccountService.updateMailAccount(updateReqVO);
|
||||
@@ -43,8 +43,8 @@ public class MailAccountController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除邮箱账号")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除邮箱账号")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-account:delete')")
|
||||
public CommonResult<Boolean> deleteMailAccount(@RequestParam Long id) {
|
||||
mailAccountService.deleteMailAccount(id);
|
||||
@@ -52,8 +52,8 @@ public class MailAccountController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得邮箱账号")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得邮箱账号")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-account:get')")
|
||||
public CommonResult<MailAccountRespVO> getMailAccount(@RequestParam("id") Long id) {
|
||||
MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id);
|
||||
@@ -61,7 +61,7 @@ public class MailAccountController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得邮箱账号分页")
|
||||
@Operation(summary = "获得邮箱账号分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-account:query')")
|
||||
public CommonResult<PageResult<MailAccountBaseVO>> getMailAccountPage(@Valid MailAccountPageReqVO pageReqVO) {
|
||||
PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(pageReqVO);
|
||||
@@ -69,10 +69,10 @@ public class MailAccountController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得邮箱账号精简列表")
|
||||
@Operation(summary = "获得邮箱账号精简列表")
|
||||
public CommonResult<List<MailAccountSimpleRespVO>> getSimpleMailAccountList() {
|
||||
List<MailAccountDO> list = mailAccountService.getMailAccountList();
|
||||
return success(MailAccountConvert.INSTANCE.convertList02(list));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO
|
||||
import cn.iocoder.yudao.module.system.convert.mail.MailLogConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO;
|
||||
import cn.iocoder.yudao.module.system.service.mail.MailLogService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -23,7 +23,7 @@ import javax.validation.Valid;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
|
||||
@Api(tags = "管理后台 - 邮件日志")
|
||||
@Tag(name = "管理后台 - 邮件日志")
|
||||
@RestController
|
||||
@RequestMapping("/system/mail-log")
|
||||
public class MailLogController {
|
||||
@@ -32,7 +32,7 @@ public class MailLogController {
|
||||
private MailLogService mailLogService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得邮箱日志分页")
|
||||
@Operation(summary = "获得邮箱日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-log:query')")
|
||||
public CommonResult<PageResult<MailLogRespVO>> getMailLogPage(@Valid MailLogPageReqVO pageVO) {
|
||||
PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(pageVO);
|
||||
@@ -40,12 +40,12 @@ public class MailLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得邮箱日志")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得邮箱日志")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-log:query')")
|
||||
public CommonResult<MailLogRespVO> getMailTemplate(@RequestParam("id") Long id) {
|
||||
MailLogDO mailLogDO = mailLogService.getMailLog(id);
|
||||
return success(MailLogConvert.INSTANCE.convert(mailLogDO));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
|
||||
import cn.iocoder.yudao.module.system.service.mail.MailSendService;
|
||||
import cn.iocoder.yudao.module.system.service.mail.MailTemplateService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 邮件模版")
|
||||
@Tag(name = "管理后台 - 邮件模版")
|
||||
@RestController
|
||||
@RequestMapping("/system/mail-template")
|
||||
public class MailTemplateController {
|
||||
@@ -30,14 +30,14 @@ public class MailTemplateController {
|
||||
private MailSendService mailSendService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建邮件模版")
|
||||
@Operation(summary = "创建邮件模版")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:create')")
|
||||
public CommonResult<Long> createMailTemplate(@Valid @RequestBody MailTemplateCreateReqVO createReqVO){
|
||||
return success(mailTempleService.createMailTemplate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改邮件模版")
|
||||
@Operation(summary = "修改邮件模版")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:update')")
|
||||
public CommonResult<Boolean> updateMailTemplate(@Valid @RequestBody MailTemplateUpdateReqVO updateReqVO){
|
||||
mailTempleService.updateMailTemplate(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class MailTemplateController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除邮件模版")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除邮件模版")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:delete')")
|
||||
public CommonResult<Boolean> deleteMailTemplate(@RequestParam("id") Long id) {
|
||||
mailTempleService.deleteMailTemplate(id);
|
||||
@@ -54,8 +54,8 @@ public class MailTemplateController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得邮件模版")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得邮件模版")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:get')")
|
||||
public CommonResult<MailTemplateRespVO> getMailTemplate(@RequestParam("id") Long id) {
|
||||
MailTemplateDO mailTemplateDO = mailTempleService.getMailTemplate(id);
|
||||
@@ -63,7 +63,7 @@ public class MailTemplateController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得邮件模版分页")
|
||||
@Operation(summary = "获得邮件模版分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:query')")
|
||||
public CommonResult<PageResult<MailTemplateRespVO>> getMailTemplatePage(@Valid MailTemplatePageReqVO pageReqVO) {
|
||||
PageResult<MailTemplateDO> pageResult = mailTempleService.getMailTemplatePage(pageReqVO);
|
||||
@@ -71,18 +71,18 @@ public class MailTemplateController {
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得邮件模版精简列表")
|
||||
@Operation(summary = "获得邮件模版精简列表")
|
||||
public CommonResult<List<MailTemplateSimpleRespVO>> getSimpleTemplateList() {
|
||||
List<MailTemplateDO> list = mailTempleService.getMailTemplateList();
|
||||
return success(MailTemplateConvert.INSTANCE.convertList02(list));
|
||||
}
|
||||
|
||||
@PostMapping("/send-mail")
|
||||
@ApiOperation("发送短信")
|
||||
@Operation(summary = "发送短信")
|
||||
@PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')")
|
||||
public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) {
|
||||
return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null,
|
||||
sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
@@ -13,29 +13,29 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class MailAccountBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com")
|
||||
@Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com")
|
||||
@NotNull(message = "邮箱不能为空")
|
||||
@Email(message = "必须是 Email 格式")
|
||||
private String mail;
|
||||
|
||||
@ApiModelProperty(value = "用户名", required = true, example = "yudao")
|
||||
@Schema(description = "用户名", required = true, example = "yudao")
|
||||
@NotNull(message = "用户名不能为空")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "123456")
|
||||
@Schema(description = "密码", required = true, example = "123456")
|
||||
@NotNull(message = "密码必填")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "SMTP 服务器域名", required = true, example = "www.iocoder.cn")
|
||||
@Schema(description = "SMTP 服务器域名", required = true, example = "www.iocoder.cn")
|
||||
@NotNull(message = "SMTP 服务器域名不能为空")
|
||||
private String host;
|
||||
|
||||
@ApiModelProperty(value = "SMTP 服务器端口", required = true, example = "80")
|
||||
@Schema(description = "SMTP 服务器端口", required = true, example = "80")
|
||||
@NotNull(message = "SMTP 服务器端口不能为空")
|
||||
private Integer port;
|
||||
|
||||
@ApiModelProperty(value = "是否开启 ssl", required = true, example = "true")
|
||||
@Schema(description = "是否开启 ssl", required = true, example = "true")
|
||||
@NotNull(message = "是否开启 ssl 必填")
|
||||
private Boolean sslEnable;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,22 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 邮箱账号分页 Request VO")
|
||||
@Schema(description = "管理后台 - 邮箱账号分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MailAccountPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com")
|
||||
@Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com")
|
||||
private String mail;
|
||||
|
||||
@ApiModelProperty(value = "用户名" , required = true , example = "yudao")
|
||||
@Schema(description = "用户名" , required = true , example = "yudao")
|
||||
private String username;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,17 +9,17 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 邮箱账号 Response VO")
|
||||
@Schema(description = "管理后台 - 邮箱账号 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MailAccountRespVO extends MailAccountBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
@Schema(description = "编号", required = true, example = "1024")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
|
||||
|
||||
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("管理后台 - 邮箱账号的精简 Response VO")
|
||||
@Schema(description = "管理后台 - 邮箱账号的精简 Response VO")
|
||||
@Data
|
||||
public class MailAccountSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "邮箱编号", required = true, example = "1024")
|
||||
@Schema(description = "邮箱编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", required = true, example = "768541388@qq.com")
|
||||
@Schema(description = "邮箱", required = true, example = "768541388@qq.com")
|
||||
private String mail;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 邮箱账号修改 Request VO")
|
||||
@Schema(description = "管理后台 - 邮箱账号修改 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MailAccountUpdateReqVO extends MailAccountBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
@Schema(description = "编号", required = true, example = "1024")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -17,59 +17,59 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class MailLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "30883")
|
||||
@Schema(description = "用户编号", example = "30883")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
private Byte userType;
|
||||
|
||||
@ApiModelProperty(value = "接收邮箱地址", required = true, example = "76854@qq.com")
|
||||
@Schema(description = "接收邮箱地址", required = true, example = "76854@qq.com")
|
||||
@NotNull(message = "接收邮箱地址不能为空")
|
||||
private String toMail;
|
||||
|
||||
@ApiModelProperty(value = "邮箱账号编号", required = true, example = "18107")
|
||||
@Schema(description = "邮箱账号编号", required = true, example = "18107")
|
||||
@NotNull(message = "邮箱账号编号不能为空")
|
||||
private Long accountId;
|
||||
|
||||
@ApiModelProperty(value = "发送邮箱地址", required = true, example = "85757@qq.com")
|
||||
@Schema(description = "发送邮箱地址", required = true, example = "85757@qq.com")
|
||||
@NotNull(message = "发送邮箱地址不能为空")
|
||||
private String fromMail;
|
||||
|
||||
@ApiModelProperty(value = "模板编号", required = true, example = "5678")
|
||||
@Schema(description = "模板编号", required = true, example = "5678")
|
||||
@NotNull(message = "模板编号不能为空")
|
||||
private Long templateId;
|
||||
|
||||
@ApiModelProperty(value = "模板编码", required = true, example = "test_01")
|
||||
@Schema(description = "模板编码", required = true, example = "test_01")
|
||||
@NotNull(message = "模板编码不能为空")
|
||||
private String templateCode;
|
||||
|
||||
@ApiModelProperty(value = "模版发送人名称", example = "李四")
|
||||
@Schema(description = "模版发送人名称", example = "李四")
|
||||
private String templateNickname;
|
||||
|
||||
@ApiModelProperty(value = "邮件标题", required = true, example = "测试标题")
|
||||
@Schema(description = "邮件标题", required = true, example = "测试标题")
|
||||
@NotNull(message = "邮件标题不能为空")
|
||||
private String templateTitle;
|
||||
|
||||
@ApiModelProperty(value = "邮件内容", required = true, example = "测试内容")
|
||||
@Schema(description = "邮件内容", required = true, example = "测试内容")
|
||||
@NotNull(message = "邮件内容不能为空")
|
||||
private String templateContent;
|
||||
|
||||
@ApiModelProperty(value = "邮件参数", required = true)
|
||||
@Schema(description = "邮件参数", required = true)
|
||||
@NotNull(message = "邮件参数不能为空")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
@ApiModelProperty(value = "发送状态", required = true, example = "1", notes = "参见 MailSendStatusEnum 枚举")
|
||||
@Schema(description = "发送状态", required = true, example = "1", notes = "参见 MailSendStatusEnum 枚举")
|
||||
@NotNull(message = "发送状态不能为空")
|
||||
private Byte sendStatus;
|
||||
|
||||
@ApiModelProperty(value = "发送时间")
|
||||
@Schema(description = "发送时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@ApiModelProperty(value = "发送返回的消息 ID", example = "28568")
|
||||
@Schema(description = "发送返回的消息 ID", example = "28568")
|
||||
private String sendMessageId;
|
||||
|
||||
@ApiModelProperty(value = "发送异常")
|
||||
@Schema(description = "发送异常")
|
||||
private String sendException;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,32 +12,32 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 邮箱日志分页 Request VO")
|
||||
@Schema(description = "管理后台 - 邮箱日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MailLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "30883")
|
||||
@Schema(description = "用户编号", example = "30883")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(description = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "接收邮箱地址", example = "76854@qq.com", notes = "模糊匹配")
|
||||
@Schema(description = "接收邮箱地址", example = "76854@qq.com", notes = "模糊匹配")
|
||||
private String toMail;
|
||||
|
||||
@ApiModelProperty(value = "邮箱账号编号", example = "18107")
|
||||
@Schema(description = "邮箱账号编号", example = "18107")
|
||||
private Long accountId;
|
||||
|
||||
@ApiModelProperty(value = "模板编号", example = "5678")
|
||||
@Schema(description = "模板编号", example = "5678")
|
||||
private Long templateId;
|
||||
|
||||
@ApiModelProperty(value = "发送状态", example = "1", notes = "参见 MailSendStatusEnum 枚举")
|
||||
@Schema(description = "发送状态", example = "1", notes = "参见 MailSendStatusEnum 枚举")
|
||||
private Integer sendStatus;
|
||||
|
||||
@ApiModelProperty(value = "发送时间")
|
||||
@Schema(description = "发送时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sendTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 邮件日志 Response VO")
|
||||
@Schema(description = "管理后台 - 邮件日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MailLogRespVO extends MailLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "31020")
|
||||
@Schema(description = "编号", required = true, example = "31020")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user