addRequest.ftl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package ${code.packageName}.model.request;
  2. <#list code.propertys as property>
  3. <#if property.type = 'Date'>
  4. import java.util.Date;
  5. <#break>
  6. </#if>
  7. </#list>
  8. import lombok.Data;
  9. import javax.validation.constraints.NotEmpty;
  10. import javax.validation.constraints.NotNull;
  11. import javax.validation.constraints.Size;
  12. /**
  13. * @author ${code.author}
  14. * @date ${.now?string('yyyy-MM-dd')}
  15. */
  16. @Data
  17. public class Add${code.className}Request {
  18. <#list code.propertys as property>
  19. <#if property.name = 'create_user_id' || property.name= 'create_user_name' || property.name= 'create_time' || property.name= 'update_user_id' || property.name= 'update_user_name' || property.name= 'update_time' || property.name= 'delete_flag' || property.name= 'version'>
  20. <#continue>
  21. </#if>
  22. /**
  23. *${property.label}
  24. */
  25. <#if property.required = '1' && property.type = 'String'>
  26. @NotBlank(message="${property.label}不能为空")
  27. </#if>
  28. <#if property.length?? && property.type = 'String'>
  29. @Size(max=${property.length},message="${property.label}长度不能超过{max}位")
  30. </#if>
  31. <#if property.required = '1' && property.type != 'String'>
  32. @NotNull(message="${property.label}不能为空")
  33. </#if>
  34. <#if property.type = 'Text'>
  35. private String ${property.name};
  36. <#elseif property.type= 'bigint'>
  37. private Long ${property.name};
  38. <#else>
  39. private ${property.type} ${property.name};
  40. </#if>
  41. </#list>
  42. }