Skip to content

Commit

Permalink
refactor: 抽取代码生成器插件模块(后续会改造为独立插件)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Mar 5, 2024
1 parent 8026f66 commit 87829d3
Show file tree
Hide file tree
Showing 30 changed files with 78 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<version>${revision}</version>
</parent>

<artifactId>continew-admin-tool</artifactId>
<description>系统工具模块(存放系统工具相关业务功能,例如:代码生成等)</description>
<artifactId>continew-admin-generator</artifactId>
<description>代码生成器插件</description>

<dependencies>
<!-- 公共模块(存放公共工具类,公共配置等) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.config.properties;
package top.charles7c.continew.admin.generator.config.properties;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.enums;
package top.charles7c.continew.admin.generator.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.enums;
package top.charles7c.continew.admin.generator.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.mapper;
package top.charles7c.continew.admin.generator.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.generator.model.entity.FieldConfigDO;
import top.charles7c.continew.starter.data.mybatis.plus.base.BaseMapper;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.mapper;
package top.charles7c.continew.admin.generator.mapper;

import top.charles7c.continew.admin.tool.model.entity.GenConfigDO;
import top.charles7c.continew.admin.generator.model.entity.GenConfigDO;
import top.charles7c.continew.starter.data.mybatis.plus.base.BaseMapper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.entity;
package top.charles7c.continew.admin.generator.model.entity;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
Expand All @@ -29,8 +29,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import top.charles7c.continew.admin.tool.enums.FormTypeEnum;
import top.charles7c.continew.admin.tool.enums.QueryTypeEnum;
import top.charles7c.continew.admin.generator.enums.FormTypeEnum;
import top.charles7c.continew.admin.generator.enums.QueryTypeEnum;
import top.charles7c.continew.starter.core.constant.StringConstants;

import java.io.Serial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.entity;
package top.charles7c.continew.admin.generator.model.entity;

import java.io.Serial;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.query;

import java.io.Serial;
import java.io.Serializable;
package top.charles7c.continew.admin.generator.model.query;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.io.Serializable;

