bak.struct.btl Maven / Gradle / Ivy
The newest version!
package ${packageName}.structs;
import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import ${packageName}.StructUtil;
<%
var extends = false;
var extendConstant = "";
if(strutil.isNotBlank(struct.extendsName)){
extends = true;
extendConstant = "extends " + struct.extendsName;
}else{
extends = false;
extendConstant = "implements DTO";
}
%>
<%if(!extends){%>
import org.artifact.core.lang.DTO;
<%}%>
@Data
/**
* ${struct.remark}
*/
public class ${struct.structName} ${extendConstant}{
<%for(field in struct.fields){%>
/** ${field.key.remark} */
<%if(strutil.startWith(field.value.type,"java.util.Map")){%>
private ${field.value.intact} ${field.key.name} = new java.util.HashMap<>();
<%}else if(strutil.startWith(field.value.type,"java.util.List")){%>
private ${field.value.intact} ${field.key.name} = new java.util.ArrayList<>();
<%}else{%>
private ${field.value.intact} ${field.key.name};
<%}%>
<%}%>
public Map