chore: continew-starter 2.7.1 => 2.7.2

1.重构代码生成(PostgreSQL 数据库兼容更完整)
2.适配 Tree 树结构生成
3.适配字典扩展配置
This commit is contained in:
2024-11-13 22:36:08 +08:00
parent fb947c98fd
commit 1ddac12cd2
17 changed files with 117 additions and 209 deletions

View File

@@ -13,7 +13,7 @@
<img src="https://sonarcloud.io/api/project_badges/measure?project=Charles7c_continew-admin&metric=alert_status" alt="Sonar Status" />
</a>
<a href="https://github.com/continew-org/continew-starter" target="_blank">
<img src="https://img.shields.io/badge/ContiNew Starter-2.7.1-%236CB52D.svg" alt="ContiNew Starter" />
<img src="https://img.shields.io/badge/ContiNew Starter-2.7.2-%236CB52D.svg" alt="ContiNew Starter" />
</a>
<a href="https://spring.io/projects/spring-boot" target="_blank">
<img src="https://img.shields.io/badge/Spring Boot-3.2.10-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" />
@@ -110,7 +110,7 @@ public class DeptController extends BaseController<DeptService, DeptResp, DeptDe
## 系统功能
> [!TIP]
> 更多功能和优化正在赶来💦,最新项目计划、进展请进群或关注 [任务清单](https://continew.top/admin/intro/require.html#任务清单) 和 [更新日志](https://continew.top/admin/other/changelog.html)。
> 更多功能和优化正在赶来💦,最新项目计划、进展请进群或关注 [任务清单](https://continew.top/require.html) 和 [更新日志](https://continew.top/admin/other/changelog.html)。
- 个人中心:支持基础信息修改、密码修改、邮箱绑定、手机号绑定(并提供行为验证码、短信限流等安全处理)、第三方账号绑定/解绑、头像裁剪上传
- 消息中心:提供站内信消息统一查看、标记已读、全部已读、删除等功能
@@ -216,7 +216,7 @@ public class DeptController extends BaseController<DeptService, DeptResp, DeptDe
| <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.56.0 | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。 |
| <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4 | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 |
| <a href="https://cn.vitejs.dev/" target="_blank">Vite</a> | 5.1.5 | 下一代的前端工具链,为开发提供极速响应。 |
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.7.1 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken可轻松集成到应用中为开发人员减少手动引入依赖及配置的麻烦为 Spring Boot Web 项目的灵活快速构建提供支持。 |
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.7.2 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken可轻松集成到应用中为开发人员减少手动引入依赖及配置的麻烦为 Spring Boot Web 项目的灵活快速构建提供支持。 |
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.2.10 | 简化 Spring 应用的初始搭建和开发过程基于“约定优于配置”的理念使开发人员不再需要定义样板化的配置。Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.13.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.39.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |

View File

@@ -22,6 +22,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
@@ -61,7 +62,7 @@ import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.util.validate.CheckUtils;
import top.continew.starter.extension.crud.annotation.TreeField;
import top.continew.starter.extension.crud.util.TreeUtils;
import top.continew.starter.extension.crud.autoconfigure.CrudProperties;
import top.continew.starter.messaging.websocket.util.WebSocketUtils;
import top.continew.starter.web.util.SpringWebUtils;
@@ -83,6 +84,7 @@ import static top.continew.admin.system.enums.PasswordPolicyEnum.PASSWORD_EXPIRA
public class LoginServiceImpl implements LoginService {
private final ProjectProperties projectProperties;
private final CrudProperties crudProperties;
private final PasswordEncoder passwordEncoder;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
private final UserService userService;
@@ -178,8 +180,8 @@ public class LoginServiceImpl implements LoginService {
List<MenuResp> menuList = menuSet.stream().filter(m -> !MenuTypeEnum.BUTTON.equals(m.getType())).toList();
// 构建路由树
TreeField treeField = MenuResp.class.getDeclaredAnnotation(TreeField.class);
TreeNodeConfig treeNodeConfig = TreeUtils.genTreeNodeConfig(treeField);
List<Tree<Long>> treeList = TreeUtils.build(menuList, treeNodeConfig, (m, tree) -> {
TreeNodeConfig treeNodeConfig = crudProperties.getTree().genTreeNodeConfig(treeField);
List<Tree<Long>> treeList = TreeUtil.build(menuList, treeField.rootId(), treeNodeConfig, (m, tree) -> {
tree.setId(m.getId());
tree.setParentId(m.getParentId());
tree.setName(m.getTitle());

View File

@@ -37,7 +37,7 @@ import java.time.LocalDateTime;
* @since 2022/12/21 20:42
*/
@Data
@DictField(labelKey = "nickname")
@DictField(labelKey = "nickname", extraKeys = {"username"})
@TableName("sys_user")
public class UserDO extends BaseDO {

View File

@@ -2,14 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.UserPasswordHistoryMapper">
<delete id="deleteExpired">
DELETE t1 FROM sys_user_password_history t1
DELETE t1 FROM sys_user_password_history AS t1
LEFT JOIN (
SELECT id
FROM sys_user_password_history
WHERE user_id = #{userId}
ORDER BY create_time DESC
LIMIT #{count}
) t2 ON t2.id = t1.id
) AS t2 ON t2.id = t1.id
WHERE t2.id IS NULL
</delete>
</mapper>

View File

@@ -27,6 +27,7 @@ import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import top.continew.admin.common.constant.RegexConstants;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.util.StrUtils;
import java.io.Serial;
import java.io.Serializable;
@@ -55,6 +56,13 @@ public class GenConfigDO implements Serializable {
@NotBlank(message = "表名称不能为空")
private String tableName;
/**
* 描述
*/
@Schema(description = "描述", example = "用户表")
@TableField(exist = false)
private String comment;
/**
* 模块名称
*/
@@ -127,4 +135,15 @@ public class GenConfigDO implements Serializable {
this.tablePrefix = StrUtil.subPre(tableName, underLineIndex + 1);
}
}
/**
* 类名前缀
*/
@Schema(description = "类名前缀", example = "User")
public String getClassNamePrefix() {
String tableName = this.getTableName();
String rawClassName = StrUtils.blankToDefault(this.getTablePrefix(), tableName, prefix -> StrUtil
.removePrefix(tableName, prefix));
return StrUtil.upperFirst(StrUtil.toCamelCase(rawClassName));
}
}

View File

@@ -22,7 +22,6 @@ import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.util.StrUtils;
import java.io.Serial;
import java.util.List;
@@ -101,26 +100,6 @@ public class InnerGenConfigDO extends GenConfigDO {
*/
private boolean hasTimeField;
/**
* Menu icon
*/
private String icon = "list";
/**
* Menu sort order
*/
private Integer sort = 1;
/**
* Parent menu ID placeholder
*/
private String parentMenuId = "#{parentMenuId}";
/**
* Menu type (2 for menu)
*/
private Integer menuType = 2;
public InnerGenConfigDO() {
}
@@ -138,10 +117,8 @@ public class InnerGenConfigDO extends GenConfigDO {
.lastIndexOfIgnoreCase(realPackageName, StringConstants.DOT) + 1));
}
@Override
public String getClassNamePrefix() {
String tableName = super.getTableName();
String rawClassName = StrUtils.blankToDefault(super.getTablePrefix(), tableName, prefix -> StrUtil
.removePrefix(tableName, prefix));
return StrUtil.upperFirst(StrUtil.toCamelCase(rawClassName));
return super.getClassNamePrefix();
}
}

View File

@@ -23,14 +23,14 @@ import java.io.Serial;
import java.io.Serializable;
/**
* 表信息查询条件
* 生成配置查询条件
*
* @author Charles7c
* @since 2023/4/12 20:21
*/
@Data
@Schema(description = "表信息查询条件")
public class TableQuery implements Serializable {
@Schema(description = "生成配置查询条件")
public class GenConfigQuery implements Serializable {
@Serial
private static final long serialVersionUID = 1L;

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.generator.model.resp;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 表信息
*
* @author Charles7c
* @since 2023/4/12 20:21
*/
@Data
@Schema(description = "表信息")
public class TableResp implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 表名称
*/
@Schema(description = "表名称", example = "sys_user")
private String tableName;
/**
* 描述
*/
@Schema(description = "描述", example = "用户表")
private String comment;
/**
* 存储引擎
*/
@Schema(description = "存储引擎", example = "InnoDB")
private String engine;
/**
* 字符集
*/
@Schema(description = "字符集", example = "utf8mb4_general_ci")
private String charset;
/**
* 创建时间
*/
@Schema(description = "创建时间", example = "2023-08-08 08:08:08", type = "string")
private LocalDateTime createTime;
/**
* 是否已配置
*/
@Schema(description = "是否已配置", example = "true")
private Boolean isConfiged;
/**
* 是否禁用
*/
@Schema(description = "是否禁用", example = "true")
private Boolean disabled;
public Boolean getDisabled() {
return !isConfiged;
}
}

View File

@@ -19,10 +19,9 @@ package top.continew.admin.generator.service;
import jakarta.servlet.http.HttpServletResponse;
import top.continew.admin.generator.model.entity.FieldConfigDO;
import top.continew.admin.generator.model.entity.GenConfigDO;
import top.continew.admin.generator.model.query.TableQuery;
import top.continew.admin.generator.model.query.GenConfigQuery;
import top.continew.admin.generator.model.req.GenConfigReq;
import top.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.continew.admin.generator.model.resp.TableResp;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
@@ -38,14 +37,13 @@ import java.util.List;
public interface GeneratorService {
/**
* 分页查询表信息列表
* 分页查询生成配置列表
*
* @param query 查询条件
* @param pageQuery 分页查询条件
* @return 表信息分页列表
* @throws SQLException /
* @return 分页列表信息
*/
PageResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException;
PageResp<GenConfigDO> pageGenConfig(GenConfigQuery query, PageQuery pageQuery);
/**
* 查询生成配置信息

View File

@@ -25,6 +25,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.db.meta.Column;
import cn.hutool.db.meta.Table;
import cn.hutool.system.SystemUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.servlet.http.HttpServletResponse;
@@ -40,10 +41,9 @@ import top.continew.admin.generator.mapper.GenConfigMapper;
import top.continew.admin.generator.model.entity.FieldConfigDO;
import top.continew.admin.generator.model.entity.GenConfigDO;
import top.continew.admin.generator.model.entity.InnerGenConfigDO;
import top.continew.admin.generator.model.query.TableQuery;
import top.continew.admin.generator.model.query.GenConfigQuery;
import top.continew.admin.generator.model.req.GenConfigReq;
import top.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.continew.admin.generator.model.resp.TableResp;
import top.continew.admin.generator.service.GeneratorService;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.constant.StringConstants;
@@ -52,7 +52,6 @@ import top.continew.starter.core.util.TemplateUtils;
import top.continew.starter.core.util.validate.CheckUtils;
import top.continew.starter.data.core.enums.DatabaseType;
import top.continew.starter.data.core.util.MetaUtils;
import top.continew.starter.data.core.util.Table;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
import top.continew.starter.web.util.FileUploadUtils;
@@ -83,25 +82,30 @@ public class GeneratorServiceImpl implements GeneratorService {
private static final List<String> TIME_PACKAGE_CLASS = Arrays.asList("LocalDate", "LocalTime", "LocalDateTime");
@Override
public PageResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException {
public PageResp<GenConfigDO> pageGenConfig(GenConfigQuery query, PageQuery pageQuery) {
// 查询所有表
List<Table> tableList = MetaUtils.getTables(dataSource);
tableList.removeIf(table -> StrUtil.equalsAnyIgnoreCase(table.getTableName(), generatorProperties
.getExcludeTables()));
String tableName = query.getTableName();
if (StrUtil.isNotBlank(tableName)) {
tableList.removeIf(table -> !StrUtil.containsAnyIgnoreCase(table.getTableName(), tableName));
}
tableList.removeIf(table -> StrUtil.equalsAnyIgnoreCase(table.getTableName(), generatorProperties
.getExcludeTables()));
CollUtil.sort(tableList, Comparator.comparing(Table::getCreateTime)
.thenComparing(table -> Optional.ofNullable(table.getUpdateTime()).orElse(table.getCreateTime()))
.reversed());
List<TableResp> tableRespList = BeanUtil.copyToList(tableList, TableResp.class);
PageResp<TableResp> pageResp = PageResp.build(pageQuery.getPage(), pageQuery.getSize(), tableRespList);
pageResp.getList().parallelStream().forEach(tableResp -> {
long count = genConfigMapper.selectCount(Wrappers.lambdaQuery(GenConfigDO.class)
.eq(GenConfigDO::getTableName, tableResp.getTableName()));
tableResp.setIsConfiged(count > 0);
});
return pageResp;
// 查询生成配置
List<GenConfigDO> list = tableList.parallelStream().map(table -> {
GenConfigDO genConfig = genConfigMapper.selectById(table.getTableName());
if (genConfig == null) {
genConfig = new GenConfigDO(table.getTableName());
}
genConfig.setComment(table.getComment());
return genConfig;
})
.sorted(Comparator.comparing(GenConfigDO::getTableName)
.thenComparing(GenConfigDO::getUpdateTime, Comparator.nullsLast(Comparator.naturalOrder()))
.thenComparing(GenConfigDO::getCreateTime, Comparator.nullsLast(Comparator.naturalOrder())))
.toList();
// 分页
return PageResp.build(pageQuery.getPage(), pageQuery.getSize(), list);
}
@Override

View File

@@ -0,0 +1,37 @@
-- ${businessName}管理菜单
INSERT INTO `sys_menu`
(`title`, `parent_id`, `type`, `path`, `name`, `component`, `redirect`, `icon`, `is_external`, `is_cache`, `is_hidden`, `permission`, `sort`, `status`, `create_user`, `create_time`, `update_user`, `update_time`)
VALUES
('${businessName}管理', 1000, 2, '/${apiModuleName}/${apiName}', '${classNamePrefix}', '${apiModuleName}/${apiName}/index', NULL, NULL, b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL);
SET @parentId = LAST_INSERT_ID();
-- ${businessName}管理按钮
INSERT INTO `sys_menu`
(`title`, `parent_id`, `type`, `path`, `name`, `component`, `redirect`, `icon`, `is_external`, `is_cache`, `is_hidden`, `permission`, `sort`, `status`, `create_user`, `create_time`, `update_user`, `update_time`)
VALUES
('列表', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:list', 1, 1, 1, NOW(), NULL, NULL),
('详情', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:detail', 2, 1, 1, NOW(), NULL, NULL),
('新增', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:add', 3, 1, 1, NOW(), NULL, NULL),
('修改', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:update', 4, 1, 1, NOW(), NULL, NULL),
('删除', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:delete', 5, 1, 1, NOW(), NULL, NULL),
('导出', @parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:export', 6, 1, 1, NOW(), NULL, NULL);
<#--
-- PostgreSQL
-- ${businessName}管理菜单
INSERT INTO "sys_menu"
("id", "title", "parent_id", "type", "path", "name", "component", "redirect", "icon", "is_external", "is_cache", "is_hidden", "permission", "sort", "status", "create_user", "create_time", "update_user", "update_time")
VALUES
('${businessName}管理', 1000, 2, '/${apiModuleName}/${apiName}', '${classNamePrefix}', '${apiModuleName}/${apiName}/index', NULL, NULL, false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL) RETURNING id INTO parentId;
-- ${businessName}管理按钮
INSERT INTO "sys_menu"
("id", "title", "parent_id", "type", "path", "name", "component", "redirect", "icon", "is_external", "is_cache", "is_hidden", "permission", "sort", "status", "create_user", "create_time", "update_user", "update_time")
VALUES
('列表', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:list', 1, 1, 1, NOW(), NULL, NULL),
('详情', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:detail', 2, 1, 1, NOW(), NULL, NULL),
('新增', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:add', 3, 1, 1, NOW(), NULL, NULL),
('修改', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:update', 4, 1, 1, NOW(), NULL, NULL),
('删除', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:delete', 5, 1, 1, NOW(), NULL, NULL),
('导出', parentId, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '${apiModuleName}:${apiName}:export', 6, 1, 1, NOW(), NULL, NULL);-->

View File

@@ -1,50 +0,0 @@
-- MYSQL
-- ${businessName}管理菜单
INSERT INTO sys_menu (
title, parent_id, type, path, name, component, icon,
is_external, is_cache, is_hidden, permission, sort, status, create_time, update_time
) VALUES (
'${businessName}管理', 1000, ${menuType}, '/${apiModuleName}/${apiName}',
'${classNamePrefix}', '${apiModuleName}/${apiName}/index', '${icon!"list"}',
0, 1, 0, null, ${sort!1}, 1, now(), now()
);
SET @parentId = LAST_INSERT_ID();
-- ${businessName}管理按钮
INSERT INTO sys_menu (
title, parent_id, type, permission, sort, status, create_time, update_time
) VALUES
('查询${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:list', 1, 1, now(), now()),
('详情${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:detail', 2, 1, now(), now()),
('新增${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:add', 3, 1, now(), now()),
('修改${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:update', 4, 1, now(), now()),
('删除${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:delete', 5, 1, now(), now()),
('导出${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:export', 6, 1, now(), now()),
('导入${businessName}', @parentId, 3, '${apiModuleName}:${apiName}:import', 7, 1, now(), now());
<#--
-- PG_SQL
-- ${businessName}管理菜单
INSERT INTO sys_menu (
title, parent_id, type, path, name, component, icon,
is_external, is_cache, is_hidden, permission, sort, status, create_time, update_time
) VALUES (
'${businessName}管理', 1000, ${menuType}, '/${apiModuleName}/${apiName}',
'${classNamePrefix}', '${apiModuleName}/${apiName}/index', '${icon!"list"}',
0, 1, 0, null, ${sort!1}, 1, now(), now()
) RETURNING id INTO parentId;
-- ${businessName}管理按钮
INSERT INTO sys_menu (
title, parent_id, type, permission, sort, status, create_time, update_time
) VALUES
('查询${businessName}', parentId, 3, '${apiModuleName}:${apiName}:list', 1, 1, now(), now()),
('详情${businessName}', parentId, 3, '${apiModuleName}:${apiName}:detail', 2, 1, now(), now()),
('新增${businessName}', parentId, 3, '${apiModuleName}:${apiName}:add', 3, 1, now(), now()),
('修改${businessName}', parentId, 3, '${apiModuleName}:${apiName}:update', 4, 1, now(), now()),
('删除${businessName}', parentId, 3, '${apiModuleName}:${apiName}:delete', 5, 1, now(), now()),
('导出${businessName}', parentId, 3, '${apiModuleName}:${apiName}:export', 6, 1, now(), now()),
('导入${businessName}', parentId, 3, '${apiModuleName}:${apiName}:import', 7, 1, now(), now());
-->

View File

@@ -27,10 +27,9 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.continew.admin.generator.model.entity.FieldConfigDO;
import top.continew.admin.generator.model.entity.GenConfigDO;
import top.continew.admin.generator.model.query.TableQuery;
import top.continew.admin.generator.model.query.GenConfigQuery;
import top.continew.admin.generator.model.req.GenConfigReq;
import top.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.continew.admin.generator.model.resp.TableResp;
import top.continew.admin.generator.service.GeneratorService;
import top.continew.admin.system.service.DictService;
import top.continew.starter.extension.crud.model.query.PageQuery;
@@ -56,11 +55,11 @@ public class GeneratorController {
private final GeneratorService baseService;
private final DictService dictService;
@Operation(summary = "分页查询数据表", description = "分页查询数据")
@Operation(summary = "分页查询生成配置", description = "分页查询生成配置列")
@SaCheckPermission("tool:generator:list")
@GetMapping("/table")
public PageResp<TableResp> pageTable(TableQuery query, @Validated PageQuery pageQuery) throws SQLException {
return baseService.pageTable(query, pageQuery);
@GetMapping("/config")
public PageResp<GenConfigDO> pageGenConfig(GenConfigQuery query, @Validated PageQuery pageQuery) {
return baseService.pageGenConfig(query, pageQuery);
}
@Operation(summary = "查询生成配置信息", description = "查询生成配置信息")

View File

@@ -5,5 +5,5 @@
\____|\___/ |_| |_| \__||_||_| \_| \___| \_/\_/ /_/ \_\\__,_||_| |_| |_||_||_| |_|
:: ${project.name} :: v${project.version}
:: ContiNew Starter :: v2.7.1
:: ContiNew Starter :: v2.7.2
:: Spring Boot :: v${spring-boot.version}

View File

@@ -63,11 +63,6 @@ generator:
- timestamp
## 模板配置
templateConfigs:
MenuSql:
template-path: backend/menu.sql.ftl
package-name: sql
extension: .sql
backend: true
DO:
# 模板路径
templatePath: backend/Entity.ftl
@@ -133,4 +128,9 @@ generator:
templatePath: frontend/DetailDrawer.ftl
packageName: src/views
extension: .vue
backend: false
backend: false
Menu:
template-path: backend/Menu.ftl
packageName: sql
extension: .sql
backend: true

View File

@@ -66,6 +66,13 @@ continew-starter.web:
# 是否将原生异常错误信息填充到状态信息中
origin-exception-using-detail-message: false
--- ### 全局树结构配置(简单树,对应前端 UI
continew-starter.crud:
tree:
id-key: key
name-key: title
weight-key: sort
--- ### 接口文档配置
springdoc:
# 设置对象型参数的展示形式(设为 true 表示将对象型参数平展开,即对象内的属性直接作为参数展示而不是嵌套在对象内,默认 false

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-starter</artifactId>
<version>2.7.1</version>
<version>2.7.2</version>
</parent>
<groupId>top.continew</groupId>