完成 do 模板的生成

This commit is contained in:
YunaiV
2021-02-02 01:07:11 +08:00
parent 6c5c32c845
commit 528d2a9bca
5 changed files with 32 additions and 38 deletions

View File

@ -39,6 +39,9 @@ spring:
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
fail-on-empty-beans: false # 允许序列化无属性的 Bean
main:
lazy-initialization: true # TODO 芋艿:本地开发环境,可以配置下 lazy 延迟加载
# 芋道配置项,设置当前项目所有自定义的配置
yudao:
version: 1.0.0
@ -79,7 +82,7 @@ apollo:
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印日志
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印日志
global-config:
db-config:
id-type: auto # 自增 ID

View File

@ -1,9 +1,14 @@
package ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName};
import com.baomidou.mybatisplus.annotation.*;
import ${baseDOClassName};
import lombok.*;
import java.util.*;
/**
* ${table.description}
* ${table.classComment} DO
*
* @author ${table.author}
*/
@TableName("${table.tableName}")
@Data
@ -12,19 +17,24 @@ import java.util.*;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ${table.tableName}DO extends BaseDO {
public class ${table.className}DO extends BaseDO {
#foreach ($column in $columns)
#if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段
/**
* ${column.columnComment}
*/
#if(${column.primaryKey} && ${column.javaType} != 'String')
#if ($column.dictType != "")##处理枚举值
// TODO 枚举 ${column.dictType}
#end
#if (${column.primaryKey} && ${column.javaType} != 'String')##处理主键 + 非 String 的情况
@TableId
#end
#if(${column.primaryKey} && ${column.javaType} == 'String')
#if (${column.primaryKey} && ${column.javaType} == 'String')##处理主键 + String 的情况
@TableId(type = IdType.INPUT)
#end
private ${column.javaType} ${column.javaField};
#end
#end
}