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

模板切分

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