init2
This commit is contained in:
48
doc/easycode/entity.java.vm
Normal file
48
doc/easycode/entity.java.vm
Normal file
@@ -0,0 +1,48 @@
|
||||
##导入宏定义
|
||||
$!{define.vm}
|
||||
##保存文件(宏定义)
|
||||
#save("/entity", ".java")
|
||||
##包路径(宏定义)
|
||||
#setPackageSuffix("entity")
|
||||
|
||||
##实现列进行排除
|
||||
#set($temp = $tool.newHashSet("id", "createDept", "createTime", "updateTime", "createTime", "updateUser", "createUser", "status", "isDeleted"))
|
||||
#set($newList = $tool.newArrayList())
|
||||
#foreach($column in $tableInfo.fullColumn)
|
||||
##默认不包含
|
||||
#set($contant = true)
|
||||
#foreach($item in $temp)
|
||||
#if($column.name==$item)
|
||||
#set($contant = false)
|
||||
#end
|
||||
#end
|
||||
#if($contant)
|
||||
##带有反回值的方法调用时使用$tool.call来消除返回值
|
||||
$tool.call($newList.add($column))
|
||||
#end
|
||||
#end
|
||||
##重新保存
|
||||
$tableInfo.setFullColumn($newList)
|
||||
##自动导入包(全局变量)
|
||||
$!{autoImport.vm}
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
##表注释(宏定义)
|
||||
#tableComment("实体类")
|
||||
@Data
|
||||
@TableName("$!{tableInfo.obj.name}")
|
||||
@ApiModel(value = "$!{tableInfo.name}对象", description = "$!{tableInfo.comment}")
|
||||
public class $!{tableInfo.name} extends BaseEntity {
|
||||
#foreach($column in $tableInfo.fullColumn)
|
||||
|
||||
#if(${column.comment})@ApiModelProperty("${column.comment}")
|
||||
#end
|
||||
@TableField("$column.obj.name")
|
||||
private $!{tool.getClsNameByFullName($column.type)} $!{column.name};
|
||||
#end
|
||||
}
|
||||
Reference in New Issue
Block a user