diff --git a/qing-yu-club-gen/pom.xml b/qing-yu-club-gen/pom.xml
new file mode 100644
index 0000000..7fec7f8
--- /dev/null
+++ b/qing-yu-club-gen/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+
+ com.landaiqing
+ qing-yu-club-gen
+ 1.0-SNAPSHOT
+ jar
+
+ qing-yu-club-gen
+ http://maven.apache.org
+
+
+ 8
+ 8
+
+
+
+ com.landaiqing
+ easy-gen-code-spring-boot-starter
+ 1.0-SNAPSHOT
+
+
+ org.projectlombok
+ lombok
+ 1.18.28
+
+
+
diff --git a/qing-yu-club-gen/src/main/java/BizPutContextHandler.java b/qing-yu-club-gen/src/main/java/BizPutContextHandler.java
new file mode 100644
index 0000000..7fd0154
--- /dev/null
+++ b/qing-yu-club-gen/src/main/java/BizPutContextHandler.java
@@ -0,0 +1,58 @@
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.landaiqing.core.config.GenConfig;
+import com.landaiqing.core.config.MapperConfig;
+import com.landaiqing.core.core.sdk.PostCurFiledContextAware;
+import com.landaiqing.core.entity.TableInfo;
+import com.landaiqing.core.utils.MySQLToJavaTypeConverter;
+import org.apache.velocity.VelocityContext;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class BizPutContextHandler implements PostCurFiledContextAware {
+
+ public static String underlineToHump(String str, boolean removePre) {
+ if (removePre) {
+ str = str.substring(str.indexOf("_"));
+ }
+ str = str.toLowerCase();
+ Pattern compile = Pattern.compile("_[a-z]");
+ Matcher matcher = compile.matcher(str);
+ StringBuffer sb = new StringBuffer();
+ while (matcher.find()) {
+ matcher.appendReplacement(sb, matcher.group(0).toUpperCase().replace("_", ""));
+ }
+ matcher.appendTail(sb);
+ return StrUtil.upperFirst(sb.toString());
+ }
+
+ private static String convert(String str) {
+ if (str == null || str.isEmpty()) {
+ return str;
+ }
+ char firstChar = str.charAt(0);
+ char lowerFirstChar = Character.toLowerCase(firstChar);
+ return lowerFirstChar + str.substring(1);
+ }
+
+ @Override
+ public void doAware(GenConfig genConfig, MapperConfig mapperConfig, VelocityContext context) {
+
+ // 处理导包标志位
+ List files = JSONObject.parseArray(JSONObject.toJSONString(context.get("fields")), TableInfo.class);
+ for (TableInfo tableInfo : files) {
+ MySQLToJavaTypeConverter.Item typeInfo = tableInfo.getTypeInfo(tableInfo.getType());
+ if (typeInfo.isFlag()) {
+ context.put("import" + typeInfo.getType(), true);
+ }
+ }
+ context.put("modelName", underlineToHump(genConfig.getJdbc().getTableName(), Convert.toBool(context.get("removePre"))));
+ context.put("_modelName", convert(context.get("modelName").toString()));
+ context.put("tableName", genConfig.getJdbc().getTableName());
+
+ }
+
+}
diff --git a/qing-yu-club-gen/src/main/java/GenCodeMain.java b/qing-yu-club-gen/src/main/java/GenCodeMain.java
new file mode 100644
index 0000000..0fa7490
--- /dev/null
+++ b/qing-yu-club-gen/src/main/java/GenCodeMain.java
@@ -0,0 +1,9 @@
+import com.landaiqing.core.core.CodeGenerationCode;
+
+public class GenCodeMain {
+
+ public static void main(String[] args) {
+ CodeGenerationCode.doGenCode(new BizPutContextHandler());
+ }
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/authMapper.yml b/qing-yu-club-gen/src/main/resources/genCode/authMapper.yml
new file mode 100644
index 0000000..233fc22
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/authMapper.yml
@@ -0,0 +1,69 @@
+# auth模块映射关系 ${module} 占位符
+# 模板文件和生成类的映射关系 多个文件 数组形式配置
+mappers:
+ -
+ - fileId: 001
+ template: genCode/template/DemoDTO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-application/qing-yu-club-${module}-application-controller/src/main/java/com/landaiqing/${module}/application/dto
+ name: ${modelName}DTO
+ ext: java
+ - fileId: 002
+ template: genCode/template/DemoController.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-application/qing-yu-club-${module}-application-controller/src/main/java/com/landaiqing/${module}/application/controller
+ name: ${modelName}Controller
+ ext: java
+ - fileId: 003
+ template: genCode/template/DemoDTOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-application/qing-yu-club-${module}-application-controller/src/main/java/com/landaiqing/${module}/application/convert
+ name: ${modelName}DTOConverter
+ ext: java
+ - fileId: 004
+ template: genCode/template/DemoBO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-domain/src/main/java/com/landaiqing/${module}/domain/entity
+ name: ${modelName}BO
+ ext: java
+ - fileId: 005
+ template: genCode/template/DemoDomainService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-domain/src/main/java/com/landaiqing/${module}/domain/service
+ name: ${modelName}DomainService
+ ext: java
+ - fileId: 006
+ template: genCode/template/DemoDomainServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-domain/src/main/java/com/landaiqing/${module}/domain/service/impl
+ name: ${modelName}DomainServiceImpl
+ ext: java
+ - fileId: 007
+ template: genCode/template/DemoBOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-domain/src/main/java/com/landaiqing/${module}/domain/convert
+ name: ${modelName}BOConverter
+ ext: java
+ - fileId: 008
+ template: genCode/template/DemoService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-infra/src/main/java/com/landaiqing/${module}/infra/basic/service
+ name: ${modelName}Service
+ ext: java
+ - fileId: 009
+ template: genCode/template/DemoTable.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-infra/src/main/java/com/landaiqing/${module}/infra/basic/entity
+ name: ${modelName}
+ ext: java
+ - fileId: 010
+ template: genCode/template/DemoServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-infra/src/main/java/com/landaiqing/${module}/infra/basic/service/impl
+ name: ${modelName}ServiceImpl
+ ext: java
+ - fileId: 011
+ template: genCode/template/DemoDao.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-infra/src/main/java/com/landaiqing/${module}/infra/basic/mapper
+ name: ${modelName}Dao
+ ext: java
+ - fileId: 012
+ template: genCode/template/DemoXml.xml.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-${module}-infra/src/main/resources/mapper
+ name: ${modelName}Dao
+ ext: xml
+
+
+
+
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/gen.yml b/qing-yu-club-gen/src/main/resources/genCode/gen.yml
new file mode 100644
index 0000000..6096423
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/gen.yml
@@ -0,0 +1,33 @@
+# 使用步骤
+# 01 替换数据库连接信息及对应表 jdbc:*
+# 02 替换模板映射关系 mapperInfos
+# 03 替换作者信息 params:loser
+# 04 替换模块 params:module
+# 05 替换 controller 前缀 params:api
+
+# 数据库连接信息
+jdbc:
+ dbName: qing-yu-club
+ tableName: subject_liked
+ url: jdbc:mysql://116.196.80.239:3306/
+ username: landaiqing
+ password: $LDQ20020618xxx$
+ driver: com.mysql.cj.jdbc.Driver
+
+# 使用的模板与生成文件映射给关系
+mapperInfos: genCode/subjectLikedMapper.yml
+
+# 全局参数
+params:
+ # 作者
+ author: landaiqing
+ # 模块
+ module: subject
+ # controller 通用前缀
+ api: /subjectLiked
+ # 生成对象是否移除前缀
+ removePre: false
+ # 使用内置函数赋值给变量 FunctionUtils 中替换
+ genDate: now()
+ # win 需要补充模板具体目录
+ templateBasePath: E:/JavaProjects_IDEA/qing-yu-club/qing-yu-club-gen/src/main/resources/
diff --git a/qing-yu-club-gen/src/main/resources/genCode/subjectLikedMapper.yml b/qing-yu-club-gen/src/main/resources/genCode/subjectLikedMapper.yml
new file mode 100644
index 0000000..cb61171
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/subjectLikedMapper.yml
@@ -0,0 +1,69 @@
+# subject 模块映射关系 ${module} 占位符
+# 模板文件和生成类的映射关系 多个文件 数组形式配置
+mappers:
+ -
+ - fileId: 001
+ template: genCode/template/DemoDTO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/dto
+ name: ${modelName}DTO
+ ext: java
+ - fileId: 002
+ template: genCode/template/DemoController.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/controller
+ name: ${modelName}Controller
+ ext: java
+ - fileId: 003
+ template: genCode/template/DemoDTOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/convert
+ name: ${modelName}DTOConverter
+ ext: java
+ - fileId: 004
+ template: genCode/template/DemoBO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/entity
+ name: ${modelName}BO
+ ext: java
+ - fileId: 005
+ template: genCode/template/DemoDomainService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/service
+ name: ${modelName}DomainService
+ ext: java
+ - fileId: 006
+ template: genCode/template/DemoDomainServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/service/impl
+ name: ${modelName}DomainServiceImpl
+ ext: java
+ - fileId: 007
+ template: genCode/template/DemoBOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/convert
+ name: ${modelName}BOConverter
+ ext: java
+ - fileId: 008
+ template: genCode/template/DemoService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/service
+ name: ${modelName}Service
+ ext: java
+ - fileId: 009
+ template: genCode/template/DemoTable.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/entity
+ name: ${modelName}
+ ext: java
+ - fileId: 010
+ template: genCode/template/DemoServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/service/impl
+ name: ${modelName}ServiceImpl
+ ext: java
+ - fileId: 011
+ template: genCode/template/DemoDao.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/mapper
+ name: ${modelName}Dao
+ ext: java
+ - fileId: 012
+ template: genCode/template/DemoXml.xml.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/resources/mapper
+ name: ${modelName}Dao
+ ext: xml
+
+
+
+
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/subjectMapper.yml b/qing-yu-club-gen/src/main/resources/genCode/subjectMapper.yml
new file mode 100644
index 0000000..cb61171
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/subjectMapper.yml
@@ -0,0 +1,69 @@
+# subject 模块映射关系 ${module} 占位符
+# 模板文件和生成类的映射关系 多个文件 数组形式配置
+mappers:
+ -
+ - fileId: 001
+ template: genCode/template/DemoDTO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/dto
+ name: ${modelName}DTO
+ ext: java
+ - fileId: 002
+ template: genCode/template/DemoController.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/controller
+ name: ${modelName}Controller
+ ext: java
+ - fileId: 003
+ template: genCode/template/DemoDTOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/${module}/application/convert
+ name: ${modelName}DTOConverter
+ ext: java
+ - fileId: 004
+ template: genCode/template/DemoBO.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/entity
+ name: ${modelName}BO
+ ext: java
+ - fileId: 005
+ template: genCode/template/DemoDomainService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/service
+ name: ${modelName}DomainService
+ ext: java
+ - fileId: 006
+ template: genCode/template/DemoDomainServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/service/impl
+ name: ${modelName}DomainServiceImpl
+ ext: java
+ - fileId: 007
+ template: genCode/template/DemoBOConverter.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-domain/src/main/java/com/landaiqing/${module}/domain/convert
+ name: ${modelName}BOConverter
+ ext: java
+ - fileId: 008
+ template: genCode/template/DemoService.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/service
+ name: ${modelName}Service
+ ext: java
+ - fileId: 009
+ template: genCode/template/DemoTable.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/entity
+ name: ${modelName}
+ ext: java
+ - fileId: 010
+ template: genCode/template/DemoServiceImpl.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/service/impl
+ name: ${modelName}ServiceImpl
+ ext: java
+ - fileId: 011
+ template: genCode/template/DemoDao.java.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/java/com/landaiqing/${module}/infra/basic/mapper
+ name: ${modelName}Dao
+ ext: java
+ - fileId: 012
+ template: genCode/template/DemoXml.xml.vm
+ filePath: /qing-yu-club-${module}/qing-yu-club-infra/src/main/resources/mapper
+ name: ${modelName}Dao
+ ext: xml
+
+
+
+
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoBO.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoBO.java.vm
new file mode 100644
index 0000000..b52dc7e
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoBO.java.vm
@@ -0,0 +1,24 @@
+package com.landaiqing.${module}.domain.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ${tableComment} bo
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Data
+public class ${modelName}BO implements Serializable {
+ #foreach($field in $fields)
+
+ /**
+ * ${field.comment}
+ */
+ private $field.type $field.name;
+ #end
+
+}
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm
new file mode 100644
index 0000000..7161f6f
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm
@@ -0,0 +1,21 @@
+package com.landaiqing.${module}.domain.convert;
+
+ ${module}.domain.entity.${modelName}BO;
+ ${module}.infra.basic.entity.${modelName};
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * ${tableComment} bo转换器
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Mapper
+public interface ${modelName}BOConverter {
+
+ ${modelName}BOConverter INSTANCE = Mappers.getMapper(${modelName}BOConverter.class);
+
+ ${modelName} convertBOToEntity(${modelName}BO ${_modelName}BO);
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoController.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoController.java.vm
new file mode 100644
index 0000000..1730056
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoController.java.vm
@@ -0,0 +1,97 @@
+package com.landaiqing.${module}.application.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.base.Preconditions;
+ ${module}.application.convert.${modelName}DTOConverter;
+ ${module}.application.dto.${modelName}DTO;
+ ${module}.common.entity.Result;
+ ${module}.domain.entity.${modelName}BO;
+ ${module}.domain.service.${modelName}DomainService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * ${tableComment} controller
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@RestController
+@RequestMapping("${api}/")
+@Slf4j
+public class ${modelName}Controller {
+
+ @Resource
+ private ${modelName}DomainService ${_modelName}DomainService;
+
+ /**
+ * 新增${tableComment}
+ */
+ @RequestMapping("add")
+ public Result add(@RequestBody ${modelName}DTO ${_modelName}DTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("${modelName}Controller.add.dto:{}", JSON.toJSONString(${_modelName}DTO));
+ }
+ #foreach($field in $fields)
+ Preconditions.checkNotNull(${_modelName}DTO.get${field.upName}(), "${field.comment}不能为空");
+ #end
+ ${modelName}BO ${modelName}BO = ${modelName}DTOConverter.INSTANCE.convertDTOToBO(${_modelName}DTO);
+ return Result.ok(${_modelName}DomainService.add(${modelName}BO));
+ } catch (Exception e) {
+ log.error("${modelName}Controller.register.error:{}", e.getMessage(), e);
+ return Result.fail("新增${tableComment}失败");
+ }
+
+ }
+
+ /**
+ * 修改${tableComment}
+ */
+ @RequestMapping("update")
+ public Result update(@RequestBody ${modelName}DTO ${_modelName}DTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("${modelName}Controller.update.dto:{}", JSON.toJSONString(${_modelName}DTO));
+ }
+ #foreach($field in $fields)
+ Preconditions.checkNotNull(${_modelName}DTO.get${field.upName}(), "${field.comment}不能为空");
+ #end
+ ${modelName}BO ${_modelName}BO = ${modelName}DTOConverter.INSTANCE.convertDTOToBO(${_modelName}DTO);
+ return Result.ok(${_modelName}DomainService.update(${_modelName}BO));
+ } catch (Exception e) {
+ log.error("${modelName}Controller.update.error:{}", e.getMessage(), e);
+ return Result.fail("更新${tableComment}信息失败");
+ }
+
+ }
+
+ /**
+ * 删除${tableComment}
+ */
+ @RequestMapping("delete")
+ public Result delete(@RequestBody ${modelName}DTO ${_modelName}DTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("${modelName}Controller.delete.dto:{}", JSON.toJSONString(${_modelName}DTO));
+ }
+ #foreach($field in $fields)
+ Preconditions.checkNotNull(${_modelName}DTO.get${field.upName}(), "${field.comment}不能为空");
+ #end
+ ${modelName}BO ${_modelName}BO = ${modelName}DTOConverter.INSTANCE.convertDTOToBO(${_modelName}DTO);
+ return Result.ok(${_modelName}DomainService.delete(${_modelName}BO));
+ } catch (Exception e) {
+ log.error("${modelName}Controller.delete.error:{}", e.getMessage(), e);
+ return Result.fail("删除${tableComment}信息失败");
+ }
+
+ }
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTO.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTO.java.vm
new file mode 100644
index 0000000..55d61eb
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTO.java.vm
@@ -0,0 +1,24 @@
+package com.landaiqing.${module}.application.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ${tableComment} dto
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Data
+public class ${modelName}DTO implements Serializable {
+ #foreach($field in $fields)
+
+ /**
+ * ${field.comment}
+ */
+ private $field.type $field.name;
+ #end
+
+}
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm
new file mode 100644
index 0000000..12e507e
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm
@@ -0,0 +1,21 @@
+package com.landaiqing.${module}.application.convert;
+
+ ${module}.application.dto.${modelName}DTO;
+ ${module}.domain.entity.${modelName}BO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * ${tableComment} dto转换器
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Mapper
+public interface ${modelName}DTOConverter {
+
+ ${modelName}DTOConverter INSTANCE = Mappers.getMapper(${modelName}DTOConverter.class);
+
+ ${modelName}BO convertDTOToBO(${modelName}DTO ${_modelName}DTO);
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoDao.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDao.java.vm
new file mode 100644
index 0000000..c2396b3
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDao.java.vm
@@ -0,0 +1,17 @@
+package com.landaiqing.${module}.infra.basic.mapper;
+
+ ${module}.infra.basic.entity.${modelName};
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * ${tableComment} 表数据库访问层
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Repository
+public interface ${modelName}Dao extends BaseMapper<${modelName}> {
+
+}
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainService.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainService.java.vm
new file mode 100644
index 0000000..ebf3204
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainService.java.vm
@@ -0,0 +1,26 @@
+package com.landaiqing.${module}.domain.service;${module}.domain.entity.${modelName}BO;
+
+/**
+ * ${tableComment} 领域service
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+public interface ${modelName}DomainService {
+
+ /**
+ * 添加 ${tableComment} 信息
+ */
+ Boolean add(${modelName}BO ${_modelName}BO);
+
+ /**
+ * 更新 ${tableComment} 信息
+ */
+ Boolean update(${modelName}BO ${_modelName}BO);
+
+ /**
+ * 删除 ${tableComment} 信息
+ */
+ Boolean delete(${modelName}BO ${_modelName}BO);
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm
new file mode 100644
index 0000000..cb47863
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm
@@ -0,0 +1,48 @@
+package com.landaiqing.${module}.domain.service.impl;
+
+ ${module}.common.enums.IsDeletedFlagEnum;
+ ${module}.domain.convert.${modelName}BOConverter;
+ ${module}.domain.entity.${modelName}BO;
+ ${module}.domain.service.${modelName}DomainService;
+ ${module}.infra.basic.entity.${modelName};
+ ${module}.infra.basic.service.${modelName}Service;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * ${tableComment} 领域service实现了
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Service
+@Slf4j
+public class ${modelName}DomainServiceImpl implements ${modelName}DomainService {
+
+ @Resource
+ private ${modelName}Service ${_modelName}Service;
+
+ @Override
+ public Boolean add(${modelName}BO ${_modelName}BO) {
+ ${modelName} ${_modelName} = ${modelName}BOConverter.INSTANCE.convertBOToEntity(${_modelName}BO);
+ ${_modelName}.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
+ return ${_modelName}Service.insert(${_modelName}) > 0;
+ }
+
+ @Override
+ public Boolean update(${modelName}BO ${_modelName}BO) {
+ ${modelName} ${_modelName} = ${modelName}BOConverter.INSTANCE.convertBOToEntity(${_modelName}BO);
+ return ${_modelName}Service.update(${_modelName}) > 0;
+ }
+
+ @Override
+ public Boolean delete(${modelName}BO ${_modelName}BO) {
+ ${modelName} ${_modelName} = new ${modelName}();
+ ${_modelName}.setId(${_modelName}BO.getId());
+ ${_modelName}.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
+ return ${_modelName}Service.update(${_modelName}) > 0;
+ }
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoService.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoService.java.vm
new file mode 100644
index 0000000..cc01000
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoService.java.vm
@@ -0,0 +1,48 @@
+package com.landaiqing.${module}.infra.basic.service;${module}.infra.basic.entity.${modelName};
+
+/**
+ * ${tableComment} 表服务接口
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+public interface ${modelName}Service {
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ ${modelName} queryById(Long id);
+
+ /**
+ * 新增数据
+ *
+ * @param ${_modelName} 实例对象
+ * @return 实例对象
+ */
+ int insert(${modelName} ${_modelName});
+
+ /**
+ * 修改数据
+ *
+ * @param ${_modelName} 实例对象
+ * @return 实例对象
+ */
+ int update(${modelName} ${_modelName});
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ boolean deleteById(Long id);
+
+ /**
+ * 根据条件查询角色
+ */
+ ${modelName} queryByCondition(${modelName} ${_modelName});
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm
new file mode 100644
index 0000000..414d4ea
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm
@@ -0,0 +1,87 @@
+package com.landaiqing.${module}.infra.basic.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+ ${module}.infra.basic.entity.${modelName};
+ ${module}.infra.basic.mapper.${modelName}Dao;
+ ${module}.infra.basic.service.${modelName}Service;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Objects;
+
+/**
+ * ${tableComment} 表服务实现类
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Service("${modelName}Service")
+public class ${modelName}ServiceImpl implements ${modelName}Service {
+
+ @Resource
+ private ${modelName}Dao ${_modelName}Dao;
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ @Override
+ public ${modelName} queryById(Long id) {
+ return this.${_modelName}Dao.selectById(id);
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param ${_modelName} 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int insert(${modelName} ${_modelName}) {
+ return this.${_modelName}Dao.insert(${_modelName});
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param ${_modelName} 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int update(${modelName} ${_modelName}) {
+ return this.${_modelName}Dao.updateById(${_modelName});
+ }
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ @Override
+ public boolean deleteById(Long id) {
+ return this.${_modelName}Dao.deleteById(id) > 0;
+ }
+
+ /**
+ * 条件查询
+ *
+ * @param ${_modelName} 条件
+ * @return 实例对象
+ */
+ @Override
+ public ${modelName} queryByCondition(${modelName} ${_modelName}) {
+
+ LambdaQueryWrapper<${modelName}> queryWrapper = Wrappers.<${modelName}>lambdaQuery()
+ #foreach($field in $fields)
+ .eq(Objects.nonNull(${_modelName}.get${field.upName}()), ${modelName}::get${field.upName}, ${_modelName}.get${field.upName}())
+ #end
+ ;
+ return ${_modelName}Dao.selectOne(queryWrapper);
+
+ }
+
+}
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoTable.java.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoTable.java.vm
new file mode 100644
index 0000000..6b01e50
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoTable.java.vm
@@ -0,0 +1,33 @@
+package com.landaiqing.${module}.infra.basic.entity;
+
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * ${tableComment} 实体类
+ *
+ * @author ${author}
+ * @since ${genDate}
+ */
+@Data
+@TableName("${tableName}")
+public class ${modelName} implements Serializable {
+#foreach($field in $fields)
+
+ /**
+ * ${field.comment}
+ */
+ #if($field.keyType=='PRI')
+ @TableId(value = "`$field.col`", type = IdType.AUTO)
+ #end
+ #if($field.keyType!='PRI')
+ @TableField("`$field.col`")
+ #end
+ private $field.type $field.name;
+ #end
+
+}
+
diff --git a/qing-yu-club-gen/src/main/resources/genCode/template/DemoXml.xml.vm b/qing-yu-club-gen/src/main/resources/genCode/template/DemoXml.xml.vm
new file mode 100644
index 0000000..7b355d6
--- /dev/null
+++ b/qing-yu-club-gen/src/main/resources/genCode/template/DemoXml.xml.vm
@@ -0,0 +1,16 @@
+
+
+
+
+
+ #foreach($field in $fields)
+ #if($field.keyType=='PRI')
+
+ #end
+ #if($field.keyType!='PRI')
+
+ #end
+#end
+
+
+
diff --git a/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/controller/SubjectLikedController.java b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/controller/SubjectLikedController.java
new file mode 100644
index 0000000..912a733
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/controller/SubjectLikedController.java
@@ -0,0 +1,115 @@
+package com.landaiqing.subject.application.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.base.Preconditions;
+import com.landaiqing.subject.application.convert.SubjectLikedDTOConverter;
+import com.landaiqing.subject.application.dto.SubjectLikedDTO;
+import com.landaiqing.subject.common.entity.Result;
+import com.landaiqing.subject.domain.entity.SubjectLikedBO;
+import com.landaiqing.subject.domain.service.SubjectLikedDomainService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * 题目点赞表 controller
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@RestController
+@RequestMapping("/subjectLiked/")
+@Slf4j
+public class SubjectLikedController {
+
+ @Resource
+ private SubjectLikedDomainService subjectLikedDomainService;
+
+ /**
+ * 新增题目点赞表
+ */
+ @RequestMapping("add")
+ public Result add(@RequestBody SubjectLikedDTO subjectLikedDTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("SubjectLikedController.add.dto:{}", JSON.toJSONString(subjectLikedDTO));
+ }
+ Preconditions.checkNotNull(subjectLikedDTO.getId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getSubjectId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getLikeUserId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getStatus(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedBy(), "创建人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedTime(), "创建时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateBy(), "更新人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateTime(), "更新时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getIsDeleted(), "不能为空");
+ SubjectLikedBO SubjectLikedBO = SubjectLikedDTOConverter.INSTANCE.convertDTOToBO(subjectLikedDTO);
+ return Result.ok(subjectLikedDomainService.add(SubjectLikedBO));
+ } catch (Exception e) {
+ log.error("SubjectLikedController.register.error:{}", e.getMessage(), e);
+ return Result.fail("新增题目点赞表失败");
+ }
+
+ }
+
+ /**
+ * 修改题目点赞表
+ */
+ @RequestMapping("update")
+ public Result update(@RequestBody SubjectLikedDTO subjectLikedDTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("SubjectLikedController.update.dto:{}", JSON.toJSONString(subjectLikedDTO));
+ }
+ Preconditions.checkNotNull(subjectLikedDTO.getId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getSubjectId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getLikeUserId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getStatus(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedBy(), "创建人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedTime(), "创建时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateBy(), "更新人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateTime(), "更新时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getIsDeleted(), "不能为空");
+ SubjectLikedBO subjectLikedBO = SubjectLikedDTOConverter.INSTANCE.convertDTOToBO(subjectLikedDTO);
+ return Result.ok(subjectLikedDomainService.update(subjectLikedBO));
+ } catch (Exception e) {
+ log.error("SubjectLikedController.update.error:{}", e.getMessage(), e);
+ return Result.fail("更新题目点赞表信息失败");
+ }
+
+ }
+
+ /**
+ * 删除题目点赞表
+ */
+ @RequestMapping("delete")
+ public Result delete(@RequestBody SubjectLikedDTO subjectLikedDTO) {
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("SubjectLikedController.delete.dto:{}", JSON.toJSONString(subjectLikedDTO));
+ }
+ Preconditions.checkNotNull(subjectLikedDTO.getId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getSubjectId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getLikeUserId(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getStatus(), "不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedBy(), "创建人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getCreatedTime(), "创建时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateBy(), "更新人不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getUpdateTime(), "更新时间不能为空");
+ Preconditions.checkNotNull(subjectLikedDTO.getIsDeleted(), "不能为空");
+ SubjectLikedBO subjectLikedBO = SubjectLikedDTOConverter.INSTANCE.convertDTOToBO(subjectLikedDTO);
+ return Result.ok(subjectLikedDomainService.delete(subjectLikedBO));
+ } catch (Exception e) {
+ log.error("SubjectLikedController.delete.error:{}", e.getMessage(), e);
+ return Result.fail("删除题目点赞表信息失败");
+ }
+
+ }
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/convert/SubjectLikedDTOConverter.java b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/convert/SubjectLikedDTOConverter.java
new file mode 100644
index 0000000..102834b
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/convert/SubjectLikedDTOConverter.java
@@ -0,0 +1,21 @@
+package com.landaiqing.subject.application.convert;
+
+import com.landaiqing.subject.application.dto.SubjectLikedDTO;
+import com.landaiqing.subject.domain.entity.SubjectLikedBO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 题目点赞表 dto转换器
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Mapper
+public interface SubjectLikedDTOConverter {
+
+ SubjectLikedDTOConverter INSTANCE = Mappers.getMapper(SubjectLikedDTOConverter.class);
+
+ SubjectLikedBO convertDTOToBO(SubjectLikedDTO subjectLikedDTO);
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/dto/SubjectLikedDTO.java b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/dto/SubjectLikedDTO.java
new file mode 100644
index 0000000..c09b85c
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-application/qing-yu-club-application-controller/src/main/java/com/landaiqing/subject/application/dto/SubjectLikedDTO.java
@@ -0,0 +1,63 @@
+package com.landaiqing.subject.application.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 题目点赞表 dto
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Data
+public class SubjectLikedDTO implements Serializable {
+
+ /**
+ *
+ */
+ private Long id;
+
+ /**
+ *
+ */
+ private Long subjectId;
+
+ /**
+ *
+ */
+ private String likeUserId;
+
+ /**
+ *
+ */
+ private Integer status;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+ /**
+ *
+ */
+ private Integer isDeleted;
+
+}
+
diff --git a/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/convert/SubjectLikedBOConverter.java b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/convert/SubjectLikedBOConverter.java
new file mode 100644
index 0000000..591cdef
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/convert/SubjectLikedBOConverter.java
@@ -0,0 +1,21 @@
+package com.landaiqing.subject.domain.convert;
+
+import com.landaiqing.subject.domain.entity.SubjectLikedBO;
+import com.landaiqing.subject.infra.basic.entity.SubjectLiked;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 题目点赞表 bo转换器
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Mapper
+public interface SubjectLikedBOConverter {
+
+ SubjectLikedBOConverter INSTANCE = Mappers.getMapper(SubjectLikedBOConverter.class);
+
+ SubjectLiked convertBOToEntity(SubjectLikedBO subjectLikedBO);
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/entity/SubjectLikedBO.java b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/entity/SubjectLikedBO.java
new file mode 100644
index 0000000..a201b0a
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/entity/SubjectLikedBO.java
@@ -0,0 +1,63 @@
+package com.landaiqing.subject.domain.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 题目点赞表 bo
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Data
+public class SubjectLikedBO implements Serializable {
+
+ /**
+ *
+ */
+ private Long id;
+
+ /**
+ *
+ */
+ private Long subjectId;
+
+ /**
+ *
+ */
+ private String likeUserId;
+
+ /**
+ *
+ */
+ private Integer status;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+ /**
+ *
+ */
+ private Integer isDeleted;
+
+}
+
diff --git a/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/SubjectLikedDomainService.java b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/SubjectLikedDomainService.java
new file mode 100644
index 0000000..7ec3d9a
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/SubjectLikedDomainService.java
@@ -0,0 +1,29 @@
+package com.landaiqing.subject.domain.service;
+
+import com.landaiqing.subject.domain.entity.SubjectLikedBO;
+
+
+/**
+ * 题目点赞表 领域service
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+public interface SubjectLikedDomainService {
+
+ /**
+ * 添加 题目点赞表 信息
+ */
+ Boolean add(SubjectLikedBO subjectLikedBO);
+
+ /**
+ * 更新 题目点赞表 信息
+ */
+ Boolean update(SubjectLikedBO subjectLikedBO);
+
+ /**
+ * 删除 题目点赞表 信息
+ */
+ Boolean delete(SubjectLikedBO subjectLikedBO);
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/impl/SubjectLikedDomainServiceImpl.java b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/impl/SubjectLikedDomainServiceImpl.java
new file mode 100644
index 0000000..574d2cf
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-domain/src/main/java/com/landaiqing/subject/domain/service/impl/SubjectLikedDomainServiceImpl.java
@@ -0,0 +1,48 @@
+package com.landaiqing.subject.domain.service.impl;
+
+import com.landaiqing.subject.common.enums.IsDeletedFlagEnum;
+import com.landaiqing.subject.domain.convert.SubjectLikedBOConverter;
+import com.landaiqing.subject.domain.entity.SubjectLikedBO;
+import com.landaiqing.subject.domain.service.SubjectLikedDomainService;
+import com.landaiqing.subject.infra.basic.entity.SubjectLiked;
+import com.landaiqing.subject.infra.basic.service.SubjectLikedService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 题目点赞表 领域service实现了
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Service
+@Slf4j
+public class SubjectLikedDomainServiceImpl implements SubjectLikedDomainService {
+
+ @Resource
+ private SubjectLikedService subjectLikedService;
+
+ @Override
+ public Boolean add(SubjectLikedBO subjectLikedBO) {
+ SubjectLiked subjectLiked = SubjectLikedBOConverter.INSTANCE.convertBOToEntity(subjectLikedBO);
+ subjectLiked.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
+ return subjectLikedService.insert(subjectLiked) > 0;
+ }
+
+ @Override
+ public Boolean update(SubjectLikedBO subjectLikedBO) {
+ SubjectLiked subjectLiked = SubjectLikedBOConverter.INSTANCE.convertBOToEntity(subjectLikedBO);
+ return subjectLikedService.update(subjectLiked) > 0;
+ }
+
+ @Override
+ public Boolean delete(SubjectLikedBO subjectLikedBO) {
+ SubjectLiked subjectLiked = new SubjectLiked();
+ subjectLiked.setId(subjectLikedBO.getId());
+ subjectLiked.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
+ return subjectLikedService.update(subjectLiked) > 0;
+ }
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/entity/SubjectLiked.java b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/entity/SubjectLiked.java
new file mode 100644
index 0000000..3a9aaa8
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/entity/SubjectLiked.java
@@ -0,0 +1,77 @@
+package com.landaiqing.subject.infra.basic.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 题目点赞表 实体类
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Data
+@TableName("subject_liked")
+public class SubjectLiked implements Serializable {
+
+ /**
+ *
+ */
+ @TableId(value = "`id`", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ *
+ */
+ @TableField("`subject_id`")
+ private Long subjectId;
+
+ /**
+ *
+ */
+ @TableField("`like_user_id`")
+ private String likeUserId;
+
+ /**
+ *
+ */
+ @TableField("`status`")
+ private Integer status;
+
+ /**
+ * 创建人
+ */
+ @TableField("`created_by`")
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ @TableField("`created_time`")
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ @TableField("`update_by`")
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ @TableField("`update_time`")
+ private Date updateTime;
+
+ /**
+ *
+ */
+ @TableField("`is_deleted`")
+ private Integer isDeleted;
+
+}
+
diff --git a/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/mapper/SubjectLikedDao.java b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/mapper/SubjectLikedDao.java
new file mode 100644
index 0000000..b4285a0
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/mapper/SubjectLikedDao.java
@@ -0,0 +1,17 @@
+package com.landaiqing.subject.infra.basic.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.landaiqing.subject.infra.basic.entity.SubjectLiked;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 题目点赞表 表数据库访问层
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Repository
+public interface SubjectLikedDao extends BaseMapper {
+
+}
+
diff --git a/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/SubjectLikedService.java b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/SubjectLikedService.java
new file mode 100644
index 0000000..a73fd23
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/SubjectLikedService.java
@@ -0,0 +1,51 @@
+package com.landaiqing.subject.infra.basic.service;
+
+import com.landaiqing.subject.infra.basic.entity.SubjectLiked;
+
+
+/**
+ * 题目点赞表 表服务接口
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+public interface SubjectLikedService {
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ SubjectLiked queryById(Long id);
+
+ /**
+ * 新增数据
+ *
+ * @param subjectLiked 实例对象
+ * @return 实例对象
+ */
+ int insert(SubjectLiked subjectLiked);
+
+ /**
+ * 修改数据
+ *
+ * @param subjectLiked 实例对象
+ * @return 实例对象
+ */
+ int update(SubjectLiked subjectLiked);
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ boolean deleteById(Long id);
+
+ /**
+ * 根据条件查询角色
+ */
+ SubjectLiked queryByCondition(SubjectLiked subjectLiked);
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/impl/SubjectLikedServiceImpl.java b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/impl/SubjectLikedServiceImpl.java
new file mode 100644
index 0000000..113a317
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-infra/src/main/java/com/landaiqing/subject/infra/basic/service/impl/SubjectLikedServiceImpl.java
@@ -0,0 +1,93 @@
+package com.landaiqing.subject.infra.basic.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.landaiqing.subject.infra.basic.entity.SubjectLiked;
+import com.landaiqing.subject.infra.basic.mapper.SubjectLikedDao;
+import com.landaiqing.subject.infra.basic.service.SubjectLikedService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Objects;
+
+/**
+ * 题目点赞表 表服务实现类
+ *
+ * @author landaiqing
+ * @since 2024-03-08 13:44:59
+ */
+@Service("SubjectLikedService")
+public class SubjectLikedServiceImpl implements SubjectLikedService {
+
+ @Resource
+ private SubjectLikedDao subjectLikedDao;
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ @Override
+ public SubjectLiked queryById(Long id) {
+ return this.subjectLikedDao.selectById(id);
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param subjectLiked 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int insert(SubjectLiked subjectLiked) {
+ return this.subjectLikedDao.insert(subjectLiked);
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param subjectLiked 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public int update(SubjectLiked subjectLiked) {
+ return this.subjectLikedDao.updateById(subjectLiked);
+ }
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ @Override
+ public boolean deleteById(Long id) {
+ return this.subjectLikedDao.deleteById(id) > 0;
+ }
+
+ /**
+ * 条件查询
+ *
+ * @param subjectLiked 条件
+ * @return 实例对象
+ */
+ @Override
+ public SubjectLiked queryByCondition(SubjectLiked subjectLiked) {
+
+ LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery()
+ .eq(Objects.nonNull(subjectLiked.getId()), SubjectLiked::getId, subjectLiked.getId())
+ .eq(Objects.nonNull(subjectLiked.getSubjectId()), SubjectLiked::getSubjectId, subjectLiked.getSubjectId())
+ .eq(Objects.nonNull(subjectLiked.getLikeUserId()), SubjectLiked::getLikeUserId, subjectLiked.getLikeUserId())
+ .eq(Objects.nonNull(subjectLiked.getStatus()), SubjectLiked::getStatus, subjectLiked.getStatus())
+ .eq(Objects.nonNull(subjectLiked.getCreatedBy()), SubjectLiked::getCreatedBy, subjectLiked.getCreatedBy())
+ .eq(Objects.nonNull(subjectLiked.getCreatedTime()), SubjectLiked::getCreatedTime, subjectLiked.getCreatedTime())
+ .eq(Objects.nonNull(subjectLiked.getUpdateBy()), SubjectLiked::getUpdateBy, subjectLiked.getUpdateBy())
+ .eq(Objects.nonNull(subjectLiked.getUpdateTime()), SubjectLiked::getUpdateTime, subjectLiked.getUpdateTime())
+ .eq(Objects.nonNull(subjectLiked.getIsDeleted()), SubjectLiked::getIsDeleted, subjectLiked.getIsDeleted())
+ ;
+ return subjectLikedDao.selectOne(queryWrapper);
+
+ }
+
+}
diff --git a/qing-yu-club-subject/qing-yu-club-infra/src/main/resources/mapper/SubjectLikedDao.xml b/qing-yu-club-subject/qing-yu-club-infra/src/main/resources/mapper/SubjectLikedDao.xml
new file mode 100644
index 0000000..fca2511
--- /dev/null
+++ b/qing-yu-club-subject/qing-yu-club-infra/src/main/resources/mapper/SubjectLikedDao.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/pom.xml b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/pom.xml
new file mode 100644
index 0000000..2d1b09a
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/pom.xml
@@ -0,0 +1,100 @@
+
+ 4.0.0
+
+ com.landaiqing
+ qing-yu-common-starter
+ 1.0-SNAPSHOT
+
+
+ easy-gen-code-spring-boot-starter
+ jar
+
+ easy-gen-code-spring-boot-starter
+ http://maven.apache.org
+
+
+ 8
+ 8
+
+
+
+
+ org.apache.velocity
+ velocity-engine-core
+ 2.2
+
+
+ org.apache.logging.log4j
+ log4j-slf4j-impl
+
+
+ org.apache.logging.log4j
+ log4j-to-slf4j
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+
+ cn.hutool
+ hutool-all
+ 5.1.1
+
+
+ org.projectlombok
+ lombok
+ 1.18.16
+ true
+
+
+ com.alibaba
+ fastjson
+ 1.2.76
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ 2.12.3
+
+
+ org.apache.logging.log4j
+ log4j-slf4j-impl
+
+
+ org.apache.logging.log4j
+ log4j-to-slf4j
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+
+ org.springframework
+ spring-jdbc
+ 5.3.3
+
+
+ mysql
+ mysql-connector-java
+ 8.0.22
+
+
+
+
+
+ rdc-releases
+ dw-repo-releases
+ https://packages.aliyun.com/maven/repository/2012812-release-SiITng/
+
+
+ rdc-snapshots
+ dw-repo-snapshots
+ https://packages.aliyun.com/maven/repository/2012812-snapshot-LHGmjL/
+
+
+
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/anno/Table.java b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/anno/Table.java
new file mode 100644
index 0000000..3c602ab
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/anno/Table.java
@@ -0,0 +1,26 @@
+package com.landaiqing.core.anno;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Documented
+@Target({ElementType.TYPE, ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Table {
+
+ String value() default "";
+
+ String keyType() default "";
+
+ String col() default "";
+
+ String comment() default "";
+
+ String myBatisType() default "";
+
+ String jdbcType() default "";
+
+}
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/GenConfig.java b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/GenConfig.java
new file mode 100644
index 0000000..6f3cd89
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/GenConfig.java
@@ -0,0 +1,47 @@
+package com.landaiqing.core.config;
+
+import com.landaiqing.core.entity.JdbcConfig;
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * 代码生成器配置
+ *
+ * @author loser
+ * @date 2023/9/4
+ */
+@Data
+public class GenConfig {
+
+ /**
+ * 从自定义的类中获取数据
+ */
+ private String handler;
+
+ /**
+ * 从classPath下的json文件中获取数据
+ */
+ private String json;
+
+ /**
+ * 使用jdbc从表结构中获取数据
+ */
+ private JdbcConfig jdbc;
+
+ /**
+ * 模板与生成文件的映射配置文件
+ */
+ private String mapperInfos;
+
+ /**
+ * 针对某一个模板将数据写入该模板上下文
+ */
+ private String filePutHandler;
+
+ /**
+ * 自定义写入全局的参数
+ */
+ private Map params;
+
+}
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/MapperConfig.java b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/MapperConfig.java
new file mode 100644
index 0000000..7c2f157
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/config/MapperConfig.java
@@ -0,0 +1,27 @@
+package com.landaiqing.core.config;
+
+import com.landaiqing.core.entity.Mapper;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 模板与生成文件的映射关系
+ *
+ * @author loser
+ * @date 2023/9/4
+ */
+@Data
+public class MapperConfig {
+
+ /**
+ * 文件生成到该项目的哪个模块
+ */
+ private String module;
+
+ /**
+ * 映射关系
+ */
+ private List mappers;
+
+}
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/CodeGenerationCode.java b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/CodeGenerationCode.java
new file mode 100644
index 0000000..84d1304
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/CodeGenerationCode.java
@@ -0,0 +1,241 @@
+package com.landaiqing.core.core;
+
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.landaiqing.core.config.GenConfig;
+import com.landaiqing.core.config.MapperConfig;
+import com.landaiqing.core.core.impl.JdbcPutContextHandler;
+import com.landaiqing.core.core.sdk.FilePutContextHandler;
+import com.landaiqing.core.core.sdk.PostCurFiledContextAware;
+import com.landaiqing.core.entity.Context;
+import com.landaiqing.core.entity.MapperInfo;
+import com.landaiqing.core.utils.*;
+import org.apache.velocity.VelocityContext;
+
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+public class CodeGenerationCode {
+
+ public static void doGenCode() {
+ doGenCode(null);
+ }
+
+ public static void doGenCode(PostCurFiledContextAware aware) {
+
+ try {
+ // 01 获取入口配置文件
+ GenConfig genConfig = YamlUtils.loadYaml("genCode/gen.yml", GenConfig.class);
+
+ // 02 获取全局的配置上下文
+ assert genConfig != null;
+ VelocityContext context = getGlobalContext(genConfig);
+ Map contexts = new HashMap<>();
+ for (String key : context.getKeys()) {
+ Object value = context.get(key);
+ if (value instanceof String && FunctionUtils.isFunction(value)) {
+ value = FunctionUtils.doFunction(value);
+ context.put(key, value);
+ }
+ contexts.put(key, context.get(key));
+ }
+ System.out.println("==========> getGlobalContext:" + System.lineSeparator() + JSONObject.toJSONString(contexts));
+ System.out.println();
+
+ // 03 获取 模板与生成文件的映射关系
+ List infos = getMapperInfos(genConfig, context, aware);
+
+ // 04 通过映射关系生成代码文件
+ genCode(infos, genConfig.getParams().getOrDefault("templateBasePath", "").toString());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private static void genCode(List infos, String templateBasePath) {
+
+ AtomicInteger count = new AtomicInteger(1);
+ infos.forEach(info -> {
+ CodeGeneratorUtils codeGenerator = new CodeGeneratorUtils(templateBasePath);
+ codeGenerator.generateCode(
+ info.getContext(),
+ info.getTemplatePath(),
+ info.getOutPutPath(),
+ count);
+ });
+
+ }
+
+ private static List getMapperInfos(GenConfig genConfig, VelocityContext context, PostCurFiledContextAware aware) {
+
+ MapperConfig mapperConfig = YamlUtils.loadYaml(genConfig.getMapperInfos(), MapperConfig.class);
+ assert mapperConfig != null;
+ // 允许在生成文件前对上下文中的数据进行修改 处理一些导包之类的不好控制业务
+ if (Objects.nonNull(aware)) {
+ aware.doAware(genConfig, mapperConfig, context);
+ Map contexts = new HashMap<>();
+ for (String key : context.getKeys()) {
+ Object value = context.get(key);
+ contexts.put(key, value);
+ }
+ System.out.println("==========> modify file context :" + System.lineSeparator() + JSONObject.toJSONString(contexts));
+ }
+
+ AtomicInteger count = new AtomicInteger(1);
+ return mapperConfig.getMappers().stream().filter(Objects::nonNull).map(item -> {
+ MapperInfo info = new MapperInfo();
+ info.setTemplatePath(getResPath(item.getTemplate()));
+ String cName = item.getName();
+
+ if (cName.contains("$")) {
+ cName = replace$key(context, cName);
+ }
+ String pkg = item.getPackageName();
+ if (StrUtil.isNotEmpty(pkg) && pkg.contains("$")) {
+ pkg = replace$key(context, pkg);
+ }
+ String filePath = item.getFilePath();
+ if (StrUtil.isNotEmpty(filePath) && filePath.contains("$")) {
+ filePath = replace$key(context, filePath);
+ }
+ String outPutPath = getTargetPath(mapperConfig.getModule(), pkg, filePath);
+ File file = new File(outPutPath);
+ if (!file.exists()) {
+ boolean mkdirs = file.mkdirs();
+ System.out.println("==========> mkdir " + mkdirs + " " + file.getAbsolutePath());
+ System.out.println();
+ }
+ outPutPath += ("/" + cName + "." + item.getExt());
+ VelocityContext cloneCtx = (VelocityContext) context.clone();
+ info.setOutPutPath(outPutPath);
+ if (StrUtil.isNotBlank(genConfig.getFilePutHandler())) {
+ try {
+ FilePutContextHandler handler = (FilePutContextHandler) Class.forName(genConfig.getFilePutHandler()).newInstance();
+ handler.put(cloneCtx, item.getFileId());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ cloneCtx.put("className", cName);
+ cloneCtx.put("packageName", pkg);
+ System.out.println("==========> " + count.get() + " MapperInfo : " + System.lineSeparator() + info);
+ System.out.println();
+ Map contexts = new HashMap<>();
+ for (String key : cloneCtx.getKeys()) {
+ contexts.put(key, cloneCtx.get(key));
+ }
+ System.out.println("==========> MapperInfo context : " + System.lineSeparator() + JSONObject.toJSONString(contexts));
+ System.out.println();
+ System.out.println("=============================================================================================================================================");
+ System.out.println();
+ info.setContext(cloneCtx);
+ return info;
+ }).collect(Collectors.toList());
+ }
+
+ private static String replace$key(VelocityContext velocityContext, String conextkey) {
+
+ String key = conextkey.substring(conextkey.indexOf("${") + 2, conextkey.indexOf("}"));
+ Object value = velocityContext.get(key);
+ conextkey = conextkey.replace("${" + key + "}", value.toString());
+ if (conextkey.contains("$")) {
+ conextkey = replace$key(velocityContext, conextkey);
+ }
+ return conextkey;
+
+ }
+
+ private static VelocityContext getGlobalContext(GenConfig genConfig) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+
+ Context context = ConfigUtils.getContext();
+ boolean putData = false;
+
+ // 01 处理优先级第一的处理器
+ if (StrUtil.isNotBlank(genConfig.getHandler())) {
+ JdbcPutContextHandler jdbcPutContextHandler = (JdbcPutContextHandler) Class.forName(genConfig.getHandler()).newInstance();
+ putData = jdbcPutContextHandler.put();
+ }
+
+ // 02 处理优先级第二的json导入
+ if (!putData && StrUtil.isNotBlank(genConfig.getJson())) {
+ List lines = FileUtil.readLines(getRealResPath(genConfig.getJson()), "UTF-8");
+ StringBuilder json = new StringBuilder();
+ for (String line : lines) {
+ json.append(line);
+ }
+ context = ContextUtils.buildContext(json.toString());
+ ConfigUtils.reSetContext(context);
+ putData = true;
+ }
+
+ // 03 处理优先级第三的mysql导入
+ if (!putData) {
+ JdbcPutContextHandler jdbcPutContextHandler = new JdbcPutContextHandler();
+ jdbcPutContextHandler.put();
+ }
+
+ // 04 添加配置中的全局参数
+ Map params = genConfig.getParams();
+ for (Map.Entry entry : params.entrySet()) {
+ context.put(entry.getKey(), entry.getValue());
+ }
+ return context.get();
+
+ }
+
+ private static String getTargetPath(String module, String packageName, String filePath) {
+
+ if (StrUtil.isEmpty(module)) {
+ module = "/";
+ }
+ if (SystemUtils.isMacOs()) {
+ if (StrUtil.isEmpty(filePath)) {
+ return getCurPath().substring(0, getCurPath().length() - 2) + module + "src/main/java/" + packageName.replaceAll("\\.", "/");
+ } else {
+ return getCurPath().substring(0, getCurPath().length() - 2) + module + filePath;
+ }
+ } else {
+ if (StrUtil.isEmpty(filePath)) {
+ return getCurPath() + module + "src/main/java/" + packageName.replaceAll("\\.", "\\");
+ } else {
+ return getCurPath() + module + filePath;
+ }
+ }
+
+ }
+
+ private static URL getRealResPath(String res) {
+ ClassLoader classLoader = CodeGenerationCode.class.getClassLoader();
+ return classLoader.getResource(res);
+ }
+
+ private static String getResPath(String res) {
+
+ if (SystemUtils.isMacOs()) {
+ ClassLoader classLoader = CodeGenerationCode.class.getClassLoader();
+ return classLoader.getResource(res).getPath()
+ .replaceAll(getCurPath().substring(0, getCurPath().length() - 1), "");
+ } else {
+ return res;
+ }
+
+ }
+
+ private static String getCurPath() {
+ if (SystemUtils.isMacOs()) {
+ return new File("./").getAbsolutePath();
+ } else {
+ return System.getProperty("user.dir");
+ }
+ }
+
+}
diff --git a/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/MysqlDataHandler.java b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/MysqlDataHandler.java
new file mode 100644
index 0000000..3db628a
--- /dev/null
+++ b/qing-yu-common-starter/easy-gen-code-spring-boot-starter/src/main/java/com/landaiqing/core/core/MysqlDataHandler.java
@@ -0,0 +1,134 @@
+package com.landaiqing.core.core;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.landaiqing.core.entity.JdbcConfig;
+import com.landaiqing.core.entity.TableInfo;
+import com.landaiqing.core.utils.Lists;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.SimpleDriverDataSource;
+
+import javax.sql.DataSource;
+import java.sql.Driver;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+
+/**
+ * 简易mysql处理器 查询表备注及表字段
+ *
+ * @author loser
+ * @date 2023/9/4
+ */
+@AllArgsConstructor
+public class MysqlDataHandler {
+
+ private String tableName;
+ private String dbUrl;
+ private String dbUser;
+ private String dbPw;
+ private String dbName;
+ private String driver;
+
+ public String getTableComment() {
+ JdbcConfig config = new JdbcConfig(
+ dbUrl + dbName + "?useUnicode=true",
+ dbUser,
+ dbPw,
+ dbName,
+ driver,
+ tableName
+ );
+ JdbcTemplate jdbcTemplate = initJdbcTemplate(config);
+ String sql = "SELECT table_comment tableComment FROM information_schema.TABLES WHERE table_schema = ? and table_name = ? ";
+ List