feat: 修改部分 swagger 注解
This commit is contained in:
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.file;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.file.dto.FileCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.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;
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 文件")
|
||||
@Tag(name = "RPC 服务 - 文件")
|
||||
public interface FileApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/file";
|
||||
@@ -54,7 +54,7 @@ public interface FileApi {
|
||||
}
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("保存文件,并返回文件的访问路径")
|
||||
@Operation(summary = "保存文件,并返回文件的访问路径")
|
||||
CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
package cn.iocoder.yudao.module.infra.api.file.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;
|
||||
|
||||
@ApiModel("RPC 服务 - 文件创建 Request DTO")
|
||||
@Schema(description = "RPC 服务 - 文件创建 Request DTO")
|
||||
@Data
|
||||
public class FileCreateReqDTO {
|
||||
|
||||
@ApiModelProperty(value = "原文件名称", example = "xxx.png")
|
||||
@Schema(description = "原文件名称", example = "xxx.png")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "文件路径", example = "xxx.png")
|
||||
@Schema(description = "文件路径", example = "xxx.png")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "文件内容", required = true)
|
||||
@Schema(description = "文件内容", required = true)
|
||||
@NotEmpty(message = "文件内容不能为空")
|
||||
private byte[] content;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.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 服务 - API 访问日志")
|
||||
@Tag(name = "RPC 服务 - API 访问日志")
|
||||
public interface ApiAccessLogApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/api-access-log";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("创建 API 访问日志")
|
||||
@Operation(summary = "创建 API 访问日志")
|
||||
CommonResult<Boolean> createApiAccessLog(@Valid @RequestBody ApiAccessLogCreateReqDTO createDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.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 服务 - API 异常日志")
|
||||
@Tag(name = "RPC 服务 - API 异常日志")
|
||||
public interface ApiErrorLogApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/api-error-log";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@ApiOperation("创建 API 异常日志")
|
||||
@Operation(summary = "创建 API 异常日志")
|
||||
CommonResult<Boolean> createApiErrorLog(@Valid @RequestBody ApiErrorLogCreateReqDTO createDTO);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,56 +1,56 @@
|
||||
package cn.iocoder.yudao.module.infra.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.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("RPC 服务 - API 访问日志创建 Request DTO")
|
||||
@Schema(description = "RPC 服务 - API 访问日志创建 Request DTO")
|
||||
@Data
|
||||
public class ApiAccessLogCreateReqDTO {
|
||||
|
||||
@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")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1")
|
||||
@Schema(description = "用户类型", required = true, example = "1")
|
||||
private Integer userType;
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "system-server")
|
||||
@Schema(description = "应用名", required = true, example = "system-server")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求方法名", required = true, example = "GET")
|
||||
@Schema(description = "请求方法名", required = true, example = "GET")
|
||||
@NotNull(message = "http 请求方法不能为空")
|
||||
private String requestMethod;
|
||||
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@Schema(description = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@NotNull(message = "访问地址不能为空")
|
||||
private String requestUrl;
|
||||
@ApiModelProperty(value = "请求参数", required = true)
|
||||
@Schema(description = "请求参数", required = true)
|
||||
@NotNull(message = "请求参数不能为空")
|
||||
private String requestParams;
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(description = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotNull(message = "ip 不能为空")
|
||||
private String userIp;
|
||||
@ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@NotNull(message = "User-Agent 不能为空")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
@Schema(description = "开始时间", required = true)
|
||||
@NotNull(message = "开始请求时间不能为空")
|
||||
private LocalDateTime beginTime;
|
||||
@ApiModelProperty(value = "结束时间", required = true)
|
||||
@Schema(description = "结束时间", required = true)
|
||||
@NotNull(message = "结束请求时间不能为空")
|
||||
private LocalDateTime endTime;
|
||||
@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;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,69 +1,69 @@
|
||||
package cn.iocoder.yudao.module.infra.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.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("RPC 服务 - API 错误日志创建 Request DTO")
|
||||
@Schema(description = "RPC 服务 - API 错误日志创建 Request DTO")
|
||||
@Data
|
||||
public class ApiErrorLogCreateReqDTO {
|
||||
|
||||
@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")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1")
|
||||
@Schema(description = "用户类型", required = true, example = "1")
|
||||
private Integer userType;
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "system-server")
|
||||
@Schema(description = "应用名", required = true, example = "system-server")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求方法名", required = true, example = "GET")
|
||||
@Schema(description = "请求方法名", required = true, example = "GET")
|
||||
@NotNull(message = "http 请求方法不能为空")
|
||||
private String requestMethod;
|
||||
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@Schema(description = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@NotNull(message = "访问地址不能为空")
|
||||
private String requestUrl;
|
||||
@ApiModelProperty(value = "请求参数", required = true)
|
||||
@Schema(description = "请求参数", required = true)
|
||||
@NotNull(message = "请求参数不能为空")
|
||||
private String requestParams;
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(description = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotNull(message = "ip 不能为空")
|
||||
private String userIp;
|
||||
@ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0")
|
||||
@NotNull(message = "User-Agent 不能为空")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "异常时间", required = true)
|
||||
@Schema(description = "异常时间", required = true)
|
||||
@NotNull(message = "异常时间不能为空")
|
||||
private LocalDateTime exceptionTime;
|
||||
@ApiModelProperty(value = "异常名", required = true)
|
||||
@Schema(description = "异常名", required = true)
|
||||
@NotNull(message = "异常名不能为空")
|
||||
private String exceptionName;
|
||||
@ApiModelProperty(value = "异常发生的类全名", required = true)
|
||||
@Schema(description = "异常发生的类全名", required = true)
|
||||
@NotNull(message = "异常发生的类全名不能为空")
|
||||
private String exceptionClassName;
|
||||
@ApiModelProperty(value = "异常发生的类文件", required = true)
|
||||
@Schema(description = "异常发生的类文件", required = true)
|
||||
@NotNull(message = "异常发生的类文件不能为空")
|
||||
private String exceptionFileName;
|
||||
@ApiModelProperty(value = "异常发生的方法名", required = true)
|
||||
@Schema(description = "异常发生的方法名", required = true)
|
||||
@NotNull(message = "异常发生的方法名不能为空")
|
||||
private String exceptionMethodName;
|
||||
@ApiModelProperty(value = "异常发生的方法所在行", required = true)
|
||||
@Schema(description = "异常发生的方法所在行", required = true)
|
||||
@NotNull(message = "异常发生的方法所在行不能为空")
|
||||
private Integer exceptionLineNumber;
|
||||
@ApiModelProperty(value = "异常的栈轨迹异常的栈轨迹", required = true)
|
||||
@Schema(description = "异常的栈轨迹异常的栈轨迹", required = true)
|
||||
@NotNull(message = "异常的栈轨迹不能为空")
|
||||
private String exceptionStackTrace;
|
||||
@ApiModelProperty(value = "异常导致的根消息", required = true)
|
||||
@Schema(description = "异常导致的根消息", required = true)
|
||||
@NotNull(message = "异常导致的根消息不能为空")
|
||||
private String exceptionRootCauseMessage;
|
||||
@ApiModelProperty(value = "异常导致的消息", required = true)
|
||||
@Schema(description = "异常导致的消息", required = true)
|
||||
@NotNull(message = "异常导致的消息不能为空")
|
||||
private String exceptionMessage;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user