项目模块初步完成
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package ${parentPackage}.${dtoPackage};
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -10,7 +12,13 @@ import java.io.Serializable;
|
||||
* ${entityComment}添加请求体
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "${entityComment}添加请求体", requiredProperties = {"name", "categoryId", "price", "image", "period", "isShelves"})
|
||||
@Schema(description = "${entityComment}添加请求体", requiredProperties = {
|
||||
#foreach($field in ${table.fields})
|
||||
#if(!$field.keyFlag && $field.propertyName != "id" && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
"${field.propertyName}",
|
||||
#end
|
||||
#end
|
||||
})
|
||||
public class ${entityName}AddRequest implements Serializable {
|
||||
|
||||
#foreach($field in ${table.fields})
|
||||
@ -18,7 +26,13 @@ public class ${entityName}AddRequest implements Serializable {
|
||||
/**
|
||||
* ${field.comment}
|
||||
*/
|
||||
@Schema(description = "${field.comment}", example = "${field.example}")
|
||||
#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};
|
||||
|
||||
#end
|
||||
@ -27,3 +41,4 @@ public class ${entityName}AddRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user