Files
qingcheng-houduan/src/main/resources/templates/dto/Addrequest.java.vm

45 lines
1.4 KiB
Plaintext
Raw Normal View History

2025-04-01 11:48:31 +08:00
package ${parentPackage}.${dtoPackage};
import io.swagger.v3.oas.annotations.media.Schema;
2025-05-06 16:38:42 +08:00
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Min;
2025-04-01 11:48:31 +08:00
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* ${entityComment}添加请求体
*/
@Data
2025-05-06 16:38:42 +08:00
@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
})
2025-04-01 11:48:31 +08:00
public class ${entityName}AddRequest implements Serializable {
#foreach($field in ${table.fields})
#if(!$field.keyFlag && $field.propertyName != "id" && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
/**
* ${field.comment}
*/
2025-05-06 16:38:42 +08:00
#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 = "")
2025-04-01 11:48:31 +08:00
private ${field.propertyType} ${field.propertyName};
#end
#end
@Serial
private static final long serialVersionUID = 1L;
}
2025-05-06 16:38:42 +08:00