提交 0a36190c 编写于 作者: zhouweidong's avatar zhouweidong

补充swagger注解,用于实体及属性逻辑名称

上级 93690ea5
...@@ -28,6 +28,8 @@ import java.io.Serializable; ...@@ -28,6 +28,8 @@ import java.io.Serializable;
import lombok.*; import lombok.*;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import ${pub.getPKGCodeName()}.util.annotation.Audit; import ${pub.getPKGCodeName()}.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
<#comment>SQL存储-Mybatis</#comment> <#comment>SQL存储-Mybatis</#comment>
<#if de.getStorageMode()==1> <#if de.getStorageMode()==1>
...@@ -46,6 +48,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; ...@@ -46,6 +48,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@TableName(value = "${item.getTableName()}", resultMap = "${item.codeName}ResultMap") @TableName(value = "${item.getTableName()}", resultMap = "${item.codeName}ResultMap")
@ApiModel("${item.getLogicName()}")
public class ${item.getCodeName()} extends EntityMP implements Serializable { public class ${item.getCodeName()} extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -175,6 +178,7 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable { ...@@ -175,6 +178,7 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable {
@JSONField(name = "${jsonfield}") @JSONField(name = "${jsonfield}")
</#if> </#if>
@JsonProperty("${jsonfield}") @JsonProperty("${jsonfield}")
@ApiModelProperty("${defield.getLogicName()}")
private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName};
</#if> </#if>
</#list> </#list>
...@@ -413,6 +417,7 @@ import ${pub.getPKGCodeName()}.util.domain.EntityMongo; ...@@ -413,6 +417,7 @@ import ${pub.getPKGCodeName()}.util.domain.EntityMongo;
*/ */
@Data @Data
@Document(collection = "${item.getCodeName()?lower_case}") @Document(collection = "${item.getCodeName()?lower_case}")
@ApiModel("${item.getLogicName()}")
public class ${item.getCodeName()} extends EntityMongo implements Serializable { public class ${item.getCodeName()} extends EntityMongo implements Serializable {
<#if de.getPSDEFields()??> <#if de.getPSDEFields()??>
...@@ -484,6 +489,7 @@ public class ${item.getCodeName()} extends EntityMongo implements Serializable { ...@@ -484,6 +489,7 @@ public class ${item.getCodeName()} extends EntityMongo implements Serializable {
<#if defield.isKeyDEField()==false> <#if defield.isKeyDEField()==false>
@Field(name = "${columnname}") @Field(name = "${columnname}")
</#if> </#if>
@ApiModelProperty("${defield.getLogicName()}")
private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName};
</#if> </#if>
...@@ -583,6 +589,7 @@ import ${pub.getPKGCodeName()}.util.domain.EntityClient; ...@@ -583,6 +589,7 @@ import ${pub.getPKGCodeName()}.util.domain.EntityClient;
* ServiceApi [${item.getLogicName()}] 对象 * ServiceApi [${item.getLogicName()}] 对象
*/ */
@Data @Data
@ApiModel("${item.getLogicName()}")
public class ${item.getCodeName()} extends EntityClient implements Serializable { public class ${item.getCodeName()} extends EntityClient implements Serializable {
<#if de.getPSDEFields()??> <#if de.getPSDEFields()??>
...@@ -649,6 +656,7 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable ...@@ -649,6 +656,7 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable
@JSONField(name = "${jsonfield}") @JSONField(name = "${jsonfield}")
</#if> </#if>
@JsonProperty("${jsonfield}") @JsonProperty("${jsonfield}")
@ApiModelProperty("${defield.getLogicName()}")
private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName};
</#if> </#if>
...@@ -791,6 +799,7 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable ...@@ -791,6 +799,7 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ApiModel("${item.getLogicName()}")
public class ${item.getCodeName()} extends EntityBase implements Serializable { public class ${item.getCodeName()} extends EntityBase implements Serializable {
<#if de.getPSDEFields()??> <#if de.getPSDEFields()??>
...@@ -857,6 +866,7 @@ public class ${item.getCodeName()} extends EntityBase implements Serializable { ...@@ -857,6 +866,7 @@ public class ${item.getCodeName()} extends EntityBase implements Serializable {
@JSONField(name = "${jsonfield}") @JSONField(name = "${jsonfield}")
</#if> </#if>
@JsonProperty("${jsonfield}") @JsonProperty("${jsonfield}")
@ApiModelProperty("${defield.getLogicName()}")
private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(defield.getStdDataType())} ${prvateCodeName};
</#if> </#if>
......
...@@ -48,12 +48,15 @@ import lombok.Data; ...@@ -48,12 +48,15 @@ import lombok.Data;
<#if hasValueRuleGroup> <#if hasValueRuleGroup>
import ${pub.getPKGCodeName()}.util.annotation.ValueRuleCheck; import ${pub.getPKGCodeName()}.util.annotation.ValueRuleCheck;
</#if> </#if>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/** /**
* 服务DTO对象[${item.getCodeName()}DTO] * 服务DTO对象[${item.getCodeName()}DTO]
*/ */
@Data @Data
<@valueRuleGroup/> <@valueRuleGroup/>
@ApiModel("${item.getLogicName()}")
public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable { public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -90,6 +93,7 @@ public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable ...@@ -90,6 +93,7 @@ public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
</#if> </#if>
<@valueRule defield /> <@valueRule defield />
@ApiModelProperty("${apifield.getLogicName()}")
private ${srfr7javatype(apifield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(apifield.getStdDataType())} ${prvateCodeName};
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册