editRequest.ftl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package ${code.packageName}.model.request;
  2. import lombok.Data;
  3. <#list code.propertys as property>
  4. <#if property.type = 'Date'>
  5. import java.util.Date;
  6. <#break>
  7. </#if>
  8. </#list>
  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 Edit${code.className}Request {
  18. @NotNull
  19. private Long id;
  20. <#list code.propertys as property>
  21. <#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'>
  22. <#continue>
  23. </#if>
  24. /**
  25. * ${property.label}
  26. */
  27. <#if property.required = '1' && property.type = 'String'>
  28. @NotBlank(message="${property.label}不能为空")
  29. </#if>
  30. <#if property.length?? && property.type = 'String'>
  31. @Size(max=${property.length},message="${property.label}长度不能超过{max}位")
  32. </#if>
  33. <#if property.required = '1' && property.type != 'String'>
  34. @NotNull(message="${property.label}不能为空")
  35. </#if>
  36. <#if property.type = 'Text'>
  37. private String ${property.name};
  38. <#elseif property.type= 'bigint'>
  39. private Long ${property.name};
  40. <#else>
  41. private ${property.type} ${property.name};
  42. </#if>
  43. </#list>
  44. }