修复代码生成模板中未更新至swagger3的bug
parent
1dbcf4ad7b
commit
251c217a40
|
@ -1,15 +1,17 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName};
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName};
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
#if ($sceneEnum.scene == 1)import org.springframework.security.access.prepost.PreAuthorize;#end
|
#if ($sceneEnum.scene == 1)import org.springframework.security.access.prepost.PreAuthorize;#end
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import jakarta.annotation.Resource;
|
||||||
import javax.validation.*;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.*;
|
import jakarta.validation.Valid;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -22,12 +24,13 @@ import ${ExcelUtilsClassName};
|
||||||
import ${OperateLogClassName};
|
import ${OperateLogClassName};
|
||||||
import static ${OperateTypeEnumClassName}.*;
|
import static ${OperateTypeEnumClassName}.*;
|
||||||
|
|
||||||
|
import ${basePackage}.framework.operatelog.core.annotations.OperateLog;
|
||||||
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
|
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
|
||||||
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
|
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
|
||||||
import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert;
|
import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert;
|
||||||
import ${basePackage}.module.${table.moduleName}.service.${table.businessName}.${table.className}Service;
|
import ${basePackage}.module.${table.moduleName}.service.${table.businessName}.${table.className}Service;
|
||||||
|
|
||||||
@Api(tags = "${sceneEnum.name} - ${table.classComment}")
|
@Tag(name = "${sceneEnum.name} - ${table.classComment}")
|
||||||
@RestController
|
@RestController
|
||||||
##二级的 businessName 暂时不算在 HTTP 路径上,可以根据需要写
|
##二级的 businessName 暂时不算在 HTTP 路径上,可以根据需要写
|
||||||
@RequestMapping("/${table.moduleName}/${simpleClassName_strikeCase}")
|
@RequestMapping("/${table.moduleName}/${simpleClassName_strikeCase}")
|
||||||
|
@ -38,72 +41,79 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||||
private ${table.className}Service ${classNameVar}Service;
|
private ${table.className}Service ${classNameVar}Service;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@ApiOperation("创建${table.classComment}")
|
@Operation(summary = "创建${table.classComment}")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")#end
|
#if ($sceneEnum.scene == 1)
|
||||||
|
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")
|
||||||
|
#end
|
||||||
public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) {
|
public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) {
|
||||||
return success(${classNameVar}Service.create${simpleClassName}(createReqVO));
|
return success(${classNameVar}Service.create${simpleClassName}(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@ApiOperation("更新${table.classComment}")
|
@Operation(summary = "更新${table.classComment}")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:update')")#end
|
#if ($sceneEnum.scene == 1)
|
||||||
|
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:update')")
|
||||||
|
#end
|
||||||
public CommonResult<Boolean> update${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) {
|
public CommonResult<Boolean> update${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) {
|
||||||
${classNameVar}Service.update${simpleClassName}(updateReqVO);
|
${classNameVar}Service.update${simpleClassName}(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@ApiOperation("删除${table.classComment}")
|
@Operation(summary = "删除${table.classComment}")
|
||||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = ${primaryColumn.javaType}.class)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")#end
|
#if ($sceneEnum.scene == 1)
|
||||||
|
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")
|
||||||
|
#end
|
||||||
public CommonResult<Boolean> delete${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
public CommonResult<Boolean> delete${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
||||||
${classNameVar}Service.delete${simpleClassName}(id);
|
${classNameVar}Service.delete${simpleClassName}(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@ApiOperation("获得${table.classComment}")
|
@Operation(summary = "获得${table.classComment}")
|
||||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = ${primaryColumn.javaType}.class)
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
#if ($sceneEnum.scene == 1)
|
||||||
|
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
|
||||||
|
#end
|
||||||
public CommonResult<${sceneEnum.prefixClass}${table.className}RespVO> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
public CommonResult<${sceneEnum.prefixClass}${table.className}RespVO> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
|
||||||
${table.className}DO ${classNameVar} = ${classNameVar}Service.get${simpleClassName}(id);
|
${table.className}DO ${classNameVar} = ${classNameVar}Service.get${simpleClassName}(id);
|
||||||
return success(${table.className}Convert.INSTANCE.convert(${classNameVar}));
|
return success(${table.className}Convert.INSTANCE.convert(${classNameVar}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("获得${table.classComment}列表")
|
@Operation(summary = "获得${table.classComment}列表")
|
||||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
#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) {
|
public CommonResult<List<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}List(@RequestParam("ids") Collection<${primaryColumn.javaType}> ids) {
|
||||||
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(ids);
|
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(ids);
|
||||||
return success(${table.className}Convert.INSTANCE.convertList(list));
|
return success(${table.className}Convert.INSTANCE.convertList(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@ApiOperation("获得${table.classComment}分页")
|
@Operation(summary = "获得${table.classComment}分页")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end
|
#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) {
|
public CommonResult<PageResult<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageVO) {
|
||||||
PageResult<${table.className}DO> pageResult = ${classNameVar}Service.get${simpleClassName}Page(pageVO);
|
PageResult<${table.className}DO> pageResult = ${classNameVar}Service.get${simpleClassName}Page(pageVO);
|
||||||
return success(${table.className}Convert.INSTANCE.convertPage(pageResult));
|
return success(${table.className}Convert.INSTANCE.convertPage(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@ApiOperation("导出${table.classComment} Excel")
|
@Operation(summary = "导出${table.classComment} Excel")
|
||||||
#if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:export')")#end
|
#if ($sceneEnum.scene == 1)
|
||||||
|
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:export')")
|
||||||
|
#end
|
||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void export${simpleClassName}Excel(@Valid ${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO,
|
public void export${simpleClassName}Excel(@Valid ${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(exportReqVO);
|
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(exportReqVO);
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
List<${sceneEnum.prefixClass}${table.className}ExcelVO> datas = ${table.className}Convert.INSTANCE.convertList02(list);
|
List<${sceneEnum.prefixClass}${table.className}ExcelVO> datas = ${table.className}Convert.INSTANCE.convertList02(list);
|
||||||
ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${sceneEnum.prefixClass}${table.className}ExcelVO.class, datas);
|
ExcelUtils.write(response, "${table.classComment}.xls","数据", ${sceneEnum.prefixClass}${table.className}ExcelVO.class, datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
## @formatter:off
|
||||||
## 提供给 baseVO、createVO、updateVO 生成字段
|
## 提供给 baseVO、createVO、updateVO 生成字段
|
||||||
@ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
@Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
#if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解
|
#if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解
|
||||||
#if (${field.fieldType} == 'String')
|
#if (${field.fieldType} == 'String')
|
||||||
@NotEmpty(message = "${column.columnComment}不能为空")
|
@NotEmpty(message = "${column.columnComment}不能为空")
|
||||||
|
@ -10,4 +11,4 @@
|
||||||
#if (${column.javaType} == "LocalDateTime")## 时间类型
|
#if (${column.javaType} == "LocalDateTime")## 时间类型
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
#end
|
#end
|
||||||
private ${column.javaType} ${column.javaField};
|
private ${column.javaType} ${column.javaField};
|
|
@ -1,3 +1,4 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
@ -10,12 +11,11 @@ import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import javax.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
## 处理 Date 字段的引入
|
## 处理 Date 字段的引入
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.createOperation} && ${column.updateOperation} && ${column.listOperationResult}
|
#if (${column.createOperation} && ${column.updateOperation} && ${column.listOperationResult} && ${column.javaType} == "LocalDateTime")## 时间类型
|
||||||
&& ${column.javaType} == "LocalDateTime")## 时间类型
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import javax.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
## 处理 Date 字段的引入
|
## 处理 Date 字段的引入
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.createOperation} && (!${column.updateOperation} || !${column.listOperationResult})
|
#if (${column.createOperation} && (!${column.updateOperation} || !${column.listOperationResult}) && ${column.javaType} == "LocalDateTime")## 时间类型
|
||||||
&& ${column.javaType} == "LocalDateTime")## 时间类型
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ApiModel("${sceneEnum.name} - ${table.classComment}创建 Request VO")
|
@Schema(name = "${sceneEnum.name} - ${table.classComment}创建 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
@ -10,8 +11,6 @@ import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
import io.swagger.annotations.*;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if ("$!column.dictType" != "")## 有设置数据字典
|
#if ("$!column.dictType" != "")## 有设置数据字典
|
||||||
|
@ -23,10 +22,10 @@ import ${DictConvertClassName};
|
||||||
#end
|
#end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${table.classComment} Excel VO
|
* ${table.classComment} Excel VO
|
||||||
*
|
*
|
||||||
* @author ${table.author}
|
* @author ${table.author}
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ${sceneEnum.prefixClass}${table.className}ExcelVO {
|
public class ${sceneEnum.prefixClass}${table.className}ExcelVO {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import ${PageParamClassName};
|
import ${PageParamClassName};
|
||||||
## 处理 Date 字段的引入
|
## 处理 Date 字段的引入
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
@ -16,18 +17,18 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
#end
|
#end
|
||||||
## 字段模板
|
## 字段模板
|
||||||
#macro(columnTpl $prefix $prefixStr)
|
#macro(columnTpl $prefix $prefixStr)
|
||||||
@ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
@Schema(description = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ApiModel(value = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
|
@Schema(name = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
|
||||||
@Data
|
@Data
|
||||||
public class ${sceneEnum.prefixClass}${table.className}ExportReqVO {
|
public class ${sceneEnum.prefixClass}${table.className}ExportReqVO {
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.listOperation})##查询操作
|
#if (${column.listOperation})##查询操作
|
||||||
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
||||||
@ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
@Schema(description = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private ${column.javaType}[] ${column.javaField};
|
private ${column.javaType}[] ${column.javaField};
|
||||||
#else##情况二,非 Between 的时间
|
#else##情况二,非 Between 的时间
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import ${PageParamClassName};
|
import ${PageParamClassName};
|
||||||
## 处理 Date 字段的引入
|
## 处理 Date 字段的引入
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
@ -16,11 +17,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
#end
|
#end
|
||||||
## 字段模板
|
## 字段模板
|
||||||
#macro(columnTpl $prefix $prefixStr)
|
#macro(columnTpl $prefix $prefixStr)
|
||||||
@ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
@Schema(description = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ApiModel("${sceneEnum.name} - ${table.classComment}分页 Request VO")
|
@Schema(name = "${sceneEnum.name} - ${table.classComment}分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
@ -29,7 +30,7 @@ public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PagePar
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.listOperation})##查询操作
|
#if (${column.listOperation})##查询操作
|
||||||
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
|
||||||
@ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
@Schema(description = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private ${column.javaType}[] ${column.javaField};
|
private ${column.javaType}[] ${column.javaField};
|
||||||
#else##情况二,非 Between 的时间
|
#else##情况二,非 Between 的时间
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.javaType} == "LocalDateTime")
|
#if (${column.javaType} == "LocalDateTime")
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
import io.swagger.annotations.*;
|
|
||||||
|
|
||||||
@ApiModel("${sceneEnum.name} - ${table.classComment} Response VO")
|
@Schema(name = "${sceneEnum.name} - ${table.classComment} Response VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
@ -17,7 +18,7 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO extends ${sceneEnu
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.listOperationResult} && (!${column.createOperation} || !${column.updateOperation}))##不是通用字段
|
#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(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
|
||||||
private ${column.javaType} ${column.javaField};
|
private ${column.javaType} ${column.javaField};
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
## @formatter:off
|
||||||
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import javax.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
## 处理 Date 字段的引入
|
## 处理 Date 字段的引入
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.updateOperation} && (!${column.createOperation} || !${column.listOperationResult})
|
#if (${column.updateOperation} && (!${column.createOperation} || !${column.listOperationResult}) && ${column.javaType} == "LocalDateTime")## 时间类型
|
||||||
&& ${column.javaType} == "LocalDateTime")## 时间类型
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ApiModel("${sceneEnum.name} - ${table.classComment}更新 Request VO")
|
@Schema(name = "${sceneEnum.name} - ${table.classComment}更新 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
|
Loading…
Reference in New Issue