mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-10 15:11:54 +08:00
refactor: springdoc 替换 springfox
This commit is contained in:
@@ -16,10 +16,10 @@ import cn.iocoder.yudao.module.infra.convert.codegen.CodegenConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
|
||||
import cn.iocoder.yudao.module.infra.service.codegen.CodegenService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,7 +36,7 @@ import java.util.Map;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Api(tags = "管理后台 - 代码生成器")
|
||||
@Tag(name = "管理后台 - 代码生成器")
|
||||
@RestController
|
||||
@RequestMapping("/infra/codegen")
|
||||
@Validated
|
||||
@@ -46,11 +46,11 @@ public class CodegenController {
|
||||
private CodegenService codegenService;
|
||||
|
||||
@GetMapping("/db/table/list")
|
||||
@ApiOperation(value = "获得数据库自带的表定义列表", notes = "会过滤掉已经导入 Codegen 的表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dataSourceConfigId", value = "数据源配置的编号", required = true, example = "1", dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "name", value = "表名,模糊匹配", example = "yudao", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "comment", value = "描述,模糊匹配", example = "芋道", dataTypeClass = String.class)
|
||||
@Operation(summary = "获得数据库自带的表定义列表", description = "会过滤掉已经导入 Codegen 的表")
|
||||
@Parameters({
|
||||
@Parameter(name = "dataSourceConfigId", description = "数据源配置的编号", required = true, example = "1"),
|
||||
@Parameter(name = "name", description = "表名,模糊匹配", example = "yudao"),
|
||||
@Parameter(name = "comment", description = "描述,模糊匹配", example = "芋道")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:query')")
|
||||
public CommonResult<List<DatabaseTableRespVO>> getDatabaseTableList(
|
||||
@@ -61,7 +61,7 @@ public class CodegenController {
|
||||
}
|
||||
|
||||
@GetMapping("/table/page")
|
||||
@ApiOperation("获得表定义分页")
|
||||
@Operation(summary = "获得表定义分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:query')")
|
||||
public CommonResult<PageResult<CodegenTableRespVO>> getCodeGenTablePage(@Valid CodegenTablePageReqVO pageReqVO) {
|
||||
PageResult<CodegenTableDO> pageResult = codegenService.getCodegenTablePage(pageReqVO);
|
||||
@@ -69,8 +69,8 @@ public class CodegenController {
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
@ApiOperation("获得表和字段的明细")
|
||||
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得表和字段的明细")
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:query')")
|
||||
public CommonResult<CodegenDetailRespVO> getCodegenDetail(@RequestParam("tableId") Long tableId) {
|
||||
CodegenTableDO table = codegenService.getCodegenTablePage(tableId);
|
||||
@@ -79,14 +79,14 @@ public class CodegenController {
|
||||
return success(CodegenConvert.INSTANCE.convert(table, columns));
|
||||
}
|
||||
|
||||
@ApiOperation("基于数据库的表结构,创建代码生成器的表和字段定义")
|
||||
@Operation(summary = "基于数据库的表结构,创建代码生成器的表和字段定义")
|
||||
@PostMapping("/create-list")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:create')")
|
||||
public CommonResult<List<Long>> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) {
|
||||
return success(codegenService.createCodegenList(getLoginUserId(), reqVO));
|
||||
}
|
||||
|
||||
@ApiOperation("更新数据库的表和字段定义")
|
||||
@Operation(summary = "更新数据库的表和字段定义")
|
||||
@PutMapping("/update")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:update')")
|
||||
public CommonResult<Boolean> updateCodegen(@Valid @RequestBody CodegenUpdateReqVO updateReqVO) {
|
||||
@@ -94,36 +94,36 @@ public class CodegenController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("基于数据库的表结构,同步数据库的表和字段定义")
|
||||
@Operation(summary = "基于数据库的表结构,同步数据库的表和字段定义")
|
||||
@PutMapping("/sync-from-db")
|
||||
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:update')")
|
||||
public CommonResult<Boolean> syncCodegenFromDB(@RequestParam("tableId") Long tableId) {
|
||||
codegenService.syncCodegenFromDB(tableId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("删除数据库的表和字段定义")
|
||||
@Operation(summary = "删除数据库的表和字段定义")
|
||||
@DeleteMapping("/delete")
|
||||
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:delete')")
|
||||
public CommonResult<Boolean> deleteCodegen(@RequestParam("tableId") Long tableId) {
|
||||
codegenService.deleteCodegen(tableId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("预览生成代码")
|
||||
@Operation(summary = "预览生成代码")
|
||||
@GetMapping("/preview")
|
||||
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:preview')")
|
||||
public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(@RequestParam("tableId") Long tableId) {
|
||||
Map<String, String> codes = codegenService.generationCodes(tableId);
|
||||
return success(CodegenConvert.INSTANCE.convert(codes));
|
||||
}
|
||||
|
||||
@ApiOperation("下载生成代码")
|
||||
@Operation(summary = "下载生成代码")
|
||||
@GetMapping("/download")
|
||||
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:codegen:download')")
|
||||
public void downloadCodegen(@RequestParam("tableId") Long tableId,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
@@ -1,21 +1,20 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO")
|
||||
@Schema(title = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO")
|
||||
@Data
|
||||
public class CodegenCreateListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "数据源配置的编号", required = true, example = "1")
|
||||
@Schema(title = "数据源配置的编号", required = true, example = "1")
|
||||
@NotNull(message = "数据源配置的编号不能为空")
|
||||
private Long dataSourceConfigId;
|
||||
|
||||
@ApiModelProperty(value = "表名数组", required = true, example = "[1, 2, 3]")
|
||||
@Schema(title = "表名数组", required = true, example = "[1, 2, 3]")
|
||||
@NotNull(message = "表名数组不能为空")
|
||||
private List<String> tableNames;
|
||||
|
||||
|
@@ -2,20 +2,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnRespVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableRespVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 代码生成表和字段的明细 Response VO")
|
||||
@Schema(title = "管理后台 - 代码生成表和字段的明细 Response VO")
|
||||
@Data
|
||||
public class CodegenDetailRespVO {
|
||||
|
||||
@ApiModelProperty("表定义")
|
||||
@Schema(name = "表定义")
|
||||
private CodegenTableRespVO table;
|
||||
|
||||
@ApiModelProperty("字段定义")
|
||||
@Schema(name = "字段定义")
|
||||
private List<CodegenColumnRespVO> columns;
|
||||
|
||||
}
|
||||
|
@@ -1,17 +1,16 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象")
|
||||
@Schema(title = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象")
|
||||
@Data
|
||||
public class CodegenPreviewRespVO {
|
||||
|
||||
@ApiModelProperty(value = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java")
|
||||
@Schema(title = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java")
|
||||
private String filePath;
|
||||
|
||||
@ApiModelProperty(value = "代码", required = true, example = "Hello World")
|
||||
@Schema(title = "代码", required = true, example = "Hello World")
|
||||
private String code;
|
||||
|
||||
}
|
||||
|
@@ -4,8 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnBaseVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO;
|
||||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -15,7 +14,7 @@ import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 代码生成表和字段的修改 Request VO")
|
||||
@Schema(title = "管理后台 - 代码生成表和字段的修改 Request VO")
|
||||
@Data
|
||||
public class CodegenUpdateReqVO {
|
||||
|
||||
@@ -27,14 +26,14 @@ public class CodegenUpdateReqVO {
|
||||
@NotNull(message = "字段定义不能为空")
|
||||
private List<Column> columns;
|
||||
|
||||
@ApiModel("更新表定义")
|
||||
@Schema(title = "更新表定义")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Valid
|
||||
public static class Table extends CodegenTableBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@AssertTrue(message = "上级菜单不能为空")
|
||||
@@ -46,13 +45,13 @@ public class CodegenUpdateReqVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel("更新表定义")
|
||||
@Schema(title = "更新表定义")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public static class Column extends CodegenColumnBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,73 +11,73 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class CodegenColumnBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表编号", required = true, example = "1")
|
||||
@Schema(title = "表编号", required = true, example = "1")
|
||||
@NotNull(message = "表编号不能为空")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty(value = "字段名", required = true, example = "user_age")
|
||||
@Schema(title = "字段名", required = true, example = "user_age")
|
||||
@NotNull(message = "字段名不能为空")
|
||||
private String columnName;
|
||||
|
||||
@ApiModelProperty(value = "字段类型", required = true, example = "int(11)")
|
||||
@Schema(title = "字段类型", required = true, example = "int(11)")
|
||||
@NotNull(message = "字段类型不能为空")
|
||||
private String dataType;
|
||||
|
||||
@ApiModelProperty(value = "字段描述", required = true, example = "年龄")
|
||||
@Schema(title = "字段描述", required = true, example = "年龄")
|
||||
@NotNull(message = "字段描述不能为空")
|
||||
private String columnComment;
|
||||
|
||||
@ApiModelProperty(value = "是否允许为空", required = true, example = "true")
|
||||
@Schema(title = "是否允许为空", required = true, example = "true")
|
||||
@NotNull(message = "是否允许为空不能为空")
|
||||
private Boolean nullable;
|
||||
|
||||
@ApiModelProperty(value = "是否主键", required = true, example = "false")
|
||||
@Schema(title = "是否主键", required = true, example = "false")
|
||||
@NotNull(message = "是否主键不能为空")
|
||||
private Boolean primaryKey;
|
||||
|
||||
@ApiModelProperty(value = "是否自增", required = true, example = "true")
|
||||
@Schema(title = "是否自增", required = true, example = "true")
|
||||
@NotNull(message = "是否自增不能为空")
|
||||
private String autoIncrement;
|
||||
|
||||
@ApiModelProperty(value = "排序", required = true, example = "10")
|
||||
@Schema(title = "排序", required = true, example = "10")
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer ordinalPosition;
|
||||
|
||||
@ApiModelProperty(value = "Java 属性类型", required = true, example = "userAge")
|
||||
@Schema(title = "Java 属性类型", required = true, example = "userAge")
|
||||
@NotNull(message = "Java 属性类型不能为空")
|
||||
private String javaType;
|
||||
|
||||
@ApiModelProperty(value = "Java 属性名", required = true, example = "Integer")
|
||||
@Schema(title = "Java 属性名", required = true, example = "Integer")
|
||||
@NotNull(message = "Java 属性名不能为空")
|
||||
private String javaField;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_gender")
|
||||
@Schema(title = "字典类型", example = "sys_gender")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "数据示例", example = "1024")
|
||||
@Schema(title = "数据示例", example = "1024")
|
||||
private String example;
|
||||
|
||||
@ApiModelProperty(value = "是否为 Create 创建操作的字段", required = true, example = "true")
|
||||
@Schema(title = "是否为 Create 创建操作的字段", required = true, example = "true")
|
||||
@NotNull(message = "是否为 Create 创建操作的字段不能为空")
|
||||
private Boolean createOperation;
|
||||
|
||||
@ApiModelProperty(value = "是否为 Update 更新操作的字段", required = true, example = "false")
|
||||
@Schema(title = "是否为 Update 更新操作的字段", required = true, example = "false")
|
||||
@NotNull(message = "是否为 Update 更新操作的字段不能为空")
|
||||
private Boolean updateOperation;
|
||||
|
||||
@ApiModelProperty(value = "是否为 List 查询操作的字段", required = true, example = "true")
|
||||
@Schema(title = "是否为 List 查询操作的字段", required = true, example = "true")
|
||||
@NotNull(message = "是否为 List 查询操作的字段不能为空")
|
||||
private Boolean listOperation;
|
||||
|
||||
@ApiModelProperty(value = "List 查询操作的条件类型", required = true, example = "LIKE", notes = "参见 CodegenColumnListConditionEnum 枚举")
|
||||
@Schema(title = "List 查询操作的条件类型", required = true, example = "LIKE", description = "参见 CodegenColumnListConditionEnum 枚举")
|
||||
@NotNull(message = "List 查询操作的条件类型不能为空")
|
||||
private String listOperationCondition;
|
||||
|
||||
@ApiModelProperty(value = "是否为 List 查询操作的返回字段", required = true, example = "true")
|
||||
@Schema(title = "是否为 List 查询操作的返回字段", required = true, example = "true")
|
||||
@NotNull(message = "是否为 List 查询操作的返回字段不能为空")
|
||||
private Boolean listOperationResult;
|
||||
|
||||
@ApiModelProperty(value = "显示类型", required = true, example = "input")
|
||||
@Schema(title = "显示类型", required = true, example = "input")
|
||||
@NotNull(message = "显示类型不能为空")
|
||||
private String htmlType;
|
||||
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 代码生成字段定义 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CodegenColumnRespVO extends CodegenColumnBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,46 +11,46 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class CodegenTableBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "生成场景", required = true, example = "1", notes = "参见 CodegenSceneEnum 枚举")
|
||||
@Schema(title = "生成场景", required = true, example = "1", description = "参见 CodegenSceneEnum 枚举")
|
||||
@NotNull(message = "导入类型不能为空")
|
||||
private Integer scene;
|
||||
|
||||
@ApiModelProperty(value = "表名称", required = true, example = "yudao")
|
||||
@Schema(title = "表名称", required = true, example = "yudao")
|
||||
@NotNull(message = "表名称不能为空")
|
||||
private String tableName;
|
||||
|
||||
@ApiModelProperty(value = "表描述", required = true, example = "芋道")
|
||||
@Schema(title = "表描述", required = true, example = "芋道")
|
||||
@NotNull(message = "表描述不能为空")
|
||||
private String tableComment;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是备注")
|
||||
@Schema(title = "备注", example = "我是备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "模块名", required = true, example = "system")
|
||||
@Schema(title = "模块名", required = true, example = "system")
|
||||
@NotNull(message = "模块名不能为空")
|
||||
private String moduleName;
|
||||
|
||||
@ApiModelProperty(value = "业务名", required = true, example = "codegen")
|
||||
@Schema(title = "业务名", required = true, example = "codegen")
|
||||
@NotNull(message = "业务名不能为空")
|
||||
private String businessName;
|
||||
|
||||
@ApiModelProperty(value = "类名称", required = true, example = "CodegenTable")
|
||||
@Schema(title = "类名称", required = true, example = "CodegenTable")
|
||||
@NotNull(message = "类名称不能为空")
|
||||
private String className;
|
||||
|
||||
@ApiModelProperty(value = "类描述", required = true, example = "代码生成器的表定义")
|
||||
@Schema(title = "类描述", required = true, example = "代码生成器的表定义")
|
||||
@NotNull(message = "类描述不能为空")
|
||||
private String classComment;
|
||||
|
||||
@ApiModelProperty(value = "作者", required = true, example = "芋道源码")
|
||||
@Schema(title = "作者", required = true, example = "芋道源码")
|
||||
@NotNull(message = "作者不能为空")
|
||||
private String author;
|
||||
|
||||
@ApiModelProperty(value = "模板类型", required = true, example = "1", notes = "参见 CodegenTemplateTypeEnum 枚举")
|
||||
@Schema(title = "模板类型", required = true, example = "1", description = "参见 CodegenTemplateTypeEnum 枚举")
|
||||
@NotNull(message = "模板类型不能为空")
|
||||
private Integer templateType;
|
||||
|
||||
@ApiModelProperty(value = "父菜单编号", example = "1024")
|
||||
@Schema(title = "父菜单编号", example = "1024")
|
||||
private Long parentMenuId;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,19 +11,19 @@ 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(title = "管理后台 - 表定义分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CodegenTablePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "表名称", example = "yudao", notes = "模糊匹配")
|
||||
@Schema(title = "表名称", example = "yudao", description = "模糊匹配")
|
||||
private String tableName;
|
||||
|
||||
@ApiModelProperty(value = "表描述", example = "芋道", notes = "模糊匹配")
|
||||
@Schema(title = "表描述", example = "芋道", description = "模糊匹配")
|
||||
private String tableComment;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(title = "创建时间", 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,29 +1,28 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 代码生成表定义 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CodegenTableRespVO extends CodegenTableBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "主键编号", required = true, example = "1024")
|
||||
@Schema(title = "主键编号", required = true, example = "1024")
|
||||
private Integer dataSourceConfigId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间", required = true)
|
||||
@Schema(title = "更新时间", required = true)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
@@ -1,17 +1,16 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("管理后台 - 数据库的表定义 Response VO")
|
||||
@Schema(title = "管理后台 - 数据库的表定义 Response VO")
|
||||
@Data
|
||||
public class DatabaseTableRespVO {
|
||||
|
||||
@ApiModelProperty(value = "表名称", required = true, example = "yuanma")
|
||||
@Schema(title = "表名称", required = true, example = "yuanma")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "表描述", required = true, example = "芋道源码")
|
||||
@Schema(title = "表描述", required = true, example = "芋道源码")
|
||||
private String comment;
|
||||
|
||||
}
|
||||
|
@@ -10,9 +10,9 @@ import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.service.config.ConfigService;
|
||||
import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
|
||||
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.*;
|
||||
@@ -26,7 +26,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("/infra/config")
|
||||
@Validated
|
||||
@@ -36,14 +36,14 @@ public class ConfigController {
|
||||
private ConfigService configService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建参数配置")
|
||||
@Operation(summary = "创建参数配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:config:create')")
|
||||
public CommonResult<Long> createConfig(@Valid @RequestBody ConfigCreateReqVO reqVO) {
|
||||
return success(configService.createConfig(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改参数配置")
|
||||
@Operation(summary = "修改参数配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:config:update')")
|
||||
public CommonResult<Boolean> updateConfig(@Valid @RequestBody ConfigUpdateReqVO reqVO) {
|
||||
configService.updateConfig(reqVO);
|
||||
@@ -51,8 +51,8 @@ public class ConfigController {
|
||||
}
|
||||
|
||||
@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('infra:config:delete')")
|
||||
public CommonResult<Boolean> deleteConfig(@RequestParam("id") Long id) {
|
||||
configService.deleteConfig(id);
|
||||
@@ -60,16 +60,16 @@ public class ConfigController {
|
||||
}
|
||||
|
||||
@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('infra:config:query')")
|
||||
public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) {
|
||||
return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id)));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get-value-by-key")
|
||||
@ApiOperation(value = "根据参数键名查询参数值", notes = "不可见的配置,不允许返回给前端")
|
||||
@ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class)
|
||||
@Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
|
||||
@Parameter(name = "key", description = "参数键", required = true, example = "yunai.biz.username")
|
||||
public CommonResult<String> getConfigKey(@RequestParam("key") String key) {
|
||||
ConfigDO config = configService.getConfigByKey(key);
|
||||
if (config == null) {
|
||||
@@ -82,7 +82,7 @@ public class ConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获取参数配置分页")
|
||||
@Operation(summary = "获取参数配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:config:query')")
|
||||
public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) {
|
||||
PageResult<ConfigDO> page = configService.getConfigPage(reqVO);
|
||||
@@ -90,7 +90,7 @@ public class ConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("导出参数配置")
|
||||
@Operation(summary = "导出参数配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:config:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSysConfig(@Valid ConfigExportReqVO reqVO,
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -15,26 +14,26 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class ConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "参数分组", required = true, example = "biz")
|
||||
@Schema(title = "参数分组", required = true, example = "biz")
|
||||
@NotEmpty(message = "参数分组不能为空")
|
||||
@Size(max = 50, message = "参数名称不能超过50个字符")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "参数名称", required = true, example = "数据库名")
|
||||
@Schema(title = "参数名称", required = true, example = "数据库名")
|
||||
@NotBlank(message = "参数名称不能为空")
|
||||
@Size(max = 100, message = "参数名称不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "参数键值", required = true, example = "1024")
|
||||
@Schema(title = "参数键值", required = true, example = "1024")
|
||||
@NotBlank(message = "参数键值不能为空")
|
||||
@Size(max = 500, message = "参数键值长度不能超过500个字符")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "是否敏感", required = true, example = "true")
|
||||
@Schema(title = "是否敏感", required = true, example = "true")
|
||||
@NotNull(message = "是否敏感不能为空")
|
||||
private Boolean visible;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "备注一下很帅气!")
|
||||
@Schema(title = "备注", example = "备注一下很帅气!")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@@ -1,19 +1,18 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@ApiModel("管理后台 - 参数配置创建 Request VO")
|
||||
@Schema(title = "管理后台 - 参数配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ConfigCreateReqVO extends ConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username")
|
||||
@Schema(title = "参数键名", required = true, example = "yunai.db.username")
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(max = 100, message = "参数键名长度不能超过100个字符")
|
||||
private String key;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,20 +8,20 @@ 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(title = "管理后台 - 参数配置导出 Request VO")
|
||||
@Data
|
||||
public class ConfigExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "参数名称", example = "模糊匹配")
|
||||
@Schema(title = "参数名称", example = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配")
|
||||
@Schema(title = "参数键名", example = "yunai.db.username", description = "模糊匹配")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举")
|
||||
@Schema(title = "参数类型", example = "1", description = "参见 SysConfigTypeEnum 枚举")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(title = "创建时间", 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,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,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(title = "管理后台 - 参数配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ConfigPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "数据源名称", example = "模糊匹配")
|
||||
@Schema(title = "数据源名称", example = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配")
|
||||
@Schema(title = "参数键名", example = "yunai.db.username", description = "模糊匹配")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举")
|
||||
@Schema(title = "参数类型", example = "1", description = "参见 SysConfigTypeEnum 枚举")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@Schema(title = "创建时间", 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,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -9,23 +8,23 @@ import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 参数配置信息 Response VO")
|
||||
@Schema(title = "管理后台 - 参数配置信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ConfigRespVO extends ConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "参数配置序号", required = true, example = "1024")
|
||||
@Schema(title = "参数配置序号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username")
|
||||
@Schema(title = "参数键名", required = true, example = "yunai.db.username")
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(max = 100, message = "参数键名长度不能超过100个字符")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举")
|
||||
@Schema(title = "参数类型", required = true, example = "1", description = "参见 SysConfigTypeEnum 枚举")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
@Schema(title = "创建时间", required = true, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 参数配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ConfigUpdateReqVO extends ConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "参数配置序号", required = true, example = "1024")
|
||||
@Schema(title = "参数配置序号", required = true, example = "1024")
|
||||
@NotNull(message = "参数配置编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigUpda
|
||||
import cn.iocoder.yudao.module.infra.convert.db.DataSourceConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
|
||||
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("/infra/data-source-config")
|
||||
@Validated
|
||||
@@ -30,14 +30,14 @@ public class DataSourceConfigController {
|
||||
private DataSourceConfigService dataSourceConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建数据源配置")
|
||||
@Operation(summary = "创建数据源配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:data-source-config:create')")
|
||||
public CommonResult<Long> createDataSourceConfig(@Valid @RequestBody DataSourceConfigCreateReqVO createReqVO) {
|
||||
return success(dataSourceConfigService.createDataSourceConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新数据源配置")
|
||||
@Operation(summary = "更新数据源配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:data-source-config:update')")
|
||||
public CommonResult<Boolean> updateDataSourceConfig(@Valid @RequestBody DataSourceConfigUpdateReqVO updateReqVO) {
|
||||
dataSourceConfigService.updateDataSourceConfig(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class DataSourceConfigController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除数据源配置")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除数据源配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:data-source-config:delete')")
|
||||
public CommonResult<Boolean> deleteDataSourceConfig(@RequestParam("id") Long id) {
|
||||
dataSourceConfigService.deleteDataSourceConfig(id);
|
||||
@@ -54,8 +54,8 @@ public class DataSourceConfigController {
|
||||
}
|
||||
|
||||
@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('infra:data-source-config:query')")
|
||||
public CommonResult<DataSourceConfigRespVO> getDataSourceConfig(@RequestParam("id") Long id) {
|
||||
DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id);
|
||||
@@ -63,7 +63,7 @@ public class DataSourceConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得数据源配置列表")
|
||||
@Operation(summary = "获得数据源配置列表")
|
||||
@PreAuthorize("@ss.hasPermission('infra:data-source-config:query')")
|
||||
public CommonResult<List<DataSourceConfigRespVO>> getDataSourceConfigList() {
|
||||
List<DataSourceConfigDO> list = dataSourceConfigService.getDataSourceConfigList();
|
||||
|
@@ -13,9 +13,9 @@ import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourcePrope
|
||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -27,7 +27,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Api(tags = "管理后台 - 数据库文档")
|
||||
@Tag(name = "管理后台 - 数据库文档")
|
||||
@RestController
|
||||
@RequestMapping("/infra/db-doc")
|
||||
public class DatabaseDocController {
|
||||
@@ -42,27 +42,24 @@ public class DatabaseDocController {
|
||||
private static final String DOC_DESCRIPTION = "文档描述";
|
||||
|
||||
@GetMapping("/export-html")
|
||||
@ApiOperation("导出 html 格式的数据文档")
|
||||
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true",
|
||||
dataTypeClass = Boolean.class)
|
||||
@Operation(summary = "导出 html 格式的数据文档")
|
||||
@Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true")
|
||||
public void exportHtml(@RequestParam(defaultValue = "true") Boolean deleteFile,
|
||||
HttpServletResponse response) throws IOException {
|
||||
doExportFile(EngineFileType.HTML, deleteFile, response);
|
||||
}
|
||||
|
||||
@GetMapping("/export-word")
|
||||
@ApiOperation("导出 word 格式的数据文档")
|
||||
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true",
|
||||
dataTypeClass = Boolean.class)
|
||||
@Operation(summary = "导出 word 格式的数据文档")
|
||||
@Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true")
|
||||
public void exportWord(@RequestParam(defaultValue = "true") Boolean deleteFile,
|
||||
HttpServletResponse response) throws IOException {
|
||||
doExportFile(EngineFileType.WORD, deleteFile, response);
|
||||
}
|
||||
|
||||
@GetMapping("/export-markdown")
|
||||
@ApiOperation("导出 markdown 格式的数据文档")
|
||||
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true",
|
||||
dataTypeClass = Boolean.class)
|
||||
@Operation(summary = "导出 markdown 格式的数据文档")
|
||||
@Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true")
|
||||
public void exportMarkdown(@RequestParam(defaultValue = "true") Boolean deleteFile,
|
||||
HttpServletResponse response) throws IOException {
|
||||
doExportFile(EngineFileType.MD, deleteFile, response);
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
@@ -12,15 +10,15 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
public class DataSourceConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "数据源名称", required = true, example = "test")
|
||||
@Schema(title = "数据源名称", required = true, example = "test")
|
||||
@NotNull(message = "数据源名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro")
|
||||
@Schema(title = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro")
|
||||
@NotNull(message = "数据源连接不能为空")
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "用户名", required = true, example = "root")
|
||||
@Schema(title = "用户名", required = true, example = "root")
|
||||
@NotNull(message = "用户名不能为空")
|
||||
private String username;
|
||||
|
||||
|
@@ -1,17 +1,15 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 数据源配置创建 Request VO")
|
||||
@Schema(title = "管理后台 - 数据源配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DataSourceConfigCreateReqVO extends DataSourceConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "123456")
|
||||
@Schema(title = "密码", required = true, example = "123456")
|
||||
@NotNull(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 数据源配置 Response VO")
|
||||
@Schema(title = "管理后台 - 数据源配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DataSourceConfigRespVO extends DataSourceConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键编号", required = true, example = "1024")
|
||||
@Schema(title = "主键编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,21 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 数据源配置更新 Request VO")
|
||||
@Schema(title = "管理后台 - 数据源配置更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DataSourceConfigUpdateReqVO extends DataSourceConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键编号", required = true, example = "1024")
|
||||
@Schema(title = "主键编号", required = true, example = "1024")
|
||||
@NotNull(message = "主键编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "123456")
|
||||
@Schema(title = "密码", required = true, example = "123456")
|
||||
@NotNull(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
|
@@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigU
|
||||
import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.service.file.FileConfigService;
|
||||
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.*;
|
||||
@@ -21,7 +21,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 文件配置")
|
||||
@Tag(name = "管理后台 - 文件配置")
|
||||
@RestController
|
||||
@RequestMapping("/infra/file-config")
|
||||
@Validated
|
||||
@@ -31,14 +31,14 @@ public class FileConfigController {
|
||||
private FileConfigService fileConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建文件配置")
|
||||
@Operation(summary = "创建文件配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:create')")
|
||||
public CommonResult<Long> createFileConfig(@Valid @RequestBody FileConfigCreateReqVO createReqVO) {
|
||||
return success(fileConfigService.createFileConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新文件配置")
|
||||
@Operation(summary = "更新文件配置")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:update')")
|
||||
public CommonResult<Boolean> updateFileConfig(@Valid @RequestBody FileConfigUpdateReqVO updateReqVO) {
|
||||
fileConfigService.updateFileConfig(updateReqVO);
|
||||
@@ -46,7 +46,7 @@ public class FileConfigController {
|
||||
}
|
||||
|
||||
@PutMapping("/update-master")
|
||||
@ApiOperation("更新文件配置为 Master")
|
||||
@Operation(summary = "更新文件配置为 Master")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:update')")
|
||||
public CommonResult<Boolean> updateFileConfigMaster(@RequestParam("id") Long id) {
|
||||
fileConfigService.updateFileConfigMaster(id);
|
||||
@@ -54,8 +54,8 @@ public class FileConfigController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除文件配置")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除文件配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:delete')")
|
||||
public CommonResult<Boolean> deleteFileConfig(@RequestParam("id") Long id) {
|
||||
fileConfigService.deleteFileConfig(id);
|
||||
@@ -63,8 +63,8 @@ public class FileConfigController {
|
||||
}
|
||||
|
||||
@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('infra:file-config:query')")
|
||||
public CommonResult<FileConfigRespVO> getFileConfig(@RequestParam("id") Long id) {
|
||||
FileConfigDO fileConfig = fileConfigService.getFileConfig(id);
|
||||
@@ -72,7 +72,7 @@ public class FileConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得文件配置分页")
|
||||
@Operation(summary = "获得文件配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:query')")
|
||||
public CommonResult<PageResult<FileConfigRespVO>> getFileConfigPage(@Valid FileConfigPageReqVO pageVO) {
|
||||
PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(pageVO);
|
||||
@@ -80,7 +80,7 @@ public class FileConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
@ApiOperation("测试文件配置是否正确")
|
||||
@Operation(summary = "测试文件配置是否正确")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file-config:query')")
|
||||
public CommonResult<String> testFileConfig(@RequestParam("id") Long id) throws Exception {
|
||||
String url = fileConfigService.testFileConfig(id);
|
||||
|
@@ -12,9 +12,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FileUploadReq
|
||||
import cn.iocoder.yudao.module.infra.convert.file.FileConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||
import cn.iocoder.yudao.module.infra.service.file.FileService;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -30,7 +30,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 文件存储")
|
||||
@Tag(name = "管理后台 - 文件存储")
|
||||
@RestController
|
||||
@RequestMapping("/infra/file")
|
||||
@Validated
|
||||
@@ -41,7 +41,7 @@ public class FileController {
|
||||
private FileService fileService;
|
||||
|
||||
@PostMapping("/upload")
|
||||
@ApiOperation("上传文件")
|
||||
@Operation(summary = "上传文件")
|
||||
@OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要
|
||||
public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
|
||||
MultipartFile file = uploadReqVO.getFile();
|
||||
@@ -50,8 +50,8 @@ public class FileController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除文件")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除文件")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:file:delete')")
|
||||
public CommonResult<Boolean> deleteFile(@RequestParam("id") Long id) throws Exception {
|
||||
fileService.deleteFile(id);
|
||||
@@ -60,8 +60,8 @@ public class FileController {
|
||||
|
||||
@GetMapping("/{configId}/get/**")
|
||||
@PermitAll
|
||||
@ApiOperation("下载文件")
|
||||
@ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "下载文件")
|
||||
@Parameter(name = "configId", description = "配置编号", required = true)
|
||||
public void getFileContent(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@PathVariable("configId") Long configId) throws Exception {
|
||||
@@ -82,7 +82,7 @@ public class FileController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得文件分页")
|
||||
@Operation(summary = "获得文件分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:file:query')")
|
||||
public CommonResult<PageResult<FileRespVO>> getFilePage(@Valid FilePageReqVO pageVO) {
|
||||
PageResult<FileDO> pageResult = fileService.getFilePage(pageVO);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,11 +11,11 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class FileConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "配置名", required = true, example = "S3 - 阿里云")
|
||||
@Schema(title = "配置名", required = true, example = "S3 - 阿里云")
|
||||
@NotNull(message = "配置名不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是备注")
|
||||
@Schema(title = "备注", example = "我是备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,17 +8,17 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("管理后台 - 文件配置创建 Request VO")
|
||||
@Schema(title = "管理后台 - 文件配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileConfigCreateReqVO extends FileConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类")
|
||||
@Schema(title = "存储器", required = true, example = "1", description = "参见 FileStorageEnum 枚举类")
|
||||
@NotNull(message = "存储器不能为空")
|
||||
private Integer storage;
|
||||
|
||||
@ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收")
|
||||
@Schema(title = "存储配置", required = true, description = "配置是动态参数,所以使用 Map 接收")
|
||||
@NotNull(message = "存储配置不能为空")
|
||||
private Map<String, Object> config;
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,20 +11,20 @@ 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(title = "管理后台 - 文件配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileConfigPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "配置名", example = "S3 - 阿里云")
|
||||
@Schema(title = "配置名", example = "S3 - 阿里云")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "存储器", example = "1")
|
||||
@Schema(title = "存储器", example = "1")
|
||||
private Integer storage;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.file.core.client.FileClientConfig;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -10,27 +9,27 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 文件配置 Response VO")
|
||||
@Schema(title = "管理后台 - 文件配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileConfigRespVO extends FileConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类")
|
||||
@Schema(title = "存储器", required = true, example = "1", description = "参见 FileStorageEnum 枚举类")
|
||||
@NotNull(message = "存储器不能为空")
|
||||
private Integer storage;
|
||||
|
||||
@ApiModelProperty(value = "是否为主配置", required = true, example = "true")
|
||||
@Schema(title = "是否为主配置", required = true, example = "true")
|
||||
@NotNull(message = "是否为主配置不能为空")
|
||||
private Boolean master;
|
||||
|
||||
@ApiModelProperty(value = "存储配置", required = true)
|
||||
@Schema(title = "存储配置", required = true)
|
||||
private FileClientConfig config;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,17 +8,17 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel("管理后台 - 文件配置更新 Request VO")
|
||||
@Schema(title = "管理后台 - 文件配置更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileConfigUpdateReqVO extends FileConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1")
|
||||
@Schema(title = "编号", required = true, example = "1")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收")
|
||||
@Schema(title = "存储配置", required = true, description = "配置是动态参数,所以使用 Map 接收")
|
||||
@NotNull(message = "存储配置不能为空")
|
||||
private Map<String, Object> config;
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,20 +11,20 @@ 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(title = "管理后台 - 文件分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FilePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "文件路径", example = "yudao", notes = "模糊匹配")
|
||||
@Schema(title = "文件路径", example = "yudao", description = "模糊匹配")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "文件类型", example = "application/octet-stream", notes = "模糊匹配")
|
||||
@Schema(title = "文件类型", example = "application/octet-stream", description = "模糊匹配")
|
||||
private String type;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,37 +1,36 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大")
|
||||
@Schema(title = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大")
|
||||
@Data
|
||||
public class FileRespVO {
|
||||
|
||||
@ApiModelProperty(value = "文件编号", required = true, example = "1024")
|
||||
@Schema(title = "文件编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "配置编号", required = true, example = "11")
|
||||
@Schema(title = "配置编号", required = true, example = "11")
|
||||
private Long configId;
|
||||
|
||||
@ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg")
|
||||
@Schema(title = "文件路径", required = true, example = "yudao.jpg")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "原文件名", required = true, example = "yudao.jpg")
|
||||
@Schema(title = "原文件名", required = true, example = "yudao.jpg")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg")
|
||||
@Schema(title = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg")
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "文件MIME类型", example = "application/octet-stream")
|
||||
@Schema(title = "文件MIME类型", example = "application/octet-stream")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "文件大小", example = "2048", required = true)
|
||||
@Schema(title = "文件大小", example = "2048", required = true)
|
||||
private Integer size;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,21 +1,20 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel(value = "管理后台 - 上传文件 Request VO")
|
||||
@Schema(title = "管理后台 - 上传文件 Request VO")
|
||||
@Data
|
||||
public class FileUploadReqVO {
|
||||
|
||||
@ApiModelProperty(value = "文件附件", required = true)
|
||||
@Schema(title = "文件附件", required = true)
|
||||
@NotNull(message = "文件附件不能为空")
|
||||
private MultipartFile file;
|
||||
|
||||
@ApiModelProperty(value = "文件附件", example = "yudaoyuanma.png")
|
||||
@Schema(title = "文件附件", example = "yudaoyuanma.png")
|
||||
private String path;
|
||||
|
||||
}
|
||||
|
@@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.*;
|
||||
import cn.iocoder.yudao.module.infra.convert.job.JobConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
|
||||
import cn.iocoder.yudao.module.infra.service.job.JobService;
|
||||
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.quartz.SchedulerException;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,7 +30,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("/infra/job")
|
||||
@Validated
|
||||
@@ -40,7 +40,7 @@ public class JobController {
|
||||
private JobService jobService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建定时任务")
|
||||
@Operation(summary = "创建定时任务")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:create')")
|
||||
public CommonResult<Long> createJob(@Valid @RequestBody JobCreateReqVO createReqVO)
|
||||
throws SchedulerException {
|
||||
@@ -48,7 +48,7 @@ public class JobController {
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新定时任务")
|
||||
@Operation(summary = "更新定时任务")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:update')")
|
||||
public CommonResult<Boolean> updateJob(@Valid @RequestBody JobUpdateReqVO updateReqVO)
|
||||
throws SchedulerException {
|
||||
@@ -57,10 +57,10 @@ public class JobController {
|
||||
}
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@ApiOperation("更新定时任务的状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true, example = "1", dataTypeClass = Integer.class),
|
||||
@Operation(summary = "更新定时任务的状态")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024"),
|
||||
@Parameter(name = "status", description = "状态", required = true, example = "1"),
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:update')")
|
||||
public CommonResult<Boolean> updateJobStatus(@RequestParam(value = "id") Long id, @RequestParam("status") Integer status)
|
||||
@@ -70,8 +70,8 @@ public class JobController {
|
||||
}
|
||||
|
||||
@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('infra:job:delete')")
|
||||
public CommonResult<Boolean> deleteJob(@RequestParam("id") Long id)
|
||||
throws SchedulerException {
|
||||
@@ -80,8 +80,8 @@ public class JobController {
|
||||
}
|
||||
|
||||
@PutMapping("/trigger")
|
||||
@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('infra:job:trigger')")
|
||||
public CommonResult<Boolean> triggerJob(@RequestParam("id") Long id) throws SchedulerException {
|
||||
jobService.triggerJob(id);
|
||||
@@ -89,8 +89,8 @@ public class JobController {
|
||||
}
|
||||
|
||||
@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('infra:job:query')")
|
||||
public CommonResult<JobRespVO> getJob(@RequestParam("id") Long id) {
|
||||
JobDO job = jobService.getJob(id);
|
||||
@@ -98,8 +98,8 @@ public class JobController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得定时任务列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class)
|
||||
@Operation(summary = "获得定时任务列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:query')")
|
||||
public CommonResult<List<JobRespVO>> getJobList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<JobDO> list = jobService.getJobList(ids);
|
||||
@@ -107,7 +107,7 @@ public class JobController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得定时任务分页")
|
||||
@Operation(summary = "获得定时任务分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:query')")
|
||||
public CommonResult<PageResult<JobRespVO>> getJobPage(@Valid JobPageReqVO pageVO) {
|
||||
PageResult<JobDO> pageResult = jobService.getJobPage(pageVO);
|
||||
@@ -115,7 +115,7 @@ public class JobController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出定时任务 Excel")
|
||||
@Operation(summary = "导出定时任务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportJobExcel(@Valid JobExportReqVO exportReqVO,
|
||||
@@ -127,10 +127,10 @@ public class JobController {
|
||||
}
|
||||
|
||||
@GetMapping("/get_next_times")
|
||||
@ApiOperation("获得定时任务的下 n 次执行时间")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "count", value = "数量", example = "5", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得定时任务的下 n 次执行时间")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024"),
|
||||
@Parameter(name = "count", description = "数量", example = "5")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:query')")
|
||||
public CommonResult<List<LocalDateTime>> getJobNextTimes(@RequestParam("id") Long id,
|
||||
|
@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogRespVO;
|
||||
import cn.iocoder.yudao.module.infra.convert.job.JobLogConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
|
||||
import cn.iocoder.yudao.module.infra.service.job.JobLogService;
|
||||
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.GetMapping;
|
||||
@@ -31,7 +31,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("/infra/job-log")
|
||||
@Validated
|
||||
@@ -41,8 +41,8 @@ public class JobLogController {
|
||||
private JobLogService jobLogService;
|
||||
|
||||
@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('infra:job:query')")
|
||||
public CommonResult<JobLogRespVO> getJobLog(@RequestParam("id") Long id) {
|
||||
JobLogDO jobLog = jobLogService.getJobLog(id);
|
||||
@@ -50,8 +50,8 @@ public class JobLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得定时任务日志列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@Operation(summary = "获得定时任务日志列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:query')")
|
||||
public CommonResult<List<JobLogRespVO>> getJobLogList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<JobLogDO> list = jobLogService.getJobLogList(ids);
|
||||
@@ -59,7 +59,7 @@ public class JobLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得定时任务日志分页")
|
||||
@Operation(summary = "获得定时任务日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:query')")
|
||||
public CommonResult<PageResult<JobLogRespVO>> getJobLogPage(@Valid JobLogPageReqVO pageVO) {
|
||||
PageResult<JobLogDO> pageResult = jobLogService.getJobLogPage(pageVO);
|
||||
@@ -67,7 +67,7 @@ public class JobLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出定时任务日志 Excel")
|
||||
@Operation(summary = "导出定时任务日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportJobLogExcel(@Valid JobLogExportReqVO exportReqVO,
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,26 +11,26 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class JobBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "任务名称", required = true, example = "测试任务")
|
||||
@Schema(title = "任务名称", required = true, example = "测试任务")
|
||||
@NotNull(message = "任务名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "处理器的参数", example = "yudao")
|
||||
@Schema(title = "处理器的参数", example = "yudao")
|
||||
private String handlerParam;
|
||||
|
||||
@ApiModelProperty(value = "CRON 表达式", required = true, example = "0/10 * * * * ? *")
|
||||
@Schema(title = "CRON 表达式", required = true, example = "0/10 * * * * ? *")
|
||||
@NotNull(message = "CRON 表达式不能为空")
|
||||
private String cronExpression;
|
||||
|
||||
@ApiModelProperty(value = "重试次数", required = true, example = "3")
|
||||
@Schema(title = "重试次数", required = true, example = "3")
|
||||
@NotNull(message = "重试次数不能为空")
|
||||
private Integer retryCount;
|
||||
|
||||
@ApiModelProperty(value = "重试间隔", required = true, example = "1000")
|
||||
@Schema(title = "重试间隔", required = true, example = "1000")
|
||||
@NotNull(message = "重试间隔不能为空")
|
||||
private Integer retryInterval;
|
||||
|
||||
@ApiModelProperty(value = "监控超时时间", example = "1000")
|
||||
@Schema(title = "监控超时时间", example = "1000")
|
||||
private Integer monitorTimeout;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 定时任务创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobCreateReqVO extends JobBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@Schema(title = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@NotNull(message = "处理器的名字不能为空")
|
||||
private String handlerName;
|
||||
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 JobPageReqVO 是一致的")
|
||||
@Schema(title = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 JobPageReqVO 是一致的")
|
||||
@Data
|
||||
public class JobExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配")
|
||||
@Schema(title = "任务名称", example = "测试任务", description = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", example = "1", notes = "参见 JobStatusEnum 枚举")
|
||||
@Schema(title = "任务状态", example = "1", description = "参见 JobStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", example = "UserSessionTimeoutJob", notes = "模糊匹配")
|
||||
@Schema(title = "处理器的名字", example = "UserSessionTimeoutJob", description = "模糊匹配")
|
||||
private String handlerName;
|
||||
|
||||
}
|
||||
|
@@ -1,25 +1,24 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 定时任务分页 Request VO")
|
||||
@Schema(title = "管理后台 - 定时任务分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配")
|
||||
@Schema(title = "任务名称", example = "测试任务", description = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", example = "1", notes = "参见 JobStatusEnum 枚举")
|
||||
@Schema(title = "任务状态", example = "1", description = "参见 JobStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", example = "sysUserSessionTimeoutJob", notes = "模糊匹配")
|
||||
@Schema(title = "处理器的名字", example = "sysUserSessionTimeoutJob", description = "模糊匹配")
|
||||
private String handlerName;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,23 +8,23 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 定时任务 Response VO")
|
||||
@Schema(title = "管理后台 - 定时任务 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobRespVO extends JobBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "任务编号", required = true, example = "1024")
|
||||
@Schema(title = "任务编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", required = true, example = "1")
|
||||
@Schema(title = "任务状态", required = true, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@Schema(title = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@NotNull(message = "处理器的名字不能为空")
|
||||
private String handlerName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 定时任务更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobUpdateReqVO extends JobBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "任务编号", required = true, example = "1024")
|
||||
@Schema(title = "任务编号", required = true, example = "1024")
|
||||
@NotNull(message = "任务编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -16,38 +15,38 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class JobLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "任务编号", required = true, example = "1024")
|
||||
@Schema(title = "任务编号", required = true, example = "1024")
|
||||
@NotNull(message = "任务编号不能为空")
|
||||
private Long jobId;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@Schema(title = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob")
|
||||
@NotNull(message = "处理器的名字不能为空")
|
||||
private String handlerName;
|
||||
|
||||
@ApiModelProperty(value = "处理器的参数", example = "yudao")
|
||||
@Schema(title = "处理器的参数", example = "yudao")
|
||||
private String handlerParam;
|
||||
|
||||
@ApiModelProperty(value = "第几次执行", required = true, example = "1")
|
||||
@Schema(title = "第几次执行", required = true, example = "1")
|
||||
@NotNull(message = "第几次执行不能为空")
|
||||
private Integer executeIndex;
|
||||
|
||||
@ApiModelProperty(value = "开始执行时间", required = true)
|
||||
@Schema(title = "开始执行时间", required = true)
|
||||
@NotNull(message = "开始执行时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
@ApiModelProperty(value = "结束执行时间")
|
||||
@Schema(title = "结束执行时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "执行时长", example = "123")
|
||||
@Schema(title = "执行时长", example = "123")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", required = true, example = "1", notes = "参见 JobLogStatusEnum 枚举")
|
||||
@Schema(title = "任务状态", required = true, example = "1", description = "参见 JobLogStatusEnum 枚举")
|
||||
@NotNull(message = "任务状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "结果数据", example = "执行成功")
|
||||
@Schema(title = "结果数据", example = "执行成功")
|
||||
private String result;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,25 +8,25 @@ 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 = "参数和 JobLogPageReqVO 是一致的")
|
||||
@Schema(title = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 JobLogPageReqVO 是一致的")
|
||||
@Data
|
||||
public class JobLogExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "任务编号", example = "10")
|
||||
@Schema(title = "任务编号", example = "10")
|
||||
private Long jobId;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", notes = "模糊匹配")
|
||||
@Schema(title = "处理器的名字", description = "模糊匹配")
|
||||
private String handlerName;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始执行时间")
|
||||
@Schema(title = "开始执行时间")
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束执行时间")
|
||||
@Schema(title = "结束执行时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举")
|
||||
@Schema(title = "任务状态", description = "参见 JobLogStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,27 +11,27 @@ 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(title = "管理后台 - 定时任务日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "任务编号", example = "10")
|
||||
@Schema(title = "任务编号", example = "10")
|
||||
private Long jobId;
|
||||
|
||||
@ApiModelProperty(value = "处理器的名字", notes = "模糊匹配")
|
||||
@Schema(title = "处理器的名字", description = "模糊匹配")
|
||||
private String handlerName;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始执行时间")
|
||||
@Schema(title = "开始执行时间")
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束执行时间")
|
||||
@Schema(title = "结束执行时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举")
|
||||
@Schema(title = "任务状态", description = "参见 JobLogStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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(title = "管理后台 - 定时任务日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobLogRespVO extends JobLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "日志编号", required = true, example = "1024")
|
||||
@Schema(title = "日志编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@ import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.Api
|
||||
import cn.iocoder.yudao.module.infra.convert.logger.ApiAccessLogConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
|
||||
import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
|
||||
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;
|
||||
@@ -28,7 +28,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 = "管理后台 - API 访问日志")
|
||||
@Tag(name = "管理后台 - API 访问日志")
|
||||
@RestController
|
||||
@RequestMapping("/infra/api-access-log")
|
||||
@Validated
|
||||
@@ -38,7 +38,7 @@ public class ApiAccessLogController {
|
||||
private ApiAccessLogService apiAccessLogService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得API 访问日志分页")
|
||||
@Operation(summary = "获得API 访问日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:api-access-log:query')")
|
||||
public CommonResult<PageResult<ApiAccessLogRespVO>> getApiAccessLogPage(@Valid ApiAccessLogPageReqVO pageVO) {
|
||||
PageResult<ApiAccessLogDO> pageResult = apiAccessLogService.getApiAccessLogPage(pageVO);
|
||||
@@ -46,7 +46,7 @@ public class ApiAccessLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出API 访问日志 Excel")
|
||||
@Operation(summary = "导出API 访问日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:api-access-log:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportApiAccessLogExcel(@Valid ApiAccessLogExportReqVO exportReqVO,
|
||||
|
@@ -11,10 +11,10 @@ import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiE
|
||||
import cn.iocoder.yudao.module.infra.convert.logger.ApiErrorLogConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
|
||||
import cn.iocoder.yudao.module.infra.service.logger.ApiErrorLogService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,7 +29,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Api(tags = "管理后台 - API 错误日志")
|
||||
@Tag(name = "管理后台 - API 错误日志")
|
||||
@RestController
|
||||
@RequestMapping("/infra/api-error-log")
|
||||
@Validated
|
||||
@@ -39,10 +39,10 @@ public class ApiErrorLogController {
|
||||
private ApiErrorLogService apiErrorLogService;
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@ApiOperation("更新 API 错误日志的状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "processStatus", value = "处理状态", required = true, example = "1", dataTypeClass = Integer.class)
|
||||
@Operation(summary = "更新 API 错误日志的状态")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024"),
|
||||
@Parameter(name = "processStatus", description = "处理状态", required = true, example = "1")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('infra:api-error-log:update-status')")
|
||||
public CommonResult<Boolean> updateApiErrorLogProcess(@RequestParam("id") Long id,
|
||||
@@ -52,7 +52,7 @@ public class ApiErrorLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得 API 错误日志分页")
|
||||
@Operation(summary = "获得 API 错误日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:api-error-log:query')")
|
||||
public CommonResult<PageResult<ApiErrorLogRespVO>> getApiErrorLogPage(@Valid ApiErrorLogPageReqVO pageVO) {
|
||||
PageResult<ApiErrorLogDO> pageResult = apiErrorLogService.getApiErrorLogPage(pageVO);
|
||||
@@ -60,7 +60,7 @@ public class ApiErrorLogController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出 API 错误日志 Excel")
|
||||
@Operation(summary = "导出 API 错误日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:api-error-log:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportApiErrorLogExcel(@Valid ApiErrorLogExportReqVO exportReqVO,
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -16,60 +15,60 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class ApiAccessLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
|
||||
@Schema(title = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
|
||||
@NotNull(message = "链路追踪编号不能为空")
|
||||
private String traceId;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "666")
|
||||
@Schema(title = "用户编号", required = true, example = "666")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举")
|
||||
@Schema(title = "用户类型", required = true, example = "2", description = "参见 UserTypeEnum 枚举")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "dashboard")
|
||||
@Schema(title = "应用名", required = true, example = "dashboard")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求方法名", required = true, example = "GET")
|
||||
@Schema(title = "请求方法名", required = true, example = "GET")
|
||||
@NotNull(message = "请求方法名不能为空")
|
||||
private String requestMethod;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@Schema(title = "请求地址", required = true, example = "/xxx/yyy")
|
||||
@NotNull(message = "请求地址不能为空")
|
||||
private String requestUrl;
|
||||
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
@Schema(title = "请求参数")
|
||||
private String requestParams;
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(title = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotNull(message = "用户 IP不能为空")
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "浏览器 UA", required = true, example = "Mozilla/5.0")
|
||||
@Schema(title = "浏览器 UA", required = true, example = "Mozilla/5.0")
|
||||
@NotNull(message = "浏览器 UA不能为空")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "开始请求时间", required = true)
|
||||
@Schema(title = "开始请求时间", required = true)
|
||||
@NotNull(message = "开始请求时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
@ApiModelProperty(value = "结束请求时间", required = true)
|
||||
@Schema(title = "结束请求时间", required = true)
|
||||
@NotNull(message = "结束请求时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "执行时长", required = true, example = "100")
|
||||
@Schema(title = "执行时长", required = true, example = "100")
|
||||
@NotNull(message = "执行时长不能为空")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty(value = "结果码", required = true, example = "0")
|
||||
@Schema(title = "结果码", required = true, example = "0")
|
||||
@NotNull(message = "结果码不能为空")
|
||||
private Integer resultCode;
|
||||
|
||||
@ApiModelProperty(value = "结果提示", example = "芋道源码,牛逼!")
|
||||
@Schema(title = "结果提示", example = "芋道源码,牛逼!")
|
||||
private String resultMsg;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,30 +8,30 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - API 访问日志 Excel 导出 Request VO", description = "参数和 ApiAccessLogPageReqVO 是一致的")
|
||||
@Schema(title = "管理后台 - API 访问日志 Excel 导出 Request VO", description = "参数和 ApiAccessLogPageReqVO 是一致的")
|
||||
@Data
|
||||
public class ApiAccessLogExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "666")
|
||||
@Schema(title = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "2")
|
||||
@Schema(title = "用户类型", example = "2")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(title = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", example = "/xxx/yyy", notes = "模糊匹配")
|
||||
@Schema(title = "请求地址", example = "/xxx/yyy", description = "模糊匹配")
|
||||
private String requestUrl;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始请求时间")
|
||||
@Schema(title = "开始请求时间")
|
||||
private LocalDateTime[] beginTime;
|
||||
|
||||
@ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒")
|
||||
@Schema(title = "执行时长", example = "100", description = "大于等于,单位:毫秒")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty(value = "结果码", example = "0")
|
||||
@Schema(title = "结果码", example = "0")
|
||||
private Integer resultCode;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,32 +11,32 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - API 访问日志分页 Request VO")
|
||||
@Schema(title = "管理后台 - API 访问日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiAccessLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "666")
|
||||
@Schema(title = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "2")
|
||||
@Schema(title = "用户类型", example = "2")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(title = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", example = "/xxx/yyy", notes = "模糊匹配")
|
||||
@Schema(title = "请求地址", example = "/xxx/yyy", description = "模糊匹配")
|
||||
private String requestUrl;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始请求时间")
|
||||
@Schema(title = "开始请求时间")
|
||||
private LocalDateTime[] beginTime;
|
||||
|
||||
@ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒")
|
||||
@Schema(title = "执行时长", example = "100", description = "大于等于,单位:毫秒")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty(value = "结果码", example = "0")
|
||||
@Schema(title = "结果码", example = "0")
|
||||
private Integer resultCode;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - API 访问日志 Response VO")
|
||||
@Schema(title = "管理后台 - API 访问日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiAccessLogRespVO extends ApiAccessLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "日志主键", required = true, example = "1024")
|
||||
@Schema(title = "日志主键", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -16,80 +15,80 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class ApiErrorLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
|
||||
@Schema(title = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002")
|
||||
@NotNull(message = "链路追踪编号不能为空")
|
||||
private String traceId;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "666")
|
||||
@Schema(title = "用户编号", required = true, example = "666")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", required = true, example = "1")
|
||||
@Schema(title = "用户类型", required = true, example = "1")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", required = true, example = "dashboard")
|
||||
@Schema(title = "应用名", required = true, example = "dashboard")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求方法名", required = true, example = "GET")
|
||||
@Schema(title = "请求方法名", required = true, example = "GET")
|
||||
@NotNull(message = "请求方法名不能为空")
|
||||
private String requestMethod;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", required = true, example = "/xx/yy")
|
||||
@Schema(title = "请求地址", required = true, example = "/xx/yy")
|
||||
@NotNull(message = "请求地址不能为空")
|
||||
private String requestUrl;
|
||||
|
||||
@ApiModelProperty(value = "请求参数", required = true)
|
||||
@Schema(title = "请求参数", required = true)
|
||||
@NotNull(message = "请求参数不能为空")
|
||||
private String requestParams;
|
||||
|
||||
@ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@Schema(title = "用户 IP", required = true, example = "127.0.0.1")
|
||||
@NotNull(message = "用户 IP不能为空")
|
||||
private String userIp;
|
||||
|
||||
@ApiModelProperty(value = "浏览器 UA", required = true, example = "Mozilla/5.0")
|
||||
@Schema(title = "浏览器 UA", required = true, example = "Mozilla/5.0")
|
||||
@NotNull(message = "浏览器 UA不能为空")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "异常发生时间", required = true)
|
||||
@Schema(title = "异常发生时间", required = true)
|
||||
@NotNull(message = "异常发生时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime exceptionTime;
|
||||
|
||||
@ApiModelProperty(value = "异常名", required = true)
|
||||
@Schema(title = "异常名", required = true)
|
||||
@NotNull(message = "异常名不能为空")
|
||||
private String exceptionName;
|
||||
|
||||
@ApiModelProperty(value = "异常导致的消息", required = true)
|
||||
@Schema(title = "异常导致的消息", required = true)
|
||||
@NotNull(message = "异常导致的消息不能为空")
|
||||
private String exceptionMessage;
|
||||
|
||||
@ApiModelProperty(value = "异常导致的根消息", required = true)
|
||||
@Schema(title = "异常导致的根消息", required = true)
|
||||
@NotNull(message = "异常导致的根消息不能为空")
|
||||
private String exceptionRootCauseMessage;
|
||||
|
||||
@ApiModelProperty(value = "异常的栈轨迹", required = true)
|
||||
@Schema(title = "异常的栈轨迹", required = true)
|
||||
@NotNull(message = "异常的栈轨迹不能为空")
|
||||
private String exceptionStackTrace;
|
||||
|
||||
@ApiModelProperty(value = "异常发生的类全名", required = true)
|
||||
@Schema(title = "异常发生的类全名", required = true)
|
||||
@NotNull(message = "异常发生的类全名不能为空")
|
||||
private String exceptionClassName;
|
||||
|
||||
@ApiModelProperty(value = "异常发生的类文件", required = true)
|
||||
@Schema(title = "异常发生的类文件", required = true)
|
||||
@NotNull(message = "异常发生的类文件不能为空")
|
||||
private String exceptionFileName;
|
||||
|
||||
@ApiModelProperty(value = "异常发生的方法名", required = true)
|
||||
@Schema(title = "异常发生的方法名", required = true)
|
||||
@NotNull(message = "异常发生的方法名不能为空")
|
||||
private String exceptionMethodName;
|
||||
|
||||
@ApiModelProperty(value = "异常发生的方法所在行", required = true)
|
||||
@Schema(title = "异常发生的方法所在行", required = true)
|
||||
@NotNull(message = "异常发生的方法所在行不能为空")
|
||||
private Integer exceptionLineNumber;
|
||||
|
||||
@ApiModelProperty(value = "处理状态", required = true, example = "0")
|
||||
@Schema(title = "处理状态", required = true, example = "0")
|
||||
@NotNull(message = "处理状态不能为空")
|
||||
private Integer processStatus;
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -9,27 +8,27 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - API 错误日志 Excel 导出 Request VO", description = "参数和 ApiErrorLogPageReqVO 是一致的")
|
||||
@Schema(title = "管理后台 - API 错误日志 Excel 导出 Request VO", description = "参数和 ApiErrorLogPageReqVO 是一致的")
|
||||
@Data
|
||||
public class ApiErrorLogExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "666")
|
||||
@Schema(title = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "1")
|
||||
@Schema(title = "用户类型", example = "1")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(title = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", example = "/xx/yy")
|
||||
@Schema(title = "请求地址", example = "/xx/yy")
|
||||
private String requestUrl;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "异常发生时间")
|
||||
@Schema(title = "异常发生时间")
|
||||
private LocalDateTime[] exceptionTime;
|
||||
|
||||
@ApiModelProperty(value = "处理状态", example = "0")
|
||||
@Schema(title = "处理状态", example = "0")
|
||||
private Integer processStatus;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,29 +11,29 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - API 错误日志分页 Request VO")
|
||||
@Schema(title = "管理后台 - API 错误日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiErrorLogPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", example = "666")
|
||||
@Schema(title = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户类型", example = "1")
|
||||
@Schema(title = "用户类型", example = "1")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "应用名", example = "dashboard")
|
||||
@Schema(title = "应用名", example = "dashboard")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty(value = "请求地址", example = "/xx/yy")
|
||||
@Schema(title = "请求地址", example = "/xx/yy")
|
||||
private String requestUrl;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "异常发生时间")
|
||||
@Schema(title = "异常发生时间")
|
||||
private LocalDateTime[] exceptionTime;
|
||||
|
||||
@ApiModelProperty(value = "处理状态", example = "0")
|
||||
@Schema(title = "处理状态", example = "0")
|
||||
private Integer processStatus;
|
||||
|
||||
}
|
||||
|
@@ -1,29 +1,28 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - API 错误日志 Response VO")
|
||||
@Schema(title = "管理后台 - API 错误日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiErrorLogRespVO extends ApiErrorLogBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
@Schema(title = "编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "处理时间", required = true)
|
||||
@Schema(title = "处理时间", required = true)
|
||||
private LocalDateTime processTime;
|
||||
|
||||
@ApiModelProperty(value = "处理用户编号", example = "233")
|
||||
@Schema(title = "处理用户编号", example = "233")
|
||||
private Integer processUserId;
|
||||
|
||||
}
|
||||
|
@@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyDefineRes
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyValueRespVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespVO;
|
||||
import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert;
|
||||
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.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.Cursor;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
@@ -25,7 +25,7 @@ import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - Redis 监控")
|
||||
@Tag(name = "管理后台 - Redis 监控")
|
||||
@RestController
|
||||
@RequestMapping("/infra/redis")
|
||||
public class RedisController {
|
||||
@@ -34,7 +34,7 @@ public class RedisController {
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
@GetMapping("/get-monitor-info")
|
||||
@ApiOperation("获得 Redis 监控信息")
|
||||
@Operation(summary = "获得 Redis 监控信息")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-monitor-info')")
|
||||
public CommonResult<RedisMonitorRespVO> getRedisMonitorInfo() {
|
||||
// 获得 Redis 统计信息
|
||||
@@ -48,7 +48,7 @@ public class RedisController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-key-define-list")
|
||||
@ApiOperation("获得 Redis Key 模板列表")
|
||||
@Operation(summary = "获得 Redis Key 模板列表")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
|
||||
public CommonResult<List<RedisKeyDefineRespVO>> getKeyDefineList() {
|
||||
List<RedisKeyDefine> keyDefines = RedisKeyRegistry.list();
|
||||
@@ -56,8 +56,8 @@ public class RedisController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-key-list")
|
||||
@ApiOperation("获得 Redis keys 键名列表")
|
||||
@ApiImplicitParam(name = "keyTemplate", value = "Redis Key 定义", example = "true", dataTypeClass = String.class)
|
||||
@Operation(summary = "获得 Redis keys 键名列表")
|
||||
@Parameter(name = "keyTemplate", description = "Redis Key 定义", example = "true")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
|
||||
public CommonResult<Set<String>> getKeyDefineList(@RequestParam("keyTemplate") String keyTemplate) {
|
||||
return success(getKeyDefineList0(keyTemplate));
|
||||
@@ -80,8 +80,8 @@ public class RedisController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-key-value")
|
||||
@ApiOperation("获得 Redis key 内容")
|
||||
@ApiImplicitParam(name = "key", value = "Redis Key", example = "oauth2_access_token:233", dataTypeClass = String.class)
|
||||
@Operation(summary = "获得 Redis key 内容")
|
||||
@Parameter(name = "key", description = "Redis Key", example = "oauth2_access_token:233")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
|
||||
public CommonResult<RedisKeyValueRespVO> getKeyValue(@RequestParam("key") String key) {
|
||||
String value = stringRedisTemplate.opsForValue().get(key);
|
||||
@@ -89,8 +89,8 @@ public class RedisController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-key")
|
||||
@ApiOperation("删除 Redis Key")
|
||||
@ApiImplicitParam(name = "key", value = "Redis Key", example = "oauth2_access_token:233", dataTypeClass = String.class)
|
||||
@Operation(summary = "删除 Redis Key")
|
||||
@Parameter(name = "key", description = "Redis Key", example = "oauth2_access_token:233")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
|
||||
public CommonResult<Boolean> deleteKey(@RequestParam("key") String key) {
|
||||
stringRedisTemplate.delete(key);
|
||||
@@ -98,8 +98,8 @@ public class RedisController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-keys")
|
||||
@ApiOperation("删除 Redis Key 根据模板")
|
||||
@ApiImplicitParam(name = "keyTemplate", value = "Redis Key 定义", example = "true", dataTypeClass = String.class)
|
||||
@Operation(summary = "删除 Redis Key 根据模板")
|
||||
@Parameter(name = "keyTemplate", description = "Redis Key 定义", example = "true")
|
||||
@PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')")
|
||||
public CommonResult<Boolean> deleteKeys(@RequestParam("keyTemplate") String keyTemplate) {
|
||||
Set<String> keys = getKeyDefineList0(keyTemplate);
|
||||
|
@@ -1,36 +1,35 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.redis.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@ApiModel("管理后台 - Redis Key 信息 Response VO")
|
||||
@Schema(title = "管理后台 - Redis Key 信息 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class RedisKeyDefineRespVO {
|
||||
|
||||
@ApiModelProperty(value = "Key 模板", required = true, example = "login_user:%s")
|
||||
@Schema(title = "Key 模板", required = true, example = "login_user:%s")
|
||||
private String keyTemplate;
|
||||
|
||||
@ApiModelProperty(value = "Key 类型的枚举", required = true, example = "String")
|
||||
@Schema(title = "Key 类型的枚举", required = true, example = "String")
|
||||
private RedisKeyDefine.KeyTypeEnum keyType;
|
||||
|
||||
@ApiModelProperty(value = "Value 类型", required = true, example = "java.lang.String")
|
||||
@Schema(title = "Value 类型", required = true, example = "java.lang.String")
|
||||
private Class<?> valueType;
|
||||
|
||||
@ApiModelProperty(value = "超时类型", required = true, example = "1")
|
||||
@Schema(title = "超时类型", required = true, example = "1")
|
||||
private RedisKeyDefine.TimeoutTypeEnum timeoutType;
|
||||
|
||||
@ApiModelProperty(value = "过期时间,单位:毫秒", required = true, example = "1024")
|
||||
@Schema(title = "过期时间,单位:毫秒", required = true, example = "1024")
|
||||
private Duration timeout;
|
||||
|
||||
@ApiModelProperty(value = "备注", required = true, example = "啦啦啦啦~")
|
||||
@Schema(title = "备注", required = true, example = "啦啦啦啦~")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
@@ -1,19 +1,18 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.redis.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("管理后台 - 单个 Redis Key Value Response VO")
|
||||
@Schema(title = "管理后台 - 单个 Redis Key Value Response VO")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class RedisKeyValueRespVO {
|
||||
|
||||
@ApiModelProperty(value = "c5f6990767804a928f4bb96ca249febf", required = true, example = "String")
|
||||
@Schema(title = "c5f6990767804a928f4bb96ca249febf", required = true, example = "String")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(required = true, example = "String")
|
||||
@Schema(required = true, example = "String")
|
||||
private String value;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.redis.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,34 +8,34 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
@ApiModel("管理后台 - Redis 监控信息 Response VO")
|
||||
@Schema(title = "管理后台 - Redis 监控信息 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class RedisMonitorRespVO {
|
||||
|
||||
@ApiModelProperty(value = "Redis info 指令结果", required = true, notes = "具体字段,查看 Redis 文档")
|
||||
@Schema(title = "Redis info 指令结果", required = true, description = "具体字段,查看 Redis 文档")
|
||||
private Properties info;
|
||||
|
||||
@ApiModelProperty(value = "Redis key 数量", required = true, example = "1024")
|
||||
@Schema(title = "Redis key 数量", required = true, example = "1024")
|
||||
private Long dbSize;
|
||||
|
||||
@ApiModelProperty(value = "CommandStat 数组", required = true)
|
||||
@Schema(title = "CommandStat 数组", required = true)
|
||||
private List<CommandStat> commandStats;
|
||||
|
||||
@ApiModel("Redis 命令统计结果")
|
||||
@Schema(title = "Redis 命令统计结果")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public static class CommandStat {
|
||||
|
||||
@ApiModelProperty(value = "Redis 命令", required = true, example = "get")
|
||||
@Schema(title = "Redis 命令", required = true, example = "get")
|
||||
private String command;
|
||||
|
||||
@ApiModelProperty(value = "调用次数", required = true, example = "1024")
|
||||
@Schema(title = "调用次数", required = true, example = "1024")
|
||||
private Long calls;
|
||||
|
||||
@ApiModelProperty(value = "消耗 CPU 秒数", required = true, example = "666")
|
||||
@Schema(title = "消耗 CPU 秒数", required = true, example = "666")
|
||||
private Long usec;
|
||||
|
||||
}
|
||||
|
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.test.vo.*;
|
||||
import cn.iocoder.yudao.module.infra.convert.test.TestDemoConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.test.TestDemoDO;
|
||||
import cn.iocoder.yudao.module.infra.service.test.TestDemoService;
|
||||
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.*;
|
||||
@@ -25,7 +25,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("/infra/test-demo")
|
||||
@Validated
|
||||
@@ -35,14 +35,14 @@ public class TestDemoController {
|
||||
private TestDemoService testDemoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建字典类型")
|
||||
@Operation(summary = "创建字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:create')")
|
||||
public CommonResult<Long> createTestDemo(@Valid @RequestBody TestDemoCreateReqVO createReqVO) {
|
||||
return success(testDemoService.createTestDemo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新字典类型")
|
||||
@Operation(summary = "更新字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:update')")
|
||||
public CommonResult<Boolean> updateTestDemo(@Valid @RequestBody TestDemoUpdateReqVO updateReqVO) {
|
||||
testDemoService.updateTestDemo(updateReqVO);
|
||||
@@ -50,8 +50,8 @@ public class TestDemoController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除字典类型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:delete')")
|
||||
public CommonResult<Boolean> deleteTestDemo(@RequestParam("id") Long id) {
|
||||
testDemoService.deleteTestDemo(id);
|
||||
@@ -59,8 +59,8 @@ public class TestDemoController {
|
||||
}
|
||||
|
||||
@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('infra:test-demo:query')")
|
||||
public CommonResult<TestDemoRespVO> getTestDemo(@RequestParam("id") Long id) {
|
||||
TestDemoDO testDemo = testDemoService.getTestDemo(id);
|
||||
@@ -68,8 +68,8 @@ public class TestDemoController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得字典类型列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@Operation(summary = "获得字典类型列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:query')")
|
||||
public CommonResult<List<TestDemoRespVO>> getTestDemoList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<TestDemoDO> list = testDemoService.getTestDemoList(ids);
|
||||
@@ -77,14 +77,14 @@ public class TestDemoController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得字典类型分页")
|
||||
@Operation(summary = "获得字典类型分页")
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:query')") public CommonResult<PageResult<TestDemoRespVO>> getTestDemoPage(@Valid TestDemoPageReqVO pageVO) {
|
||||
PageResult<TestDemoDO> pageResult = testDemoService.getTestDemoPage(pageVO);
|
||||
return success(TestDemoConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出字典类型 Excel")
|
||||
@Operation(summary = "导出字典类型 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('infra:test-demo:export')") @OperateLog(type = EXPORT)
|
||||
public void exportTestDemoExcel(@Valid TestDemoExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
@@ -12,23 +10,23 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
public class TestDemoBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "名字", required = true)
|
||||
@Schema(title = "名字", required = true)
|
||||
@NotNull(message = "名字不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true)
|
||||
@Schema(title = "状态", required = true)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "类型", required = true)
|
||||
@Schema(title = "类型", required = true)
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "分类", required = true)
|
||||
@Schema(title = "分类", required = true)
|
||||
@NotNull(message = "分类不能为空")
|
||||
private Integer category;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(title = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型创建 Request VO")
|
||||
@Schema(title = "管理后台 - 字典类型创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,34 +1,33 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 字典类型 Excel 导出 Request VO", description = "参数和 TestDemoPageReqVO 是一致的")
|
||||
@Schema(title = "管理后台 - 字典类型 Excel 导出 Request VO", description = "参数和 TestDemoPageReqVO 是一致的")
|
||||
@Data
|
||||
public class TestDemoExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "名字")
|
||||
@Schema(title = "名字")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Schema(title = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@Schema(title = "类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "分类")
|
||||
@Schema(title = "分类")
|
||||
private Integer category;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(title = "备注")
|
||||
private String remark;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,37 +1,36 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型分页 Request VO")
|
||||
@Schema(title = "管理后台 - 字典类型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TestDemoPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "名字")
|
||||
@Schema(title = "名字")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Schema(title = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@Schema(title = "类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "分类")
|
||||
@Schema(title = "分类")
|
||||
private Integer category;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(title = "备注")
|
||||
private String remark;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型 Response VO")
|
||||
@Schema(title = "管理后台 - 字典类型 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TestDemoRespVO extends TestDemoBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true)
|
||||
@Schema(title = "编号", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型更新 Request VO")
|
||||
@Schema(title = "管理后台 - 字典类型更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TestDemoUpdateReqVO extends TestDemoBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true)
|
||||
@Schema(title = "编号", required = true)
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -23,7 +23,9 @@ public class SecurityConfiguration {
|
||||
@Override
|
||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.antMatchers("/swagger-ui.html").anonymous()
|
||||
registry.antMatchers("/v3/api-docs/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html").permitAll()
|
||||
.antMatchers("/swagger-ui/**").permitAll()
|
||||
.antMatchers("/swagger-resources/**").anonymous()
|
||||
.antMatchers("/webjars/**").anonymous()
|
||||
.antMatchers("/*/api-docs").anonymous();
|
||||
|
@@ -27,7 +27,7 @@ import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.business
|
||||
import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert;
|
||||
import ${basePackage}.module.${table.moduleName}.service.${table.businessName}.${table.className}Service;
|
||||
|
||||
@Api(tags = "${sceneEnum.name} - ${table.classComment}")
|
||||
@Tag(name = "${sceneEnum.name} - ${table.classComment}")
|
||||
@RestController
|
||||
##二级的 businessName 暂时不算在 HTTP 路径上,可以根据需要写
|
||||
@RequestMapping("/${table.moduleName}/${simpleClassName_strikeCase}")
|
||||
@@ -38,7 +38,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
private ${table.className}Service ${classNameVar}Service;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建${table.classComment}")
|
||||
@Operation(summary = "创建${table.classComment}")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")#end
|
||||
|
||||
public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) {
|
||||
@@ -46,7 +46,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新${table.classComment}")
|
||||
@Operation(summary = "更新${table.classComment}")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:update')")#end
|
||||
|
||||
public CommonResult<Boolean> update${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) {
|
||||
@@ -55,8 +55,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除${table.classComment}")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = ${primaryColumn.javaType}.class)
|
||||
@Operation(summary = "删除${table.classComment}")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")#end
|
||||
|
||||
public CommonResult<Boolean> delete${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
||||
@@ -65,8 +65,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得${table.classComment}")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = ${primaryColumn.javaType}.class)
|
||||
@Operation(summary = "获得${table.classComment}")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
||||
|
||||
public CommonResult<${sceneEnum.prefixClass}${table.className}RespVO> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
||||
@@ -75,8 +75,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得${table.classComment}列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@Operation(summary = "获得${table.classComment}列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
||||
|
||||
public CommonResult<List<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}List(@RequestParam("ids") Collection<${primaryColumn.javaType}> ids) {
|
||||
@@ -85,7 +85,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得${table.classComment}分页")
|
||||
@Operation(summary = "获得${table.classComment}分页")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
||||
|
||||
public CommonResult<PageResult<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageVO) {
|
||||
@@ -94,7 +94,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出${table.classComment} Excel")
|
||||
@Operation(summary = "导出${table.classComment} Excel")
|
||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:export')")#end
|
||||
|
||||
@OperateLog(type = EXPORT)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
## 提供给 baseVO、createVO、updateVO 生成字段
|
||||
@ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
#if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解
|
||||
#if (${field.fieldType} == 'String')
|
||||
@NotEmpty(message = "${column.columnComment}不能为空")
|
||||
|
@@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
#end
|
||||
#end
|
||||
|
||||
@ApiModel("${sceneEnum.name} - ${table.classComment}创建 Request VO")
|
||||
@Schema(title = "${sceneEnum.name} - ${table.classComment}创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -16,18 +16,18 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
#end
|
||||
## 字段模板
|
||||
#macro(columnTpl $prefix $prefixStr)
|
||||
@ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
||||
#end
|
||||
|
||||
@ApiModel(value = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
|
||||
@Schema(title = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
|
||||
@Data
|
||||
public class ${sceneEnum.prefixClass}${table.className}ExportReqVO {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if (${column.listOperation})##查询操作
|
||||
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
||||
@ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private ${column.javaType}[] ${column.javaField};
|
||||
#else##情况二,非 Between 的时间
|
||||
|
@@ -16,11 +16,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
#end
|
||||
## 字段模板
|
||||
#macro(columnTpl $prefix $prefixStr)
|
||||
@ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
||||
#end
|
||||
|
||||
@ApiModel("${sceneEnum.name} - ${table.classComment}分页 Request VO")
|
||||
@Schema(title = "${sceneEnum.name} - ${table.classComment}分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@@ -29,7 +29,7 @@ public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PagePar
|
||||
#foreach ($column in $columns)
|
||||
#if (${column.listOperation})##查询操作
|
||||
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
||||
@ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private ${column.javaType}[] ${column.javaField};
|
||||
#else##情况二,非 Between 的时间
|
||||
|
@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
#end
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("${sceneEnum.name} - ${table.classComment} Response VO")
|
||||
@Schema(title = "${sceneEnum.name} - ${table.classComment} Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@@ -16,7 +16,7 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO extends ${sceneEnu
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if (${column.listOperationResult} && (!${column.createOperation} || !${column.updateOperation}))##不是通用字段
|
||||
@ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
@Schema(title = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||
private ${column.javaType} ${column.javaField};
|
||||
|
||||
#end
|
||||
|
@@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
#end
|
||||
#end
|
||||
|
||||
@ApiModel("${sceneEnum.name} - ${table.classComment}更新 Request VO")
|
||||
@Schema(title = "${sceneEnum.name} - ${table.classComment}更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
Reference in New Issue
Block a user