/**
* 表信息查询条件
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.req;
package top.charles7c.continew.admin.generator.model.req;

import java.io.Serial;
import java.io.Serializable;
Expand All @@ -29,8 +29,8 @@

import io.swagger.v3.oas.annotations.media.Schema;

import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.tool.model.entity.GenConfigDO;
import top.charles7c.continew.admin.generator.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.generator.model.entity.GenConfigDO;

/**
* 代码生成配置信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.resp;
package top.charles7c.continew.admin.generator.model.resp;

import java.io.Serial;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.model.resp;
package top.charles7c.continew.admin.generator.model.resp;

import java.io.Serial;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.service;
package top.charles7c.continew.admin.generator.service;

import java.sql.SQLException;
import java.util.List;

import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.tool.model.entity.GenConfigDO;
import top.charles7c.continew.admin.tool.model.query.TableQuery;
import top.charles7c.continew.admin.tool.model.req.GenConfigReq;
import top.charles7c.continew.admin.tool.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.tool.model.resp.TableResp;
import top.charles7c.continew.admin.generator.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.generator.model.entity.GenConfigDO;
import top.charles7c.continew.admin.generator.model.query.TableQuery;
import top.charles7c.continew.admin.generator.model.req.GenConfigReq;
import top.charles7c.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.generator.model.resp.TableResp;
import top.charles7c.continew.starter.extension.crud.model.query.PageQuery;
import top.charles7c.continew.starter.extension.crud.model.resp.PageResp;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.service.impl;
package top.charles7c.continew.admin.generator.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
Expand All @@ -31,18 +31,18 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.charles7c.continew.admin.tool.config.properties.GeneratorProperties;
import top.charles7c.continew.admin.tool.config.properties.GeneratorProperties.TemplateConfig;
import top.charles7c.continew.admin.tool.enums.QueryTypeEnum;
import top.charles7c.continew.admin.tool.mapper.FieldConfigMapper;
import top.charles7c.continew.admin.tool.mapper.GenConfigMapper;
import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.tool.model.entity.GenConfigDO;
import top.charles7c.continew.admin.tool.model.query.TableQuery;
import top.charles7c.continew.admin.tool.model.req.GenConfigReq;
import top.charles7c.continew.admin.tool.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.tool.model.resp.TableResp;
import top.charles7c.continew.admin.tool.service.GeneratorService;
import top.charles7c.continew.admin.generator.config.properties.GeneratorProperties;
import top.charles7c.continew.admin.generator.config.properties.GeneratorProperties.TemplateConfig;
import top.charles7c.continew.admin.generator.enums.QueryTypeEnum;
import top.charles7c.continew.admin.generator.mapper.FieldConfigMapper;
import top.charles7c.continew.admin.generator.mapper.GenConfigMapper;
import top.charles7c.continew.admin.generator.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.generator.model.entity.GenConfigDO;
import top.charles7c.continew.admin.generator.model.query.TableQuery;
import top.charles7c.continew.admin.generator.model.req.GenConfigReq;
import top.charles7c.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.generator.model.resp.TableResp;
import top.charles7c.continew.admin.generator.service.GeneratorService;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.core.exception.BusinessException;
import top.charles7c.continew.starter.core.util.TemplateUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Database type to Java type(ELADMIN)
tinyint=Integer
smallint=Integer
mediumint=Integer
Expand Down
8 changes: 4 additions & 4 deletions continew-admin-webapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
<scope>test</scope>
</dependency>

<!-- 系统监控模块(存放系统监控模块相关功能,例如:日志管理、服务监控等-->
<!-- 代码生成器插件(后续会改造为独立插件-->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-admin-monitor</artifactId>
<artifactId>continew-admin-generator</artifactId>
</dependency>

<!-- 系统工具模块(存放系统工具模块相关功能,例如:代码生成、文件管理等-->
<!-- 系统监控模块(存放系统监控模块相关功能,例如:日志管理、服务监控等-->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-admin-tool</artifactId>
<artifactId>continew-admin-monitor</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,30 @@

package top.charles7c.continew.admin.webapi.tool;

import java.sql.SQLException;
import java.util.List;

import lombok.RequiredArgsConstructor;

import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;

import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import cn.dev33.satoken.annotation.SaCheckPermission;

import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.tool.model.entity.GenConfigDO;
import top.charles7c.continew.admin.tool.model.query.TableQuery;
import top.charles7c.continew.admin.tool.model.req.GenConfigReq;
import top.charles7c.continew.admin.tool.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.tool.model.resp.TableResp;
import top.charles7c.continew.admin.tool.service.GeneratorService;
import top.charles7c.continew.admin.generator.model.entity.FieldConfigDO;
import top.charles7c.continew.admin.generator.model.entity.GenConfigDO;
import top.charles7c.continew.admin.generator.model.query.TableQuery;
import top.charles7c.continew.admin.generator.model.req.GenConfigReq;
import top.charles7c.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.charles7c.continew.admin.generator.model.resp.TableResp;
import top.charles7c.continew.admin.generator.service.GeneratorService;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
import top.charles7c.continew.starter.extension.crud.model.query.PageQuery;
import top.charles7c.continew.starter.extension.crud.model.resp.PageResp;
import top.charles7c.continew.starter.web.model.R;

import java.sql.SQLException;
import java.util.List;

/**
* 代码生成 API
*
Expand All @@ -54,7 +50,7 @@
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/tool/generator")
@RequestMapping("/generator")
public class GeneratorController {

private final ProjectProperties projectProperties;
Expand Down
26 changes: 12 additions & 14 deletions continew-admin-webapi/src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,21 @@ springdoc:
default-flat-param-object: true
# 分组配置
group-configs:
- group: 'all'
paths-to-match: '/**'
packages-to-scan: ${project.base-package}.webapi
- group: 'auth'
display-name: '系统认证'
- group: all
paths-to-match: /**
paths-to-exclude:
- /error
- group: auth
display-name: 系统认证
packages-to-scan: ${project.base-package}.webapi.auth
- group: 'common'
display-name: '通用接口'
- group: common
display-name: 通用接口
packages-to-scan: ${project.base-package}.webapi.common
- group: 'system'
display-name: '系统管理'
- group: system
display-name: 系统管理
packages-to-scan: ${project.base-package}.webapi.system
- group: 'tool'
display-name: '系统工具'
packages-to-scan: ${project.base-package}.webapi.tool
- group: 'monitor'
display-name: '系统监控'
- group: monitor
display-name: 系统监控
packages-to-scan: ${project.base-package}.webapi.monitor
## 组件配置
components:
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<module>continew-admin-webapi</module>
<module>continew-admin-monitor</module>
<module>continew-admin-system</module>
<module>continew-admin-tool</module>
<module>continew-admin-generator</module>
<module>continew-admin-common</module>
</modules>

Expand All @@ -45,24 +45,24 @@
<version>${revision}</version>
</dependency>

<!-- 系统监控模块(存放系统监控模块相关功能,例如:日志管理、服务监控等-->
<!-- 代码生成器插件(后续会改造为独立插件-->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-admin-monitor</artifactId>
<artifactId>continew-admin-generator</artifactId>
<version>${revision}</version>
</dependency>

<!-- 系统管理模块(存放系统管理模块相关功能,例如:部门管理、角色管理、用户管理等-->
<!-- 系统监控模块(存放系统监控模块相关功能,例如:日志管理、服务监控等-->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-admin-system</artifactId>
<artifactId>continew-admin-monitor</artifactId>
<version>${revision}</version>
</dependency>

<!-- 系统工具模块(存放系统工具模块相关功能,例如:代码生成、文件管理等-->
<!-- 系统管理模块(存放系统管理模块相关功能,例如:部门管理、角色管理、用户管理等-->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-admin-tool</artifactId>
<artifactId>continew-admin-system</artifactId>
<version>${revision}</version>
</dependency>

Expand Down

0 comments on commit 87829d3

Please sign in to comment.