提交 2e140383 编写于 作者: sq3536's avatar sq3536

模板切分

上级 51dc33bc
...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}}; ...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}};
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends BaseData implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty(value = "{{columnName}}",name = "{{jsonName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
@JSONField(name = "{{lowerCase codeName}}") @JSONField(name = "{{lowerCase codeName}}")
@JsonProperty("{{lowerCase codeName}}") @JsonProperty("{{lowerCase codeName}}")
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#if listCode}} {{#if listCode}}
@JSONField(name = "{{listCode}}") @JSONField(name = "{{listCode}}")
@JsonProperty("{{listCode}}") @JsonProperty("{{listCode}}")
@ApiModelProperty(value = "{{lowerCase listCode}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase listCode}}", notes = "{{logicName}}")
{{else}} {{else}}
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
private List<{{entityCodeName}}> {{camelCase codeName}}; private List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
......
...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}}; ...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}};
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends BaseData implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty(value = "{{columnName}}",name = "{{jsonName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
@JSONField(name = "{{lowerCase codeName}}") @JSONField(name = "{{lowerCase codeName}}")
@JsonProperty("{{lowerCase codeName}}") @JsonProperty("{{lowerCase codeName}}")
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#if listCode}} {{#if listCode}}
@JSONField(name = "{{listCode}}") @JSONField(name = "{{listCode}}")
@JsonProperty("{{listCode}}") @JsonProperty("{{listCode}}")
@ApiModelProperty(value = "{{lowerCase listCode}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase listCode}}", notes = "{{logicName}}")
{{else}} {{else}}
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
private List<{{entityCodeName}}> {{camelCase codeName}}; private List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
......
...@@ -37,7 +37,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}}; ...@@ -37,7 +37,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}};
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@TableName(value = "{{entity.tableName}}", resultMap = "{{entity.codeName}}ResultMap") @TableName(value = "{{entity.tableName}}", resultMap = "{{entity.codeName}}ResultMap")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends BaseData implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
...@@ -67,7 +67,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -67,7 +67,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty(value = "{{columnName}}",name = "{{jsonName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -80,7 +80,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -80,7 +80,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -97,10 +97,10 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -97,10 +97,10 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{/if}} {{/if}}
{{#if columnName}} {{#if columnName}}
@TableField(value = "{{columnName}}" , typeHandler = {{packageName}}.{{module}}.domain.handlers.{{entityCodeName}}TypeHandler.class) @TableField(value = "{{columnName}}" , typeHandler = {{packageName}}.{{module}}.domain.handlers.{{entityCodeName}}TypeHandler.class)
@ApiModelProperty(value = "{{columnName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
{{else}} {{else}}
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
protected List<{{entityCodeName}}> {{camelCase codeName}}; protected List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
......
...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}}; ...@@ -33,7 +33,7 @@ import {{packageName}}.{{module}}.domain.{{codeName}};
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends BaseData implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -53,7 +53,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty(value = "{{columnName}}",name = "{{jsonName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -65,7 +65,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
@JSONField(name = "{{lowerCase codeName}}") @JSONField(name = "{{lowerCase codeName}}")
@JsonProperty("{{lowerCase codeName}}") @JsonProperty("{{lowerCase codeName}}")
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -76,11 +76,11 @@ public class {{entity.codeName}} extends BaseData implements Serializable
{{#if listCode}} {{#if listCode}}
@JSONField(name = "{{listCode}}") @JSONField(name = "{{listCode}}")
@JsonProperty("{{listCode}}") @JsonProperty("{{listCode}}")
@ApiModelProperty(value = "{{lowerCase listCode}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase listCode}}", notes = "{{logicName}}")
{{else}} {{else}}
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@ApiModelProperty(value = "{{lowerCase codeName}}",name = "{{lowerCase codeName}}",notes = "{{logicName}}") @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
private List<{{entityCodeName}}> {{camelCase codeName}}; private List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
......
...@@ -28,6 +28,7 @@ import java.io.Serializable; ...@@ -28,6 +28,7 @@ import java.io.Serializable;
import lombok.*; import lombok.*;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import org.springframework.data.annotation.Id;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -39,7 +40,7 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}}; ...@@ -39,7 +40,7 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}};
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends EntityBase implements Serializable public class {{entity.codeName}} extends EntityBase implements Serializable
{ {
...@@ -48,6 +49,9 @@ public class {{entity.codeName}} extends EntityBase implements Serializable ...@@ -48,6 +49,9 @@ public class {{entity.codeName}} extends EntityBase implements Serializable
/** /**
* {{logicName}} * {{logicName}}
*/ */
{{#if keyDEField}}
@Id
{{/if}}
{{#enableAudit}} {{#enableAudit}}
@Audit @Audit
{{/enableAudit}} {{/enableAudit}}
...@@ -60,7 +64,7 @@ public class {{entity.codeName}} extends EntityBase implements Serializable ...@@ -60,7 +64,7 @@ public class {{entity.codeName}} extends EntityBase implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty("{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -72,6 +76,7 @@ public class {{entity.codeName}} extends EntityBase implements Serializable ...@@ -72,6 +76,7 @@ public class {{entity.codeName}} extends EntityBase implements Serializable
*/ */
@JSONField(name = "{{lowerCase codeName}}") @JSONField(name = "{{lowerCase codeName}}")
@JsonProperty("{{lowerCase codeName}}") @JsonProperty("{{lowerCase codeName}}")
@ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -82,9 +87,11 @@ public class {{entity.codeName}} extends EntityBase implements Serializable ...@@ -82,9 +87,11 @@ public class {{entity.codeName}} extends EntityBase implements Serializable
{{#if listCode}} {{#if listCode}}
@JSONField(name = "{{listCode}}") @JSONField(name = "{{listCode}}")
@JsonProperty("{{listCode}}") @JsonProperty("{{listCode}}")
@ApiModelProperty(value = "{{lowerCase listCode}}", notes = "{{logicName}}")
{{else}} {{else}}
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
private List<{{entityCodeName}}> {{camelCase codeName}}; private List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
......
...@@ -29,6 +29,7 @@ import java.io.Serializable; ...@@ -29,6 +29,7 @@ import java.io.Serializable;
import lombok.*; import lombok.*;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import org.springframework.data.annotation.Id;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -43,8 +44,8 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}}; ...@@ -43,8 +44,8 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}};
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@TableName(value = "{{entity.tableName}}", resultMap = "{{entity.codeName}}ResultMap") @TableName(value = "{{entity.tableName}}", resultMap = "{{entity.codeName}}ResultMap")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends EntityMP implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
{{#each entity.fields}} {{#each entity.fields}}
...@@ -53,6 +54,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -53,6 +54,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
* {{logicName}} * {{logicName}}
*/ */
{{#if keyDEField}} {{#if keyDEField}}
@Id
{{#if phisicalDEField}} {{#if phisicalDEField}}
@TableId(value = "{{columnName}}"{{#type.number}} , type = IdType.ASSIGN_ID{{/type.number}}{{#type.string}} , type = IdType.ASSIGN_UUID{{/type.string}}) @TableId(value = "{{columnName}}"{{#type.number}} , type = IdType.ASSIGN_ID{{/type.number}}{{#type.string}} , type = IdType.ASSIGN_UUID{{/type.string}})
{{else}} {{else}}
...@@ -61,7 +63,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -61,7 +63,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
{{else}} {{else}}
@TableField(value = "{{columnName}}"{{#insertOnly}} , fill = FieldFill.INSERT{{/insertOnly}}{{^phisicalDEField}} , exist = false{{/phisicalDEField}}) @TableField(value = "{{columnName}}"{{#insertOnly}} , fill = FieldFill.INSERT{{/insertOnly}}{{^phisicalDEField}} , exist = false{{/phisicalDEField}})
{{#logicValidField}} {{#logicValidField}}
@TableLogic{{#validLogicValue}}(value = "{{validLogicValue}}"{{#invalidLogicValue}} , delval = "{{invalidLogicValue}}"{{/invalidLogicValue}}){{/validLogicValue}} @TableLogic{{#entity.validLogicValue}}(value = "{{entity.validLogicValue}}"{{#entity.invalidLogicValue}} , delval = "{{entity.invalidLogicValue}}"{{/entity.invalidLogicValue}}){{/entity.validLogicValue}}
{{/logicValidField}} {{/logicValidField}}
{{/if}} {{/if}}
{{#enableAudit}} {{#enableAudit}}
...@@ -76,7 +78,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -76,7 +78,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty("{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -89,6 +91,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -89,6 +91,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -105,8 +108,10 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -105,8 +108,10 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
{{/if}} {{/if}}
{{#if columnName}} {{#if columnName}}
@TableField(value = "{{columnName}}" , typeHandler = {{packageName}}.core.{{module}}.domain.handlers.{{entityCodeName}}TypeHandler.class) @TableField(value = "{{columnName}}" , typeHandler = {{packageName}}.core.{{module}}.domain.handlers.{{entityCodeName}}TypeHandler.class)
@ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
{{else}} {{else}}
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}} {{/if}}
protected List<{{entityCodeName}}> {{camelCase codeName}}; protected List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -120,7 +125,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -120,7 +125,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase name}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
...@@ -135,7 +140,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable ...@@ -135,7 +140,7 @@ public class {{entity.codeName}} extends EntityMP implements Serializable
*/ */
public void set{{pascalCase codeName}}(List<{{entityCodeName}}> {{camelCase codeName}}) { public void set{{pascalCase codeName}}(List<{{entityCodeName}}> {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{columnName}}", ({{camelCase codeName}}!=null)?{{camelCase codeName}}:(new ArrayList())); this.modify("{{listCode}}", ({{camelCase codeName}}!=null)?{{camelCase codeName}}:(new ArrayList()));
} }
{{/columnName}} {{/columnName}}
......
...@@ -28,6 +28,7 @@ import java.io.Serializable; ...@@ -28,6 +28,7 @@ import java.io.Serializable;
import lombok.*; import lombok.*;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import org.springframework.data.annotation.Id;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -39,8 +40,8 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}}; ...@@ -39,8 +40,8 @@ import {{packageName}}.core.{{module}}.domain.{{codeName}};
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@ApiModel("{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends EntityClient implements Serializable public class {{entity.codeName}} extends BaseData implements Serializable
{ {
{{#each entity.fields}} {{#each entity.fields}}
...@@ -48,6 +49,9 @@ public class {{entity.codeName}} extends EntityClient implements Serializable ...@@ -48,6 +49,9 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
/** /**
* {{logicName}} * {{logicName}}
*/ */
{{#if keyDEField}}
@Id
{{/if}}
{{#enableAudit}} {{#enableAudit}}
@Audit @Audit
{{/enableAudit}} {{/enableAudit}}
...@@ -60,7 +64,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable ...@@ -60,7 +64,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
{{#eq type.java "Long"}} {{#eq type.java "Long"}}
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
{{/eq}} {{/eq}}
@ApiModelProperty("{{logicName}}") @ApiModelProperty(value = "{{columnName}}", notes = "{{logicName}}")
private {{type.java}} {{camelCase codeName}}; private {{type.java}} {{camelCase codeName}};
{{/unless}} {{/unless}}
...@@ -72,6 +76,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable ...@@ -72,6 +76,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
*/ */
@JSONField(name = "{{lowerCase codeName}}") @JSONField(name = "{{lowerCase codeName}}")
@JsonProperty("{{lowerCase codeName}}") @JsonProperty("{{lowerCase codeName}}")
@ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
private {{entityCodeName}} {{camelCase codeName}}; private {{entityCodeName}} {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -82,10 +87,12 @@ public class {{entity.codeName}} extends EntityClient implements Serializable ...@@ -82,10 +87,12 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
{{#if listCode}} {{#if listCode}}
@JSONField(name = "{{listCode}}") @JSONField(name = "{{listCode}}")
@JsonProperty("{{listCode}}") @JsonProperty("{{listCode}}")
{{else}} @ApiModelProperty(value = "{{lowerCase listCode}}", notes = "{{logicName}}")
{{else}}
@JsonIgnore @JsonIgnore
@JSONField(serialize = false) @JSONField(serialize = false)
{{/if}} @ApiModelProperty(value = "{{lowerCase codeName}}", notes = "{{logicName}}")
{{/if}}
private List<{{entityCodeName}}> {{camelCase codeName}}; private List<{{entityCodeName}}> {{camelCase codeName}};
{{/each}} {{/each}}
...@@ -98,7 +105,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable ...@@ -98,7 +105,7 @@ public class {{entity.codeName}} extends EntityClient implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase codeName}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册