SocialNetworks/demo/target/test-classes/templates/pageVo.java.vm

114 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

package ${package.Parent}.model.vo;
#foreach($pkg in ${table.importPackages})
import ${pkg};
#end
import io.swagger.v3.oas.annotations.media.Schema;
#if(${entityLombokModel})
import lombok.Getter;
import lombok.Setter;
#if(${chainModel})
import lombok.experimental.Accessors;
#end
#end
/**
* $!{table.comment} 分页VO
*
* @author ${author}
* @since ${date}
*/
#if(${entityLombokModel})
@Getter
@Setter
#if(${chainModel})
@Accessors(chain = true)
#end
#end
@Schema( description = "$!{table.comment}分页视图对象")
#if(${superEntityClass})
public class ${entity}PageVO extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
#elseif(${activeRecord})
public class ${entity}PageVO extends Model<${entity}> {
#elseif(${entitySerialVersionUID})
public class ${entity}PageVO implements Serializable {
#else
public class ${entity}PageVO {
#end
#if(${entitySerialVersionUID})
private static final long serialVersionUID = 1L;
#end
## ---------- BEGIN 字段循环遍历 ----------
#foreach($field in ${table.fields})
#if(${field.keyFlag})
#set($keyPropertyName=${field.propertyName})
#end
#if("$!field.comment" != "")
@Schema(description = "${field.comment}")
#end
private ${field.propertyType} ${field.propertyName};
#end
## ---------- END 字段循环遍历 ----------
#if(!${entityLombokModel})
#foreach($field in ${table.fields})
#if(${field.propertyType.equals("boolean")})
#set($getprefix="is")
#else
#set($getprefix="get")
#end
public ${field.propertyType} ${getprefix}${field.capitalName}() {
return ${field.propertyName};
}
#if(${chainModel})
public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
#else
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
#end
this.${field.propertyName} = ${field.propertyName};
#if(${chainModel})
return this;
#end
}
#end
## --foreach end---
#end
## --end of #if(!${entityLombokModel})--
#if(${entityColumnConstant})
#foreach($field in ${table.fields})
public static final String ${field.name.toUpperCase()} = "${field.name}";
#end
#end
#if(${activeRecord})
@Override
public Serializable pkVal() {
#if(${keyPropertyName})
return this.${keyPropertyName};
#else
return null;
#end
}
#end
#if(!${entityLombokModel})
@Override
public String toString() {
return "${entity}{" +
#foreach($field in ${table.fields})
#if($!{foreach.index}==0)
"${field.propertyName} = " + ${field.propertyName} +
#else
", ${field.propertyName} = " + ${field.propertyName} +
#end
#end
"}";
}
#end
}