generate.dto.dto.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springfuse Show documentation
Show all versions of springfuse Show documentation
Provide basic framework and class library based on Spring Boot Framework.
package ${packageName};
import ${entityPackageName};
<#list dtoImportSet as importName>
import ${importName};
#list>
public class ${entityName}Dto {
<#list fieldList as field>
<#if field.timeType??>
@JsonFormat(pattern = "${field.getTimeFormat()}")
#if>
public ${field.classType} ${field.name};
#list>
public static ${entityName}Dto copy(${entityName} ${entitySimpleName}) {
${entityName}Dto dto = new ${entityName}Dto();
<#list fieldList as field>
<#if field.manyToOne>
dto.${field.name} = ${entitySimpleName}.get${field.manyToOneName}().getId();
#if>
<#if !field.manyToOne>
dto.${field.name} = ${entitySimpleName}.get${field.getNameCapital()}();
#if>
#list>
return dto;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy