add.dto.java.ftl 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package ${package};
  2. import io.swagger.annotations.ApiModelProperty;
  3. import lombok.Data;
  4. import java.io.Serializable;
  5. import com.fasterxml.jackson.annotation.JsonFormat;
  6. import java.time.LocalTime;
  7. import java.time.LocalDateTime;
  8. import java.math.BigDecimal;
  9. import java.util.List;
  10. import java.util.Date;
  11. <#--子表遍历-->
  12. <#if childTables?? >
  13. <#list childTables as childTable>
  14. import com.xjrsoft.module.${outputArea}.entity.${childTable.tableName?cap_first};
  15. </#list>
  16. </#if>
  17. /**
  18. * @title: ${tableComment}
  19. * @Author ${author}
  20. * @Date: ${date}
  21. * @Version 1.0
  22. */
  23. @Data
  24. public class Add${entityClass}Dto implements Serializable {
  25. private static final long serialVersionUID = 1L;
  26. <#--属性遍历-->
  27. <#list fields as field>
  28. /**
  29. * ${field.fieldComment}
  30. */
  31. @ApiModelProperty("${field.fieldComment}")
  32. <#if field.fieldType == "LocalDateTime" && field.pattern??>
  33. @JsonFormat(pattern = "${field.pattern}")
  34. </#if>
  35. private ${field.fieldType} ${field.fieldName};
  36. </#list>
  37. <#--子表遍历-->
  38. <#if childTables?? >
  39. <#list childTables as childTable>
  40. /**
  41. * ${childTable.tableName}
  42. */
  43. @ApiModelProperty("${childTable.tableName}子表")
  44. private List<Add${childTable.tableName?cap_first}Dto> ${childTable.tableName?uncap_first}List;
  45. </#list>
  46. </#if>
  47. }