文件模块初步完成

This commit is contained in:
2025-05-06 19:15:01 +08:00
parent 2eb5ee1207
commit e1458e937b
21 changed files with 763 additions and 24 deletions

View File

@ -10,7 +10,7 @@ import jakarta.validation.Valid;
* ${entityComment} 控制器
*/
@RestController
@RequestMapping("${tableName}")
@RequestMapping("${entityNameLower}")
@Slf4j
@Tag(name = "${entityComment}管理")
public class ${entityName}Controller {
@ -28,6 +28,8 @@ public class ${entityName}Controller {
*/
@PostMapping("add")
@Operation(summary = "web端管理员添加${entityComment}", description = "参数:${entityComment}添加请求体权限管理员方法名add${entityName}")
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
@SysLog(title = "${entityComment}管理", content = "web端管理员添加${entityComment}")
public BaseResponse<Boolean> add${entityName}(@Valid @RequestBody ${entityName}AddRequest ${entityNameLower}AddRequest) {
${entityName} ${entityNameLower} = commonService.copyProperties(${entityNameLower}AddRequest, ${entityName}.class);
${entityNameLower}Service.save(${entityNameLower});

View File

@ -16,21 +16,17 @@ import com.greenorange.promotion.common.PageRequest;
@Schema(description = "${entityComment}查询请求体", requiredProperties = {"current", "pageSize"})
public class ${entityName}QueryRequest extends PageRequest implements Serializable {
/**
* ${entityComment} ID
*/
@Schema(description = "${entityComment} ID", example = "1")
@Min(value = 1L, message = "${entityComment} ID不能小于1")
private Long id;
#foreach($field in ${table.fields})
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
/**
* ${field.comment}
*/
#if($field.propertyType == "String")
@NotBlank(message = "${field.comment}不能为空")
#end
#if($field.propertyType == "Long")
@Min(value = 1L, message = "${field.comment} ID不能小于1")
#end
@Schema(description = "${field.comment}", example = "")
private ${field.propertyType} ${field.propertyName};

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
@Data
@Schema(description = "${entityComment}更新请求体", requiredProperties = {
#foreach($field in ${table.fields})
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
"${field.propertyName}",
#end
#end
@ -22,7 +22,7 @@ import java.io.Serializable;
public class ${entityName}UpdateRequest implements Serializable {
#foreach($field in ${table.fields})
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
/**
* ${field.comment}
*/
@ -30,7 +30,7 @@ public class ${entityName}UpdateRequest implements Serializable {
@NotBlank(message = "${field.comment}不能为空")
#end
#if($field.propertyType == "Long")
@Min(value = 1L, message = "${field.comment} ID不能小于1")
@Min(value = 1L, message = "${field.comment} ID不能小于1")
#end
@Schema(description = "${field.comment}", example = "")
private ${field.propertyType} ${field.propertyName};

View File

@ -15,9 +15,9 @@ import java.math.BigDecimal;
public class ${entityName}VO implements Serializable {
/**
* ${entityComment} ID
* ${entityComment}ID
*/
@Schema(description = "${entityComment} ID", example = "1")
@Schema(description = "${entityComment}ID", example = "1")
private Long id;
#foreach($field in ${table.fields})