diff --git a/continew-admin-plugins/continew-admin-generator/src/main/java/top/continew/admin/generator/model/entity/FieldConfigDO.java b/continew-admin-plugins/continew-admin-generator/src/main/java/top/continew/admin/generator/model/entity/FieldConfigDO.java index 78f933ce1..af488ea32 100644 --- a/continew-admin-plugins/continew-admin-generator/src/main/java/top/continew/admin/generator/model/entity/FieldConfigDO.java +++ b/continew-admin-plugins/continew-admin-generator/src/main/java/top/continew/admin/generator/model/entity/FieldConfigDO.java @@ -21,6 +21,7 @@ import cn.hutool.db.meta.Column; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; @@ -51,6 +52,12 @@ public class FieldConfigDO implements Serializable { @Serial private static final long serialVersionUID = 1L; + /** + * ID + */ + @TableId + private Long id; + /** * 表名称 */ diff --git a/continew-admin-open/pom.xml b/continew-admin-plugins/continew-admin-open/pom.xml similarity index 57% rename from continew-admin-open/pom.xml rename to continew-admin-plugins/continew-admin-open/pom.xml index a1724ac06..4d03a9765 100644 --- a/continew-admin-open/pom.xml +++ b/continew-admin-plugins/continew-admin-open/pom.xml @@ -5,19 +5,10 @@ 4.0.0 top.continew - continew-admin + continew-admin-plugins ${revision} continew-admin-open - 能力开放模块(包括应用管理、API开放授权、API开发等) - - - - - top.continew - continew-admin-common - - - + 能力开放插件(包括应用管理、API开放授权、API开发等) \ No newline at end of file diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/mapper/AppMapper.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/mapper/AppMapper.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/mapper/AppMapper.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/mapper/AppMapper.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/entity/AppDO.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/entity/AppDO.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/entity/AppDO.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/entity/AppDO.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/query/AppQuery.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/query/AppQuery.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/query/AppQuery.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/query/AppQuery.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/req/AppReq.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/req/AppReq.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/req/AppReq.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/req/AppReq.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppDetailResp.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppDetailResp.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppDetailResp.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppDetailResp.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppResp.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppResp.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppResp.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppResp.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppSecretGetResp.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppSecretGetResp.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppSecretGetResp.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/model/resp/AppSecretGetResp.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/service/AppService.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/service/AppService.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/service/AppService.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/service/AppService.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/sign/OpenSignTemplate.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/sign/OpenSignTemplate.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/sign/OpenSignTemplate.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/sign/OpenSignTemplate.java diff --git a/continew-admin-open/src/main/java/top/continew/admin/open/util/ApiSignCheckUtils.java b/continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/util/ApiSignCheckUtils.java similarity index 100% rename from continew-admin-open/src/main/java/top/continew/admin/open/util/ApiSignCheckUtils.java rename to continew-admin-plugins/continew-admin-open/src/main/java/top/continew/admin/open/util/ApiSignCheckUtils.java diff --git a/continew-admin-plugins/pom.xml b/continew-admin-plugins/pom.xml index db22cca0d..f5f747589 100644 --- a/continew-admin-plugins/pom.xml +++ b/continew-admin-plugins/pom.xml @@ -14,8 +14,9 @@ 插件模块(存放代码生成、任务调度等扩展模块) - continew-admin-generator continew-admin-job + continew-admin-open + continew-admin-generator diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/NoticeDO.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/NoticeDO.java index 880dceefb..2478bd7cf 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/NoticeDO.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/NoticeDO.java @@ -33,7 +33,7 @@ * @since 2023/8/20 10:55 */ @Data -@TableName(value = "sys_notice",autoResultMap = true) +@TableName(value = "sys_notice", autoResultMap = true) public class NoticeDO extends BaseDO { @Serial diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/UserSocialDO.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/UserSocialDO.java index 053c87b04..536d9b8ac 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/UserSocialDO.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/entity/UserSocialDO.java @@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -38,6 +39,12 @@ public class UserSocialDO implements Serializable { @Serial private static final long serialVersionUID = 1L; + /** + * ID + */ + @TableId + private Long id; + /** * 用户 ID */ diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/query/UserQuery.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/query/UserQuery.java index 0f3dfdb43..a5f2e2f6c 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/query/UserQuery.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/query/UserQuery.java @@ -70,6 +70,6 @@ public class UserQuery implements Serializable { /** * 用户 IDS */ - @Schema(description = "用户 ID数组",example = "[1,2,3]") + @Schema(description = "用户 ID数组", example = "[1,2,3]") private List userIds; } diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/req/NoticeReq.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/req/NoticeReq.java index 8e548d827..d7fc3066d 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/req/NoticeReq.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/req/NoticeReq.java @@ -80,13 +80,13 @@ public class NoticeReq extends BaseReq { /** * 通知范围 */ - @Schema(description = "通知范围(1.所有人 2.指定用户)",example = "1") + @Schema(description = "通知范围(1.所有人 2.指定用户)", example = "1") @NotNull(message = "通知范围不能为空") private Integer noticeScope; /** * 指定用户 */ - @Schema(description = "指定用户",example = "[1,2,3]") + @Schema(description = "指定用户", example = "[1,2,3]") private List noticeUsers; } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeDetailResp.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeDetailResp.java index 60876fb7f..218dd6fbc 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeDetailResp.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeDetailResp.java @@ -78,12 +78,12 @@ public class NoticeDetailResp extends BaseDetailResp { /** * 通知范围 */ - @Schema(description = "通知范围(1.所有人 2.指定用户)",example = "1") + @Schema(description = "通知范围(1.所有人 2.指定用户)", example = "1") private Integer noticeScope; /** * 指定用户 */ - @Schema(description = "指定用户",example = "[1,2,3]") + @Schema(description = "指定用户", example = "[1,2,3]") private List noticeUsers; } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeResp.java b/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeResp.java index 86568e64d..e477af705 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeResp.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/model/resp/NoticeResp.java @@ -72,16 +72,15 @@ public NoticeStatusEnum getStatus() { return NoticeStatusEnum.getStatus(effectiveTime, terminateTime); } - /** * 通知范围 */ - @Schema(description = "通知范围(1.所有人 2.指定用户)",example = "1") + @Schema(description = "通知范围(1.所有人 2.指定用户)", example = "1") private Integer noticeScope; /** * 指定用户 */ - @Schema(description = "指定用户",example = "[1,2,3]") + @Schema(description = "指定用户", example = "[1,2,3]") private List noticeUsers; } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/DeptService.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/DeptService.java index 12dcb78ff..95767de30 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/DeptService.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/DeptService.java @@ -62,9 +62,9 @@ public interface DeptService extends BaseService> treeWithUsers(DeptQuery query, SortQuery sortQuery, boolean isSimple); diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/UserRoleService.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/UserRoleService.java index 5e1338658..65364a2ae 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/UserRoleService.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/UserRoleService.java @@ -16,7 +16,6 @@ package top.continew.admin.system.service; -import top.continew.admin.system.model.entity.UserDO; import top.continew.admin.system.model.entity.UserRoleDO; import java.util.List; @@ -41,11 +40,12 @@ public interface UserRoleService { /** * 关联用户 * - * @param roleId 角色id + * @param roleId 角色id * @param userIds 用户id列表 * @return 是否新增成功(true:成功;false:无变更/失败) */ - boolean bindUserIds(Long roleId,List userIds); + boolean bindUserIds(Long roleId, List userIds); + /** * 根据用户 ID 删除 * @@ -60,8 +60,6 @@ public interface UserRoleService { */ void saveBatch(List list); - - /** * 根据用户 ID 查询 * diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java index ba9deaf7a..c7fd40422 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/DeptServiceImpl.java @@ -105,56 +105,60 @@ public List> treeWithUsers(DeptQuery query, SortQuery sortQuery, bo // 创建一个部门ID到用户的映射 UserQuery userQuery = new UserQuery(); userQuery.setStatus(DisEnableStatusEnum.ENABLE); - Map> userMap = userService.list(userQuery, null).stream() - .collect(Collectors.groupingBy(UserResp::getDeptId)); + Map> userMap = userService.list(userQuery, null) + .stream() + .collect(Collectors.groupingBy(UserResp::getDeptId)); String rootId = "dept_0"; return TreeUtil.build(list, rootId, treeNodeConfig, (node, tree) -> { - Long departmentId = ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField.value()), new Object[0]); + Long departmentId = ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField + .value()), new Object[0]); String uniqueDeptId = "dept_" + departmentId; tree.setId(uniqueDeptId); - Long parentId = ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField.parentIdKey()), new Object[0]); + Long parentId = ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField + .parentIdKey()), new Object[0]); tree.setParentId(parentId != null ? "dept_" + parentId : null); tree.setName(ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField.nameKey()), new Object[0])); - tree.setWeight(ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField.weightKey()), new Object[0])); + tree.setWeight(ReflectUtil.invoke(node, CharSequenceUtil.genGetter(treeField + .weightKey()), new Object[0])); tree.putExtra("origId", departmentId); tree.putExtra("isUser", false); // 添加用户信息到树节点 if (userMap.containsKey(departmentId)) { List userList = userMap.get(departmentId); - List> userTrees = userList.stream() - .map(user -> { - Tree userTree = new Tree<>(); - String uniqueUserId = "user_" + user.getId(); - String userAliasName = user.getUsername() + "(" + user.getNickname() + ")"; - userTree.setId(uniqueUserId); - userTree.setParentId(uniqueDeptId); - userTree.setName(userAliasName); - userTree.setWeight(0); - userTree.putExtra("origId", user.getId()); // 添加原始用户ID - userTree.putExtra("isUser", true); // 添加原始用户ID - return userTree; - }) - .collect(Collectors.toList()); + List> userTrees = userList.stream().map(user -> { + Tree userTree = new Tree<>(); + String uniqueUserId = "user_" + user.getId(); + String userAliasName = user.getUsername() + "(" + user.getNickname() + ")"; + userTree.setId(uniqueUserId); + userTree.setParentId(uniqueDeptId); + userTree.setName(userAliasName); + userTree.setWeight(0); + userTree.putExtra("origId", user.getId()); // 添加原始用户ID + userTree.putExtra("isUser", true); // 添加原始用户ID + return userTree; + }).collect(Collectors.toList()); tree.setChildren(userTrees); } if (!isSimple) { List fieldList = ReflectUtils.getNonStaticFields(this.getListClass()); fieldList.removeIf((f) -> { - return CharSequenceUtil.equalsAnyIgnoreCase(f.getName(), new CharSequence[]{treeField.value(), treeField.parentIdKey(), treeField.nameKey(), treeField.weightKey(), treeField.childrenKey()}); + return CharSequenceUtil.equalsAnyIgnoreCase(f.getName(), new CharSequence[] {treeField.value(), + treeField.parentIdKey(), treeField.nameKey(), treeField.weightKey(), treeField + .childrenKey()}); }); fieldList.forEach((f) -> { - tree.putExtra(f.getName(), ReflectUtil.invoke(node, CharSequenceUtil.genGetter(f.getName()), new Object[0])); + tree.putExtra(f.getName(), ReflectUtil.invoke(node, CharSequenceUtil.genGetter(f + .getName()), new Object[0])); }); } }); } } - @Override protected void beforeAdd(DeptReq req) { String name = req.getName(); @@ -180,13 +184,13 @@ protected void beforeUpdate(DeptReq req, Long id) { if (ObjectUtil.notEqual(newStatus, oldDept.getStatus())) { List children = this.listChildren(id); long enabledChildrenCount = children.stream() - .filter(d -> DisEnableStatusEnum.ENABLE.equals(d.getStatus())) - .count(); + .filter(d -> DisEnableStatusEnum.ENABLE.equals(d.getStatus())) + .count(); CheckUtils.throwIf(DisEnableStatusEnum.DISABLE - .equals(newStatus) && enabledChildrenCount > 0, "禁用 [{}] 前,请先禁用其所有下级部门", oldName); + .equals(newStatus) && enabledChildrenCount > 0, "禁用 [{}] 前,请先禁用其所有下级部门", oldName); DeptDO oldParentDept = this.getByParentId(oldParentId); CheckUtils.throwIf(DisEnableStatusEnum.ENABLE.equals(newStatus) && DisEnableStatusEnum.DISABLE - .equals(oldParentDept.getStatus()), "启用 [{}] 前,请先启用其所有上级部门", oldName); + .equals(oldParentDept.getStatus()), "启用 [{}] 前,请先启用其所有上级部门", oldName); } // 变更上级部门 if (ObjectUtil.notEqual(req.getParentId(), oldParentId)) { @@ -201,12 +205,12 @@ protected void beforeUpdate(DeptReq req, Long id) { @Override protected void beforeDelete(List ids) { List list = baseMapper.lambdaQuery() - .select(DeptDO::getName, DeptDO::getIsSystem) - .in(DeptDO::getId, ids) - .list(); + .select(DeptDO::getName, DeptDO::getIsSystem) + .in(DeptDO::getId, ids) + .list(); Optional isSystemData = list.stream().filter(DeptDO::getIsSystem).findFirst(); CheckUtils.throwIf(isSystemData::isPresent, "所选部门 [{}] 是系统内置部门,不允许删除", isSystemData.orElseGet(DeptDO::new) - .getName()); + .getName()); CheckUtils.throwIf(this.countChildren(ids) > 0, "所选部门存在下级部门,不允许删除"); CheckUtils.throwIf(userService.countByDeptIds(ids) > 0, "所选部门存在用户关联,请解除关联后重试"); // 删除角色和部门关联 @@ -223,10 +227,10 @@ protected void beforeDelete(List ids) { */ private boolean isNameExists(String name, Long parentId, Long id) { return baseMapper.lambdaQuery() - .eq(DeptDO::getName, name) - .eq(DeptDO::getParentId, parentId) - .ne(null != id, DeptDO::getId, id) - .exists(); + .eq(DeptDO::getName, name) + .eq(DeptDO::getParentId, parentId) + .ne(null != id, DeptDO::getId, id) + .exists(); } /** @@ -264,8 +268,8 @@ private Long countChildren(List ids) { } DatabaseType databaseType = MetaUtils.getDatabaseTypeOrDefault(dataSource, DatabaseType.MYSQL); return ids.stream() - .mapToLong(id -> baseMapper.lambdaQuery().apply(databaseType.findInSet(id, "ancestors")).count()) - .sum(); + .mapToLong(id -> baseMapper.lambdaQuery().apply(databaseType.findInSet(id, "ancestors")).count()) + .sum(); } /** diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java index b60bcca66..87ff8b272 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java @@ -43,7 +43,7 @@ public class NoticeServiceImpl extends BaseServiceImpl listDashboard() { - Long userId = UserContextHolder.isAdmin()? null: UserContextHolder.getUserId(); + Long userId = UserContextHolder.isAdmin() ? null : UserContextHolder.getUserId(); return baseMapper.selectDashboardList(userId); } } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java index 36702592e..d13009c4a 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/RoleServiceImpl.java @@ -36,7 +36,6 @@ import top.continew.admin.common.enums.DataScopeEnum; import top.continew.admin.system.mapper.RoleMapper; import top.continew.admin.system.model.entity.RoleDO; -import top.continew.admin.system.model.entity.UserDO; import top.continew.admin.system.model.query.RoleQuery; import top.continew.admin.system.model.req.RoleReq; import top.continew.admin.system.model.resp.MenuResp; @@ -199,8 +198,6 @@ public int countByNames(List roleNames) { return (int)this.count(Wrappers.lambdaQuery().in(RoleDO::getName, roleNames)); } - - /** * 名称是否存在 * diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java index 4f315a3c4..d8eb082a4 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserRoleServiceImpl.java @@ -63,21 +63,22 @@ public boolean add(List roleIds, Long userId) { List userRoleList = roleIds.stream().map(roleId -> new UserRoleDO(userId, roleId)).toList(); return baseMapper.insertBatch(userRoleList); } + @Override public boolean bindUserIds(Long roleId, List userIds) { // 检查是否有变更 List oldRoleIdList = baseMapper.lambdaQuery() - .select(UserRoleDO::getUserId) - .eq(UserRoleDO::getRoleId, roleId) - .list() - .stream() - .map(UserRoleDO::getRoleId) - .toList(); + .select(UserRoleDO::getUserId) + .eq(UserRoleDO::getRoleId, roleId) + .list() + .stream() + .map(UserRoleDO::getRoleId) + .toList(); if (CollUtil.isEmpty(CollUtil.disjunction(userIds, oldRoleIdList))) { return false; } - if (SysConstants.SUPER_ROLE_ID.equals(roleId) && !userIds.contains(SysConstants.SUPER_ADMIN_ID)){ - CheckUtils.throwIf(true,"不能移除管理员默认超管角色组"); + if (SysConstants.SUPER_ROLE_ID.equals(roleId) && !userIds.contains(SysConstants.SUPER_ADMIN_ID)) { + CheckUtils.throwIf(true, "不能移除管理员默认超管角色组"); } // 删除原有关联 baseMapper.lambdaUpdate().eq(UserRoleDO::getRoleId, roleId).remove(); @@ -85,6 +86,7 @@ public boolean bindUserIds(Long roleId, List userIds) { List userRoleList = userIds.stream().map(userId -> new UserRoleDO(userId, roleId)).toList(); return baseMapper.insertBatch(userRoleList); } + @Override public void deleteByUserIds(List userIds) { baseMapper.lambdaUpdate().in(UserRoleDO::getUserId, userIds).remove(); @@ -95,8 +97,6 @@ public void saveBatch(List list) { baseMapper.insert(list); } - - @Override @ContainerMethod(namespace = ContainerConstants.USER_ROLE_ID_LIST, type = MappingType.ORDER_OF_KEYS) public List listRoleIdByUserId(Long userId) { diff --git a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java index 6439dbc68..a783f1974 100644 --- a/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java +++ b/continew-admin-system/src/main/java/top/continew/admin/system/service/impl/UserServiceImpl.java @@ -511,7 +511,8 @@ protected QueryWrapper buildQueryWrapper(UserQuery query) { .collect(Collectors.toList()); deptIdList.add(deptId); q.in("t1.dept_id", deptIdList); - }).in(CollUtil.isNotEmpty(userIdList),"t1.id", userIdList); + }) + .in(CollUtil.isNotEmpty(userIdList), "t1.id", userIdList); } @Override diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/RoleController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/RoleController.java index 1f0ea528b..501bb987d 100644 --- a/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/RoleController.java +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/RoleController.java @@ -17,14 +17,12 @@ package top.continew.admin.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; -import cn.hutool.core.lang.tree.Tree; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; -import top.continew.admin.system.model.query.DeptQuery; import top.continew.admin.system.model.query.RoleQuery; import top.continew.admin.system.model.req.RoleReq; import top.continew.admin.system.model.resp.RoleDetailResp; @@ -34,7 +32,6 @@ import top.continew.starter.extension.crud.annotation.CrudRequestMapping; import top.continew.starter.extension.crud.controller.BaseController; import top.continew.starter.extension.crud.enums.Api; -import top.continew.starter.extension.crud.model.query.SortQuery; import java.util.List; @@ -61,7 +58,7 @@ public List listUsers(@PathVariable("id") Long roleId) { @Operation(summary = "关联用户", description = "批量关联用户") @SaCheckPermission("system:role:bindUsers") @PostMapping("/bindUsers/{id}") - public void bindUsers(@PathVariable("id") Long roleId,@RequestBody List userIds) { + public void bindUsers(@PathVariable("id") Long roleId, @RequestBody List userIds) { userRoleService.bindUserIds(roleId, userIds); } } diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/UserController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/UserController.java index 3710342c7..eea8311c8 100644 --- a/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/UserController.java +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/system/UserController.java @@ -36,7 +36,10 @@ import top.continew.admin.system.model.req.UserPasswordResetReq; import top.continew.admin.system.model.req.UserReq; import top.continew.admin.system.model.req.UserRoleUpdateReq; -import top.continew.admin.system.model.resp.*; +import top.continew.admin.system.model.resp.UserDetailResp; +import top.continew.admin.system.model.resp.UserImportParseResp; +import top.continew.admin.system.model.resp.UserImportResp; +import top.continew.admin.system.model.resp.UserResp; import top.continew.admin.system.service.UserService; import top.continew.starter.core.util.ExceptionUtils; import top.continew.starter.core.util.validate.ValidationUtils; diff --git a/continew-admin-webapi/src/main/java/top/continew/starter/extension/crud/controller/BaseController.java b/continew-admin-webapi/src/main/java/top/continew/starter/extension/crud/controller/BaseController.java deleted file mode 100644 index 21f31513a..000000000 --- a/continew-admin-webapi/src/main/java/top/continew/starter/extension/crud/controller/BaseController.java +++ /dev/null @@ -1,193 +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.starter.extension.crud.controller; - -import cn.dev33.satoken.stp.StpUtil; -import cn.hutool.core.lang.tree.Tree; -import cn.hutool.core.text.CharSequenceUtil; -import com.feiniaojin.gracefulresponse.api.ExcludeFromGracefulResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import top.continew.admin.open.util.ApiSignCheckUtils; -import top.continew.starter.core.constant.StringConstants; -import top.continew.starter.extension.crud.annotation.CrudRequestMapping; -import top.continew.starter.extension.crud.enums.Api; -import top.continew.starter.extension.crud.model.query.PageQuery; -import top.continew.starter.extension.crud.model.query.SortQuery; -import top.continew.starter.extension.crud.model.req.BaseReq; -import top.continew.starter.extension.crud.model.resp.BaseIdResp; -import top.continew.starter.extension.crud.model.resp.PageResp; -import top.continew.starter.extension.crud.service.BaseService; -import top.continew.starter.extension.crud.util.ValidateGroup; - -import java.util.List; - -/** - * 控制器基类 - * - * @param 业务接口 - * @param 列表类型 - * @param 详情类型 - * @param 查询条件 - * @param 创建或修改类型 - * @author Charles7c - * @since 1.0.0 - */ -public abstract class BaseController, L, D, Q, C extends BaseReq> { - - @Autowired - protected S baseService; - - /** - * 分页查询列表 - * - * @param query 查询条件 - * @param pageQuery 分页查询条件 - * @return 分页信息 - */ - @Operation(summary = "分页查询列表", description = "分页查询列表") - @ResponseBody - @GetMapping - public PageResp page(Q query, @Validated PageQuery pageQuery) { - this.checkPermission(Api.LIST); - return baseService.page(query, pageQuery); - } - - /** - * 查询树列表 - * - * @param query 查询条件 - * @param sortQuery 排序查询条件 - * @return 树列表信息 - */ - @Operation(summary = "查询树列表", description = "查询树列表") - @ResponseBody - @GetMapping("/tree") - public List> tree(Q query, SortQuery sortQuery) { - this.checkPermission(Api.LIST); - return baseService.tree(query, sortQuery, false); - } - - /** - * 查询列表 - * - * @param query 查询条件 - * @param sortQuery 排序查询条件 - * @return 列表信息 - */ - @Operation(summary = "查询列表", description = "查询列表") - @ResponseBody - @GetMapping("/list") - public List list(Q query, SortQuery sortQuery) { - this.checkPermission(Api.LIST); - return baseService.list(query, sortQuery); - } - - /** - * 查询详情 - * - * @param id ID - * @return 详情信息 - */ - @Operation(summary = "查询详情", description = "查询详情") - @Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH) - @ResponseBody - @GetMapping("/{id}") - public D get(@PathVariable("id") Long id) { - this.checkPermission(Api.LIST); - return baseService.get(id); - } - - /** - * 新增 - * - * @param req 创建信息 - * @return 自增 ID - */ - @Operation(summary = "新增数据", description = "新增数据") - @ResponseBody - @PostMapping - public BaseIdResp add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody C req) { - this.checkPermission(Api.ADD); - return BaseIdResp.builder().id(baseService.add(req)).build(); - } - - /** - * 修改 - * - * @param req 修改信息 - * @param id ID - */ - @Operation(summary = "修改数据", description = "修改数据") - @Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH) - @ResponseBody - @PutMapping("/{id}") - public void update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody C req, @PathVariable("id") Long id) { - this.checkPermission(Api.UPDATE); - baseService.update(req, id); - } - - /** - * 删除 - * - * @param ids ID 列表 - */ - @Operation(summary = "删除数据", description = "删除数据") - @Parameter(name = "ids", description = "ID 列表", example = "1,2", in = ParameterIn.PATH) - @ResponseBody - @DeleteMapping("/{ids}") - public void delete(@PathVariable("ids") List ids) { - this.checkPermission(Api.DELETE); - baseService.delete(ids); - } - - /** - * 导出 - * - * @param query 查询条件 - * @param sortQuery 排序查询条件 - * @param response 响应对象 - */ - @ExcludeFromGracefulResponse - @Operation(summary = "导出数据", description = "导出数据") - @GetMapping("/export") - public void export(Q query, SortQuery sortQuery, HttpServletResponse response) { - this.checkPermission(Api.EXPORT); - baseService.export(query, sortQuery, response); - } - - /** - * 根据 API 类型进行权限验证 - * - * @param api API 类型 - */ - protected void checkPermission(Api api) { - // 判断是否包含sign参数 - if (!ApiSignCheckUtils.isExistSignParam()) { - CrudRequestMapping crudRequestMapping = this.getClass().getDeclaredAnnotation(CrudRequestMapping.class); - String path = crudRequestMapping.value(); - String permissionPrefix = String.join(StringConstants.COLON, CharSequenceUtil - .splitTrim(path, StringConstants.SLASH)); - StpUtil.checkPermission("%s:%s".formatted(permissionPrefix, api.name().toLowerCase())); - } - } -} diff --git a/continew-admin-webapi/src/main/resources/db/changelog/db.changelog-master.yaml b/continew-admin-webapi/src/main/resources/db/changelog/db.changelog-master.yaml index b529bf6cf..d22e41389 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/continew-admin-webapi/src/main/resources/db/changelog/db.changelog-master.yaml @@ -1,16 +1,26 @@ databaseChangeLog: - include: - file: db/changelog/mysql/continew-admin_table.sql + file: db/changelog/mysql/main_table.sql - include: - file: db/changelog/mysql/continew-admin_column.sql + file: db/changelog/mysql/main_column.sql - include: - file: db/changelog/mysql/continew-admin_data.sql + file: db/changelog/mysql/main_data.sql - include: - file: db/changelog/mysql/continew-admin_change_v3.4.0.sql + file: db/changelog/mysql/plugins/plugin_job.sql +# - include: +# file: db/changelog/mysql/plugins/plugin_open.sql + - include: + file: db/changelog/mysql/plugins/plugin_generator.sql # PostgreSQL # - include: -# file: db/changelog/postgresql/continew-admin_table.sql +# file: db/changelog/postgresql/main_table.sql +# - include: +# file: db/changelog/postgresql/main_column.sql +# - include: +# file: db/changelog/postgresql/main_data.sql +# - include: +# file: db/changelog/postgresql/plugins/plugin_job.sql # - include: -# file: db/changelog/postgresql/continew-admin_column.sql +# file: db/changelog/postgresql/plugins/plugin_open.sql # - include: -# file: db/changelog/postgresql/continew-admin_data.sql \ No newline at end of file +# file: db/changelog/postgresql/plugins/plugin_generator.sql \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_change_v3.4.0.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_change_v3.4.0.sql deleted file mode 100644 index 4a991bc27..000000000 --- a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_change_v3.4.0.sql +++ /dev/null @@ -1,37 +0,0 @@ --- 消息通知表 新增通知范围 和 通知用户两个字段 -START TRANSACTION; -ALTER TABLE sys_notice - ADD COLUMN notice_scope INT NOT NULL COMMENT '通知范围' AFTER terminate_time, - ADD COLUMN notice_users JSON DEFAULT NULL COMMENT '通知用户' AFTER notice_scope; -COMMIT; - --- changeset chengzi --- comment 新增应用表 -CREATE TABLE IF NOT EXISTS `sys_app` ( - `id` bigint(0) NOT NULL COMMENT 'ID', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用名称', - `app_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用密钥', - `app_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用密码', - `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用状态(0:未激活;1:激活)', - `expiration_time` datetime(0) NULL DEFAULT NULL COMMENT '失效时间', - `app_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用描述', - `secret_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用密码查看状态(0:未查看;1:已查看)', - `create_user` bigint(0) NOT NULL COMMENT '创建人', - `create_time` datetime(0) NOT NULL COMMENT '创建时间', - `update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改人', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; -INSERT INTO `sys_app` VALUES (639144999463690263, 'ContiNewAdmin', 'admin', '9efcf8859d754288941e61adc72cd250', '1', '2024-10-31 16:53:52', 'ContiNew Admin(Continue New Admin)持续迭代优化的前后端分离中后台管理系统框架。开箱即用,重视每一处代码规范,重视每一种解决方案细节,持续提供舒适的前、后端开发体验。', '1', 1, '2024-10-22 16:54:03', NULL, NULL); --- 应用管理菜单数据 -INSERT INTO `sys_menu` VALUES (635516486647025735, '能力开放', 0, 1, '/open', 'Open', 'Layout', NULL, 'expand', b'0', b'0', b'0', NULL, 2, 1, 1, '2024-10-12 16:35:38', 1, '2024-10-12 16:35:53'); -INSERT INTO `sys_menu` VALUES (635516794676711501, '应用管理', 635516486647025735, 2, '/open/app', 'OpenApp', 'open/app/index', NULL, 'common', b'0', b'0', b'0', NULL, 1, 1, 1, '2024-10-12 16:36:51', 1, '2024-10-12 16:49:11'); -INSERT INTO `sys_menu` VALUES (636598391530328174, '新增', 635516794676711501, 3, NULL, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'open:app:add', 1, 1, 1, '2024-10-15 16:14:44', 1, '2024-10-15 16:45:36'); -INSERT INTO `sys_menu` VALUES (636599310447808642, '查看', 635516794676711501, 3, NULL, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'open:app:list', 999, 1, 1, '2024-10-15 16:18:23', NULL, NULL); -INSERT INTO `sys_menu` VALUES (636599448054534277, '导出', 635516794676711501, 3, NULL, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'open:app:export', 999, 1, 1, '2024-10-15 16:18:56', NULL, NULL); -INSERT INTO `sys_menu` VALUES (637299919924760580, '删除', 635516794676711501, 3, NULL, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'open:app:delete', 1, 1, 1, '2024-10-17 14:42:21', NULL, NULL); -INSERT INTO `sys_menu` VALUES (637300206014042119, '修改', 635516794676711501, 3, NULL, NULL, NULL, NULL, NULL, b'0', b'0', b'0', 'open:app:update', 1, 1, 1, '2024-10-17 14:43:30', NULL, NULL); --- 应用管理字典数据 -INSERT INTO `sys_dict` VALUES (639152724557963332, '应用状态', 'app_type', NULL, b'0', 1, '2024-10-22 17:24:44', NULL, NULL); -INSERT INTO `sys_dict_item` VALUES (639152915579150411, '禁用', '0', 'blue', 999, NULL, 1, 639152724557963332, 1, '2024-10-22 17:25:30', NULL, NULL); -INSERT INTO `sys_dict_item` VALUES (639153003290435665, '启用', '1', 'green', 999, NULL, 1, 639152724557963332, 1, '2024-10-22 17:25:51', NULL, NULL); \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_column.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_column.sql deleted file mode 100644 index 09feb98ed..000000000 --- a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_column.sql +++ /dev/null @@ -1,9 +0,0 @@ --- liquibase formatted sql - --- changeset Charles7c:3.3-1 -ALTER TABLE `gen_field_config` ADD COLUMN `dict_code` varchar(30) DEFAULT NULL COMMENT '字典编码' AFTER `query_type`; - --- changeset Charles7c:3.3-2 -ALTER TABLE `sys_role` - ADD COLUMN `menu_check_strictly` bit(1) DEFAULT b'0' COMMENT '菜单选择是否父子节点关联' AFTER `is_system`, - ADD COLUMN `dept_check_strictly` bit(1) DEFAULT b'0' COMMENT '部门选择是否父子节点关联' AFTER `menu_check_strictly`; diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_column.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_column.sql similarity index 96% rename from continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_column.sql rename to continew-admin-webapi/src/main/resources/db/changelog/mysql/main_column.sql index 3d8508eb8..874085b8b 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_column.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_column.sql @@ -1 +1,2 @@ -- liquibase formatted sql + diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_data.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_data.sql similarity index 66% rename from continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_data.sql rename to continew-admin-webapi/src/main/resources/db/changelog/mysql/main_data.sql index a8fe21c26..ce13eeb16 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_data.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_data.sql @@ -8,75 +8,85 @@ INSERT INTO `sys_menu` VALUES (1000, '系统管理', 0, 1, '/system', 'System', 'Layout', '/system/user', 'settings', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), (1010, '用户管理', 1000, 2, '/system/user', 'SystemUser', 'system/user/index', NULL, 'user', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), -(1011, '查看', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:list', 1, 1, 1, NOW(), NULL, NULL), -(1012, '新增', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:add', 2, 1, 1, NOW(), NULL, NULL), -(1013, '修改', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:update', 3, 1, 1, NOW(), NULL, NULL), -(1014, '删除', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:delete', 4, 1, 1, NOW(), NULL, NULL), -(1015, '导出', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:export', 5, 1, 1, NOW(), NULL, NULL), -(1016, '重置密码', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:resetPwd', 6, 1, 1, NOW(), NULL, NULL), +(1011, '列表', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:list', 1, 1, 1, NOW(), NULL, NULL), +(1012, '详情', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:detail', 2, 1, 1, NOW(), NULL, NULL), +(1013, '新增', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:add', 3, 1, 1, NOW(), NULL, NULL), +(1014, '修改', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:update', 4, 1, 1, NOW(), NULL, NULL), +(1015, '删除', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:delete', 5, 1, 1, NOW(), NULL, NULL), +(1016, '导出', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:export', 6, 1, 1, NOW(), NULL, NULL), +(1017, '导入', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:import', 7, 1, 1, NOW(), NULL, NULL), +(1018, '重置密码', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:resetPwd', 8, 1, 1, NOW(), NULL, NULL), + (1030, '角色管理', 1000, 2, '/system/role', 'SystemRole', 'system/role/index', NULL, 'user-group', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), -(1031, '查看', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:list', 1, 1, 1, NOW(), NULL, NULL), -(1032, '新增', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:add', 2, 1, 1, NOW(), NULL, NULL), -(1033, '修改', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:update', 3, 1, 1, NOW(), NULL, NULL), -(1034, '删除', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:delete', 4, 1, 1, NOW(), NULL, NULL), +(1031, '列表', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:list', 1, 1, 1, NOW(), NULL, NULL), +(1032, '详情', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:detail', 2, 1, 1, NOW(), NULL, NULL), +(1033, '新增', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:add', 3, 1, 1, NOW(), NULL, NULL), +(1034, '修改', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:update', 4, 1, 1, NOW(), NULL, NULL), +(1035, '删除', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:delete', 5, 1, 1, NOW(), NULL, NULL), + (1050, '菜单管理', 1000, 2, '/system/menu', 'SystemMenu', 'system/menu/index', NULL, 'menu', b'0', b'0', b'0', NULL, 3, 1, 1, NOW(), NULL, NULL), -(1051, '查看', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:list', 1, 1, 1, NOW(), NULL, NULL), +(1051, '列表', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:list', 1, 1, 1, NOW(), NULL, NULL), (1052, '新增', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:add', 2, 1, 1, NOW(), NULL, NULL), (1053, '修改', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:update', 3, 1, 1, NOW(), NULL, NULL), (1054, '删除', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:delete', 4, 1, 1, NOW(), NULL, NULL), + (1060, '部门管理', 1000, 2, '/system/dept', 'SystemDept', 'system/dept/index', NULL, 'mind-mapping', b'0', b'0', b'0', NULL, 4, 1, 1, NOW(), NULL, NULL), -(1061, '查看', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:list', 1, 1, 1, NOW(), NULL, NULL), +(1061, '列表', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:list', 1, 1, 1, NOW(), NULL, NULL), (1062, '新增', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:add', 2, 1, 1, NOW(), NULL, NULL), (1063, '修改', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:update', 3, 1, 1, NOW(), NULL, NULL), (1064, '删除', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:delete', 4, 1, 1, NOW(), NULL, NULL), (1065, '导出', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:export', 5, 1, 1, NOW(), NULL, NULL), + (1070, '字典管理', 1000, 2, '/system/dict', 'SystemDict', 'system/dict/index', NULL, 'bookmark', b'0', b'0', b'0', NULL, 5, 1, 1, NOW(), NULL, NULL), -(1071, '查看', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:list', 1, 1, 1, NOW(), NULL, NULL), +(1071, '列表', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:list', 1, 1, 1, NOW(), NULL, NULL), (1072, '新增', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:add', 2, 1, 1, NOW(), NULL, NULL), (1073, '修改', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:update', 3, 1, 1, NOW(), NULL, NULL), (1074, '删除', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:delete', 4, 1, 1, NOW(), NULL, NULL), (1080, '字典项管理', 1000, 2, '/system/dict/item', 'SystemDictItem', 'system/dict/item/index', NULL, 'bookmark', b'0', b'0', b'1', NULL, 5, 1, 1, NOW(), NULL, NULL), -(1081, '查看', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:list', 1, 1, 1, NOW(), NULL, NULL), +(1081, '列表', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:list', 1, 1, 1, NOW(), NULL, NULL), (1082, '新增', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:add', 2, 1, 1, NOW(), NULL, NULL), (1083, '修改', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:update', 3, 1, 1, NOW(), NULL, NULL), (1084, '删除', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:delete', 4, 1, 1, NOW(), NULL, NULL), + (1090, '通知公告', 1000, 2, '/system/notice', 'SystemNotice', 'system/notice/index', NULL, 'notification', b'0', b'0', b'0', NULL, 6, 1, 1, NOW(), NULL, NULL), -(1091, '查看', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:list', 1, 1, 1, NOW(), NULL, NULL), -(1092, '新增', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:add', 2, 1, 1, NOW(), NULL, NULL), -(1093, '修改', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:update', 3, 1, 1, NOW(), NULL, NULL), -(1094, '删除', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:delete', 4, 1, 1, NOW(), NULL, NULL), +(1091, '列表', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:list', 1, 1, 1, NOW(), NULL, NULL), +(1092, '详情', 1090, 2, '/system/notice/detail', 'SystemNoticeDetail', 'system/notice/page/detail', NULL, NULL, b'0', b'0', b'1', 'system:notice:detail', 2, 1, 1, NOW(), NULL, NULL), +(1093, '新增', 1090, 2, '/system/notice/add', 'SystemNoticeAdd', 'system/notice/page/add', NULL, NULL, b'0', b'0', b'1', 'system:notice:add', 3, 1, 1, NOW(), NULL, NULL), +(1094, '修改', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:update', 4, 1, 1, NOW(), NULL, NULL), +(1095, '删除', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:delete', 5, 1, 1, NOW(), NULL, NULL), + (1100, '文件管理', 1000, 2, '/system/file', 'SystemFile', 'system/file/index', NULL, 'file', b'0', b'0', b'0', NULL, 7, 1, 1, NOW(), NULL, NULL), -(1101, '查看', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:list', 1, 1, 1, NOW(), NULL, NULL), -(1102, '上传', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:upload', 2, 1, 1, NOW(), NULL, NULL), -(1103, '修改', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:update', 3, 1, 1, NOW(), NULL, NULL), -(1104, '删除', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:delete', 4, 1, 1, NOW(), NULL, NULL), -(1105, '下载', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:download', 5, 1, 1, NOW(), NULL, NULL), +(1101, '列表', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:list', 1, 1, 1, NOW(), NULL, NULL), +(1102, '详情', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:detail', 2, 1, 1, NOW(), NULL, NULL), +(1103, '上传', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:upload', 3, 1, 1, NOW(), NULL, NULL), +(1104, '修改', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:update', 4, 1, 1, NOW(), NULL, NULL), +(1105, '删除', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:delete', 5, 1, 1, NOW(), NULL, NULL), +(1106, '下载', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:download', 6, 1, 1, NOW(), NULL, NULL), + (1110, '存储管理', 1000, 2, '/system/storage', 'SystemStorage', 'system/storage/index', NULL, 'storage', b'0', b'0', b'0', NULL, 8, 1, 1, NOW(), NULL, NULL), -(1111, '查看', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:list', 1, 1, 1, NOW(), NULL, NULL), +(1111, '列表', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:list', 1, 1, 1, NOW(), NULL, NULL), (1112, '新增', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:add', 2, 1, 1, NOW(), NULL, NULL), (1113, '修改', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:update', 3, 1, 1, NOW(), NULL, NULL), (1114, '删除', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:delete', 4, 1, 1, NOW(), NULL, NULL), + (1190, '系统配置', 1000, 2, '/system/config', 'SystemConfig', 'system/config/index', NULL, 'desktop', b'0', b'0', b'0', NULL, 999, 1, 1, NOW(), NULL, NULL), (1191, '查看', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:list', 1, 1, 1, NOW(), NULL, NULL), (1192, '修改', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:update', 2, 1, 1, NOW(), NULL, NULL), (1193, '重置', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:reset', 3, 1, 1, NOW(), NULL, NULL), + (2000, '系统监控', 0, 1, '/monitor', 'Monitor', 'Layout', '/monitor/online', 'computer', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), (2010, '在线用户', 2000, 2, '/monitor/online', 'MonitorOnline', 'monitor/online/index', NULL, 'user', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), -(2011, '查看', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:list', 1, 1, 1, NOW(), NULL, NULL), +(2011, '列表', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:list', 1, 1, 1, NOW(), NULL, NULL), (2012, '强退', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:kickout', 2, 1, 1, NOW(), NULL, NULL), (2020, '系统日志', 2000, 2, '/monitor/log', 'MonitorLog', 'monitor/log/index', NULL, 'history', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), -(2021, '查看', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:list', 1, 1, 1, NOW(), NULL, NULL), -(2022, '导出', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:export', 2, 1, 1, NOW(), NULL, NULL), -(3000, '系统工具', 0, 1, '/tool', 'Tool', 'Layout', '/tool/generator', 'tool', b'0', b'0', b'0', NULL, 3, 1, 1, NOW(), NULL, NULL), -(3010, '代码生成', 3000, 2, '/tool/generator', 'ToolGenerator', 'tool/generator/index', NULL, 'code', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), -(3011, '查看', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:list', 1, 1, 1, NOW(), NULL, NULL), -(3012, '配置', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:config', 2, 1, 1, NOW(), NULL, NULL), -(3013, '预览', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:preview', 3, 1, 1, NOW(), NULL, NULL), -(3014, '生成', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:generate', 4, 1, 1, NOW(), NULL, NULL), +(2021, '列表', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:list', 1, 1, 1, NOW(), NULL, NULL), +(2022, '详情', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:detail', 2, 1, 1, NOW(), NULL, NULL), +(2023, '导出', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:export', 3, 1, 1, NOW(), NULL, NULL), + (10000, '关于项目', 0, 1, '/project', 'Project', 'Layout', NULL, 'apps', b'0', b'0', b'0', NULL, 999, 1, 1, NOW(), NULL, NULL), (10001, '接口文档', 10000, 2, 'https://api.continew.top/doc.html', NULL, NULL, NULL, 'code-square', b'1', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), (10002, 'Gitee', 10000, 2, 'https://gitee.com/continew/continew-admin', NULL, NULL, NULL, 'gitee', b'1', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), -(10003, 'GitHub', 10000, 2, 'https://github.com/charles7c/continew-admin', NULL, NULL, NULL, 'github', b'1', b'0', b'0', NULL, 3, 1, 1, NOW(), NULL, NULL); +(10003, 'GitHub', 10000, 2, 'https://github.com/continew-org/continew-admin', NULL, NULL, NULL, 'github', b'1', b'0', b'0', NULL, 3, 1, 1, NOW(), NULL, NULL); -- 初始化默认部门 INSERT INTO `sys_dept` @@ -112,7 +122,7 @@ VALUES (1, 'SITE', '系统标题', 'SITE_TITLE', NULL, 'ContiNew Admin', '用于显示登录页面的系统标题。', NULL, NULL), (2, 'SITE', '系统描述', 'SITE_DESCRIPTION', NULL, '持续迭代优化的前后端分离中后台管理系统框架', NULL, NULL, NULL), (3, 'SITE', '版权信息', 'SITE_COPYRIGHT', NULL, 'Copyright © 2022 - present ContiNew Admin 版权所有', '用于显示登录页面的底部版权信息。', NULL, NULL), -(4, 'SITE', '备案号', 'SITE_BEIAN', NULL, '津ICP备2022005864号-3', 'ICP备案号', NULL, NULL), +(4, 'SITE', '备案号', 'SITE_BEIAN', NULL, NULL, 'ICP备案号', NULL, NULL), (5, 'SITE', 'favicon', 'SITE_FAVICON', NULL, '/favicon.ico', '用于显示浏览器地址栏的系统LOGO。', NULL, NULL), (6, 'SITE', '系统LOGO', 'SITE_LOGO', NULL, '/logo.svg', '用于显示登录页面的系统LOGO。', NULL, NULL), (7, 'PASSWORD', '登录密码错误锁定账号的次数', 'PASSWORD_ERROR_LOCK_COUNT', NULL, '5', '取值范围为 0-10(0 表示不锁定)。', NULL, NULL), @@ -174,31 +184,3 @@ VALUES (1, '开发环境', 'local_dev', 2, NULL, NULL, NULL, 'C:/continew-admin/data/file/', 'http://localhost:8000/file', '本地存储', b'1', 1, 1, 1, NOW(), NULL, NULL), (2, '生产环境', 'local_prod', 2, NULL, NULL, NULL, '../data/file/', 'http://api.continew.top/file', '本地存储', b'0', 2, 2, 1, NOW(), NULL, NULL); --- changeset Kai:3.2-1 -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 -(4000, '任务调度', 0, 1, '/schedule', 'Schedule', 'Layout', '/schedule/job', 'schedule', b'0', b'0', b'0', NULL, 997, 1, 1, NOW(), NULL, NULL), -(4010, '任务管理', 4000, 2, '/schedule/job', 'ScheduleJob', 'schedule/job/index', NULL, 'select-all', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), -(4011, '查看', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:list', 1, 1, 1, NOW(), NULL, NULL), -(4012, '新增', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:add', 2, 1, 1, NOW(), NULL, NULL), -(4013, '修改', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:update', 3, 1, 1, NOW(), NULL, NULL), -(4014, '删除', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:delete', 4, 1, 1, NOW(), NULL, NULL), -(4015, '执行', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:trigger', 5, 1, 1, NOW(), NULL, NULL), -(4020, '任务日志', 4000, 2, '/schedule/log', 'ScheduleLog', 'schedule/log/index', NULL, 'find-replace', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), -(4021, '查看', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:list', 1, 1, 1, NOW(), NULL, NULL), -(4022, '停止', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:stop', 2, 1, 1, NOW(), NULL, NULL), -(4023, '重试', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:retry', 3, 1, 1, NOW(), NULL, NULL); - --- changeset Charles7c:3.2-2 -UPDATE `sys_menu` SET `type` = 2, `path` = '/system/notice/detail', name = 'SystemNoticeDetail', component = 'system/notice/page/detail', `is_external` = b'0', `is_cache` = b'0', `is_hidden` = b'1' WHERE `id` = 1091; -UPDATE `sys_menu` SET `type` = 2, `path` = '/system/notice/add', name = 'SystemNoticeAdd', component = 'system/notice/page/add', `is_external` = b'0', `is_cache` = b'0', `is_hidden` = b'1' WHERE `id` = 1092; - --- changeset Charles7c:3.3-1 -UPDATE `sys_menu` SET `parent_id` = 4010 WHERE `id` = 4015; -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 -(1017, '导入', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:import', 7, 1, 1, NOW(), NULL, NULL); - --- changeset Charles7c:3.4-1 -UPDATE `sys_option` SET `default_value` = NULL WHERE `code` = 'SITE_BEIAN'; \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_table.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_table.sql similarity index 68% rename from continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_table.sql rename to continew-admin-webapi/src/main/resources/db/changelog/mysql/main_table.sql index cf75451f7..dc8f4e620 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/mysql/continew-admin_table.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/main_table.sql @@ -1,6 +1,6 @@ -- liquibase formatted sql --- changeset Charles7c:1 +-- changeset charles7c:1 -- comment 初始化表结构 CREATE TABLE IF NOT EXISTS `sys_menu` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', @@ -22,11 +22,11 @@ CREATE TABLE IF NOT EXISTS `sys_menu` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_title_parent_id`(`title`, `parent_id`) USING BTREE, - INDEX `idx_parent_id`(`parent_id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_title_parent_id`(`title`, `parent_id`), + INDEX `idx_parent_id`(`parent_id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单表'; CREATE TABLE IF NOT EXISTS `sys_dept` ( @@ -42,30 +42,32 @@ CREATE TABLE IF NOT EXISTS `sys_dept` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_name_parent_id`(`name`, `parent_id`) USING BTREE, - INDEX `idx_parent_id`(`parent_id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_name_parent_id`(`name`, `parent_id`), + INDEX `idx_parent_id`(`parent_id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门表'; CREATE TABLE IF NOT EXISTS `sys_role` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `name` varchar(30) NOT NULL COMMENT '名称', - `code` varchar(30) NOT NULL COMMENT '编码', - `data_scope` tinyint(1) NOT NULL DEFAULT 4 COMMENT '数据权限(1:全部数据权限;2:本部门及以下数据权限;3:本部门数据权限;4:仅本人数据权限;5:自定义数据权限)', - `description` varchar(200) DEFAULT NULL COMMENT '描述', - `sort` int NOT NULL DEFAULT 999 COMMENT '排序', - `is_system` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否为系统内置数据', - `create_user` bigint(20) NOT NULL COMMENT '创建人', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', - `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_name`(`name`) USING BTREE, - UNIQUE INDEX `uk_code`(`code`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(30) NOT NULL COMMENT '名称', + `code` varchar(30) NOT NULL COMMENT '编码', + `data_scope` tinyint(1) NOT NULL DEFAULT 4 COMMENT '数据权限(1:全部数据权限;2:本部门及以下数据权限;3:本部门数据权限;4:仅本人数据权限;5:自定义数据权限)', + `description` varchar(200) DEFAULT NULL COMMENT '描述', + `sort` int NOT NULL DEFAULT 999 COMMENT '排序', + `is_system` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否为系统内置数据', + `menu_check_strictly` bit(1) DEFAULT b'0' COMMENT '菜单选择是否父子节点关联', + `dept_check_strictly` bit(1) DEFAULT b'0' COMMENT '部门选择是否父子节点关联', + `create_user` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_name`(`name`), + UNIQUE INDEX `uk_code`(`code`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; CREATE TABLE IF NOT EXISTS `sys_user` ( @@ -86,13 +88,13 @@ CREATE TABLE IF NOT EXISTS `sys_user` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_username`(`username`) USING BTREE, - UNIQUE INDEX `uk_email`(`email`) USING BTREE, - UNIQUE INDEX `uk_phone`(`phone`) USING BTREE, - INDEX `idx_dept_id`(`dept_id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_username`(`username`), + UNIQUE INDEX `uk_email`(`email`), + UNIQUE INDEX `uk_phone`(`phone`), + INDEX `idx_dept_id`(`dept_id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; CREATE TABLE IF NOT EXISTS `sys_user_password_history` ( @@ -100,36 +102,38 @@ CREATE TABLE IF NOT EXISTS `sys_user_password_history` ( `user_id` bigint(20) NOT NULL COMMENT '用户ID', `password` varchar(255) NOT NULL COMMENT '密码', `create_time` datetime NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_user_id`(`user_id`) USING BTREE + PRIMARY KEY (`id`), + INDEX `idx_user_id`(`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户历史密码表'; CREATE TABLE IF NOT EXISTS `sys_user_social` ( - `source` varchar(255) NOT NULL COMMENT '来源', - `open_id` varchar(255) NOT NULL COMMENT '开放ID', - `user_id` bigint(20) NOT NULL COMMENT '用户ID', - `meta_json` text DEFAULT NULL COMMENT '附加信息', - `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间', - `create_time` datetime NOT NULL COMMENT '创建时间', - UNIQUE INDEX `uk_source_open_id`(`source`, `open_id`) USING BTREE + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `source` varchar(255) NOT NULL COMMENT '来源', + `open_id` varchar(255) NOT NULL COMMENT '开放ID', + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `meta_json` text DEFAULT NULL COMMENT '附加信息', + `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间', + `create_time` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_source_open_id`(`source`, `open_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户社会化关联表'; CREATE TABLE IF NOT EXISTS `sys_user_role` ( `user_id` bigint(20) NOT NULL COMMENT '用户ID', `role_id` bigint(20) NOT NULL COMMENT '角色ID', - PRIMARY KEY (`user_id`, `role_id`) USING BTREE + PRIMARY KEY (`user_id`, `role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和角色关联表'; CREATE TABLE IF NOT EXISTS `sys_role_menu` ( `role_id` bigint(20) NOT NULL COMMENT '角色ID', `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', - PRIMARY KEY (`role_id`, `menu_id`) USING BTREE + PRIMARY KEY (`role_id`, `menu_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和菜单关联表'; CREATE TABLE IF NOT EXISTS `sys_role_dept` ( `role_id` bigint(20) NOT NULL COMMENT '角色ID', `dept_id` bigint(20) NOT NULL COMMENT '部门ID', - PRIMARY KEY (`role_id`, `dept_id`) USING BTREE + PRIMARY KEY (`role_id`, `dept_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和部门关联表'; CREATE TABLE IF NOT EXISTS `sys_option` ( @@ -137,13 +141,13 @@ CREATE TABLE IF NOT EXISTS `sys_option` ( `category` varchar(50) NOT NULL COMMENT '类别', `name` varchar(50) NOT NULL COMMENT '名称', `code` varchar(100) NOT NULL COMMENT '键', - `value` text DEFAULT NULL COMMENT '值', - `default_value` text DEFAULT NULL COMMENT '默认值', + `value` longtext DEFAULT NULL COMMENT '值', + `default_value` longtext DEFAULT NULL COMMENT '默认值', `description` varchar(200) DEFAULT NULL COMMENT '描述', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_category_code`(`category`, `code`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_category_code`(`category`, `code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参数表'; CREATE TABLE IF NOT EXISTS `sys_dict` ( @@ -156,9 +160,9 @@ CREATE TABLE IF NOT EXISTS `sys_dict` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_name`(`name`) USING BTREE, - UNIQUE INDEX `uk_code`(`code`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_name`(`name`), + UNIQUE INDEX `uk_code`(`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字典表'; CREATE TABLE IF NOT EXISTS `sys_dict_item` ( @@ -174,11 +178,11 @@ CREATE TABLE IF NOT EXISTS `sys_dict_item` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_value_dict_id`(`value`, `dict_id`) USING BTREE, - INDEX `idx_dict_id`(`dict_id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_value_dict_id`(`value`, `dict_id`), + INDEX `idx_dict_id`(`dict_id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字典项表'; CREATE TABLE IF NOT EXISTS `sys_log` ( @@ -202,10 +206,10 @@ CREATE TABLE IF NOT EXISTS `sys_log` ( `error_msg` text DEFAULT NULL COMMENT '错误信息', `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', `create_time` datetime NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_module`(`module`) USING BTREE, - INDEX `idx_ip`(`ip`) USING BTREE, - INDEX `idx_create_time`(`create_time`) USING BTREE + PRIMARY KEY (`id`), + INDEX `idx_module`(`module`), + INDEX `idx_ip`(`ip`), + INDEX `idx_create_time`(`create_time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统日志表'; CREATE TABLE IF NOT EXISTS `sys_message` ( @@ -215,7 +219,7 @@ CREATE TABLE IF NOT EXISTS `sys_message` ( `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '类型(1:系统消息)', `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', `create_time` datetime NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息表'; CREATE TABLE IF NOT EXISTS `sys_message_user` ( @@ -223,7 +227,7 @@ CREATE TABLE IF NOT EXISTS `sys_message_user` ( `user_id` bigint(11) NOT NULL COMMENT '用户ID', `is_read` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已读', `read_time` datetime DEFAULT NULL COMMENT '读取时间', - PRIMARY KEY (`message_id`, `user_id`) USING BTREE + PRIMARY KEY (`message_id`, `user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息和用户关联表'; CREATE TABLE IF NOT EXISTS `sys_notice` ( @@ -233,14 +237,16 @@ CREATE TABLE IF NOT EXISTS `sys_notice` ( `type` varchar(30) NOT NULL COMMENT '类型', `effective_time` datetime DEFAULT NULL COMMENT '生效时间', `terminate_time` datetime DEFAULT NULL COMMENT '终止时间', + `notice_scope` int NOT NULL COMMENT '通知范围', + `notice_users` json DEFAULT NULL COMMENT '通知用户', `sort` int NOT NULL DEFAULT 999 COMMENT '排序', `create_user` bigint(20) NOT NULL COMMENT '创建人', `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公告表'; CREATE TABLE IF NOT EXISTS `sys_storage` ( @@ -261,10 +267,10 @@ CREATE TABLE IF NOT EXISTS `sys_storage` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_code`(`code`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + UNIQUE INDEX `uk_code`(`code`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='存储表'; CREATE TABLE IF NOT EXISTS `sys_file` ( @@ -281,46 +287,9 @@ CREATE TABLE IF NOT EXISTS `sys_file` ( `create_time` datetime NOT NULL COMMENT '创建时间', `update_user` bigint(20) NOT NULL COMMENT '修改人', `update_time` datetime NOT NULL COMMENT '修改时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_url`(`url`) USING BTREE, - INDEX `idx_type`(`type`) USING BTREE, - INDEX `idx_create_user`(`create_user`) USING BTREE, - INDEX `idx_update_user`(`update_user`) USING BTREE + PRIMARY KEY (`id`), + INDEX `idx_url`(`url`), + INDEX `idx_type`(`type`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件表'; - -CREATE TABLE IF NOT EXISTS `gen_config` ( - `table_name` varchar(64) NOT NULL COMMENT '表名称', - `module_name` varchar(60) NOT NULL COMMENT '模块名称', - `package_name` varchar(60) NOT NULL COMMENT '包名称', - `business_name` varchar(50) NOT NULL COMMENT '业务名称', - `author` varchar(100) NOT NULL COMMENT '作者', - `table_prefix` varchar(20) DEFAULT NULL COMMENT '表前缀', - `is_override` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否覆盖', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`table_name`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生成配置表'; - -CREATE TABLE IF NOT EXISTS `gen_field_config` ( - `table_name` varchar(64) NOT NULL COMMENT '表名称', - `column_name` varchar(64) NOT NULL COMMENT '列名称', - `column_type` varchar(25) NOT NULL COMMENT '列类型', - `column_size` bigint(20) DEFAULT NULL COMMENT '列大小', - `field_name` varchar(64) NOT NULL COMMENT '字段名称', - `field_type` varchar(25) NOT NULL COMMENT '字段类型', - `field_sort` int NOT NULL DEFAULT 999 COMMENT '字段排序', - `comment` varchar(512) DEFAULT NULL COMMENT '注释', - `is_required` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否必填', - `show_in_list` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在列表中显示', - `show_in_form` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在表单中显示', - `show_in_query` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在查询中显示', - `form_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '表单类型', - `query_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '查询方式', - `create_time` datetime NOT NULL COMMENT '创建时间', - INDEX `idx_table_name`(`table_name`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字段配置表'; - --- changeset kils:3.2.0-1 -ALTER TABLE `sys_option` - MODIFY COLUMN `value` longtext DEFAULT NULL COMMENT '值', - MODIFY COLUMN `default_value` longtext DEFAULT NULL COMMENT '默认值'; \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_generator.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_generator.sql new file mode 100644 index 000000000..ac8585f53 --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_generator.sql @@ -0,0 +1,50 @@ +-- liquibase formatted sql + +-- changeset charles7c:1 +-- comment 初始化代码生成插件 +-- 初始化表结构 +CREATE TABLE IF NOT EXISTS `gen_config` ( + `table_name` varchar(64) NOT NULL COMMENT '表名称', + `module_name` varchar(60) NOT NULL COMMENT '模块名称', + `package_name` varchar(60) NOT NULL COMMENT '包名称', + `business_name` varchar(50) NOT NULL COMMENT '业务名称', + `author` varchar(100) NOT NULL COMMENT '作者', + `table_prefix` varchar(20) DEFAULT NULL COMMENT '表前缀', + `is_override` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否覆盖', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生成配置表'; + +CREATE TABLE IF NOT EXISTS `gen_field_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `table_name` varchar(64) NOT NULL COMMENT '表名称', + `column_name` varchar(64) NOT NULL COMMENT '列名称', + `column_type` varchar(25) NOT NULL COMMENT '列类型', + `column_size` bigint(20) DEFAULT NULL COMMENT '列大小', + `field_name` varchar(64) NOT NULL COMMENT '字段名称', + `field_type` varchar(25) NOT NULL COMMENT '字段类型', + `field_sort` int NOT NULL DEFAULT 999 COMMENT '字段排序', + `comment` varchar(512) DEFAULT NULL COMMENT '注释', + `is_required` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否必填', + `show_in_list` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在列表中显示', + `show_in_form` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在表单中显示', + `show_in_query` bit(1) NOT NULL DEFAULT b'1' COMMENT '是否在查询中显示', + `form_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '表单类型', + `query_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '查询方式', + `dict_code` varchar(30) DEFAULT NULL COMMENT '字典编码', + `create_time` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + INDEX `idx_table_name`(`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字段配置表'; + +-- 初始化默认菜单 +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 +(9000, '代码生成', 0, 1, '/tool', 'Tool', 'Layout', '/tool/generator', 'tool', b'0', b'0', b'0', NULL, 9, 1, 1, NOW(), NULL, NULL), +(9010, '代码生成', 9000, 2, '/tool/generator', 'ToolGenerator', 'tool/generator/index', NULL, 'code', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), +(9011, '列表', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:list', 1, 1, 1, NOW(), NULL, NULL), +(9012, '配置', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:config', 2, 1, 1, NOW(), NULL, NULL), +(9013, '预览', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:preview', 3, 1, 1, NOW(), NULL, NULL), +(9014, '生成', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:generate', 4, 1, 1, NOW(), NULL, NULL); \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_job.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_job.sql new file mode 100644 index 000000000..aa6bc73db --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_job.sql @@ -0,0 +1,21 @@ +-- liquibase formatted sql + +-- changeset kai:1 +-- comment 初始化任务调度插件 +-- 初始化默认菜单 +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 +(3000, '任务调度', 0, 1, '/schedule', 'Schedule', 'Layout', '/schedule/job', 'schedule', b'0', b'0', b'0', NULL, 3, 1, 1, NOW(), NULL, NULL), +(3010, '任务管理', 3000, 2, '/schedule/job', 'ScheduleJob', 'schedule/job/index', NULL, 'select-all', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), +(3011, '列表', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:list', 1, 1, 1, NOW(), NULL, NULL), +(3012, '详情', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:detail', 2, 1, 1, NOW(), NULL, NULL), +(3013, '新增', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:add', 3, 1, 1, NOW(), NULL, NULL), +(3014, '修改', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:update', 4, 1, 1, NOW(), NULL, NULL), +(3015, '删除', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:delete', 5, 1, 1, NOW(), NULL, NULL), +(3016, '执行', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:trigger', 6, 1, 1, NOW(), NULL, NULL), +(3020, '任务日志', 3000, 2, '/schedule/log', 'ScheduleLog', 'schedule/log/index', NULL, 'find-replace', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), +(3021, '列表', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:list', 1, 1, 1, NOW(), NULL, NULL), +(3022, '详情', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:detail', 2, 1, 1, NOW(), NULL, NULL), +(3023, '停止', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:stop', 3, 1, 1, NOW(), NULL, NULL), +(3024, '重试', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:retry', 4, 1, 1, NOW(), NULL, NULL); diff --git a/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_open.sql b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_open.sql new file mode 100644 index 000000000..3e4ff1988 --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/mysql/plugins/plugin_open.sql @@ -0,0 +1,36 @@ +-- liquibase formatted sql + +-- changeset chengzi:1 +-- comment 初始化能力开放插件 +-- 初始化表结构 +CREATE TABLE IF NOT EXISTS `sys_app` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(255) DEFAULT NULL COMMENT '应用名称', + `app_key` varchar(255) DEFAULT NULL COMMENT '应用密钥', + `app_secret` varchar(255) DEFAULT NULL COMMENT '应用密码', + `status` varchar(255) DEFAULT NULL COMMENT '应用状态 (0: 未激活;1: 激活)', + `expiration_time` datetime DEFAULT NULL COMMENT '失效时间', + `app_desc` varchar(255) DEFAULT NULL COMMENT '应用描述', + `secret_status` varchar(255) DEFAULT NULL COMMENT '应用密码查看状态 (0: 未查看;1: 已查看)', + `create_user` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`), + INDEX `idx_create_user`(`create_user`), + INDEX `idx_update_user`(`update_user`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; + +-- 初始化默认菜单 +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 +(7000, '能力开放', 0, 1, '/open', 'Open', 'Layout', '/open/app', 'expand', b'0', b'0', b'0', NULL, 7, 1, 1, NOW(), NULL, NULL), +(7010, '应用管理', 7000, 2, '/open/app', 'OpenApp', 'open/app/index', NULL, 'common', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), +(7011, '列表', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:list', 1, 1, 1, NOW(), NULL, NULL), +(7012, '详情', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:detail', 2, 1, 1, NOW(), NULL, NULL), +(7013, '新增', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:add', 3, 1, 1, NOW(), NULL, NULL), +(7014, '修改', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:update', 4, 1, 1, NOW(), NULL, NULL), +(7015, '删除', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:delete', 5, 1, 1, NOW(), NULL, NULL), +(7016, '导出', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:export', 6, 1, 1, NOW(), NULL, NULL); + diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_column.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_column.sql new file mode 100644 index 000000000..874085b8b --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_column.sql @@ -0,0 +1,2 @@ +-- liquibase formatted sql + diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_data.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_data.sql similarity index 71% rename from continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_data.sql rename to continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_data.sql index e59351ff0..b0f33dadb 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_data.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_data.sql @@ -8,87 +8,85 @@ INSERT INTO "sys_menu" VALUES (1000, '系统管理', 0, 1, '/system', 'System', 'Layout', '/system/user', 'settings', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), (1010, '用户管理', 1000, 2, '/system/user', 'SystemUser', 'system/user/index', NULL, 'user', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), -(1011, '查看', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:list', 1, 1, 1, NOW(), NULL, NULL), -(1012, '新增', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:add', 2, 1, 1, NOW(), NULL, NULL), -(1013, '修改', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:update', 3, 1, 1, NOW(), NULL, NULL), -(1014, '删除', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:delete', 4, 1, 1, NOW(), NULL, NULL), -(1015, '导出', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:export', 5, 1, 1, NOW(), NULL, NULL), -(1016, '导入', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:import', 6, 1, 1, NOW(), NULL, NULL), -(1017, '重置密码', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:resetPwd', 7, 1, 1, NOW(), NULL, NULL), +(1011, '列表', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:list', 1, 1, 1, NOW(), NULL, NULL), +(1012, '详情', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:detail', 2, 1, 1, NOW(), NULL, NULL), +(1013, '新增', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:add', 3, 1, 1, NOW(), NULL, NULL), +(1014, '修改', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:update', 4, 1, 1, NOW(), NULL, NULL), +(1015, '删除', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:delete', 5, 1, 1, NOW(), NULL, NULL), +(1016, '导出', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:export', 6, 1, 1, NOW(), NULL, NULL), +(1017, '导入', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:import', 7, 1, 1, NOW(), NULL, NULL), +(1018, '重置密码', 1010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:user:resetPwd', 8, 1, 1, NOW(), NULL, NULL), + (1030, '角色管理', 1000, 2, '/system/role', 'SystemRole', 'system/role/index', NULL, 'user-group', false, false, false, NULL, 2, 1, 1, NOW(), NULL, NULL), -(1031, '查看', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:list', 1, 1, 1, NOW(), NULL, NULL), -(1032, '新增', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:add', 2, 1, 1, NOW(), NULL, NULL), -(1033, '修改', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:update', 3, 1, 1, NOW(), NULL, NULL), -(1034, '删除', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:delete', 4, 1, 1, NOW(), NULL, NULL), +(1031, '列表', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:list', 1, 1, 1, NOW(), NULL, NULL), +(1032, '详情', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:detail', 2, 1, 1, NOW(), NULL, NULL), +(1033, '新增', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:add', 3, 1, 1, NOW(), NULL, NULL), +(1034, '修改', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:update', 4, 1, 1, NOW(), NULL, NULL), +(1035, '删除', 1030, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:role:delete', 5, 1, 1, NOW(), NULL, NULL), + (1050, '菜单管理', 1000, 2, '/system/menu', 'SystemMenu', 'system/menu/index', NULL, 'menu', false, false, false, NULL, 3, 1, 1, NOW(), NULL, NULL), -(1051, '查看', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:list', 1, 1, 1, NOW(), NULL, NULL), +(1051, '列表', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:list', 1, 1, 1, NOW(), NULL, NULL), (1052, '新增', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:add', 2, 1, 1, NOW(), NULL, NULL), (1053, '修改', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:update', 3, 1, 1, NOW(), NULL, NULL), (1054, '删除', 1050, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:menu:delete', 4, 1, 1, NOW(), NULL, NULL), + (1060, '部门管理', 1000, 2, '/system/dept', 'SystemDept', 'system/dept/index', NULL, 'mind-mapping', false, false, false, NULL, 4, 1, 1, NOW(), NULL, NULL), -(1061, '查看', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:list', 1, 1, 1, NOW(), NULL, NULL), +(1061, '列表', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:list', 1, 1, 1, NOW(), NULL, NULL), (1062, '新增', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:add', 2, 1, 1, NOW(), NULL, NULL), (1063, '修改', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:update', 3, 1, 1, NOW(), NULL, NULL), (1064, '删除', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:delete', 4, 1, 1, NOW(), NULL, NULL), (1065, '导出', 1060, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dept:export', 5, 1, 1, NOW(), NULL, NULL), + (1070, '字典管理', 1000, 2, '/system/dict', 'SystemDict', 'system/dict/index', NULL, 'bookmark', false, false, false, NULL, 5, 1, 1, NOW(), NULL, NULL), -(1071, '查看', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:list', 1, 1, 1, NOW(), NULL, NULL), +(1071, '列表', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:list', 1, 1, 1, NOW(), NULL, NULL), (1072, '新增', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:add', 2, 1, 1, NOW(), NULL, NULL), (1073, '修改', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:update', 3, 1, 1, NOW(), NULL, NULL), (1074, '删除', 1070, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:delete', 4, 1, 1, NOW(), NULL, NULL), (1080, '字典项管理', 1000, 2, '/system/dict/item', 'SystemDictItem', 'system/dict/item/index', NULL, 'bookmark', false, false, true, NULL, 5, 1, 1, NOW(), NULL, NULL), -(1081, '查看', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:list', 1, 1, 1, NOW(), NULL, NULL), +(1081, '列表', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:list', 1, 1, 1, NOW(), NULL, NULL), (1082, '新增', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:add', 2, 1, 1, NOW(), NULL, NULL), (1083, '修改', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:update', 3, 1, 1, NOW(), NULL, NULL), (1084, '删除', 1080, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:dict:item:delete', 4, 1, 1, NOW(), NULL, NULL), + (1090, '通知公告', 1000, 2, '/system/notice', 'SystemNotice', 'system/notice/index', NULL, 'notification', false, false, false, NULL, 6, 1, 1, NOW(), NULL, NULL), -(1091, '查看', 1090, 2, '/system/notice/detail', 'SystemNoticeDetail', 'system/notice/page/detail', NULL, NULL, false, false, true, 'system:notice:list', 1, 1, 1, NOW(), NULL, NULL), -(1092, '新增', 1090, 2, '/system/notice/add', 'SystemNoticeAdd', 'system/notice/page/add', NULL, NULL, false, false, true, 'system:notice:add', 2, 1, 1, NOW(), NULL, NULL), -(1093, '修改', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:update', 3, 1, 1, NOW(), NULL, NULL), -(1094, '删除', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:delete', 4, 1, 1, NOW(), NULL, NULL), +(1091, '列表', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:list', 1, 1, 1, NOW(), NULL, NULL), +(1092, '详情', 1090, 2, '/system/notice/detail', 'SystemNoticeDetail', 'system/notice/page/detail', NULL, NULL, false, false, true, 'system:notice:detail', 2, 1, 1, NOW(), NULL, NULL), +(1093, '新增', 1090, 2, '/system/notice/add', 'SystemNoticeAdd', 'system/notice/page/add', NULL, NULL, false, false, true, 'system:notice:add', 3, 1, 1, NOW(), NULL, NULL), +(1094, '修改', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:update', 4, 1, 1, NOW(), NULL, NULL), +(1095, '删除', 1090, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:notice:delete', 5, 1, 1, NOW(), NULL, NULL), + (1100, '文件管理', 1000, 2, '/system/file', 'SystemFile', 'system/file/index', NULL, 'file', false, false, false, NULL, 7, 1, 1, NOW(), NULL, NULL), -(1101, '查看', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:list', 1, 1, 1, NOW(), NULL, NULL), -(1102, '上传', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:upload', 2, 1, 1, NOW(), NULL, NULL), -(1103, '修改', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:update', 3, 1, 1, NOW(), NULL, NULL), -(1104, '删除', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:delete', 4, 1, 1, NOW(), NULL, NULL), -(1105, '下载', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:download', 5, 1, 1, NOW(), NULL, NULL), +(1101, '列表', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:list', 1, 1, 1, NOW(), NULL, NULL), +(1102, '详情', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:detail', 2, 1, 1, NOW(), NULL, NULL), +(1103, '上传', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:upload', 3, 1, 1, NOW(), NULL, NULL), +(1104, '修改', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:update', 4, 1, 1, NOW(), NULL, NULL), +(1105, '删除', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:delete', 5, 1, 1, NOW(), NULL, NULL), +(1106, '下载', 1100, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:file:download', 6, 1, 1, NOW(), NULL, NULL), + (1110, '存储管理', 1000, 2, '/system/storage', 'SystemStorage', 'system/storage/index', NULL, 'storage', false, false, false, NULL, 8, 1, 1, NOW(), NULL, NULL), -(1111, '查看', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:list', 1, 1, 1, NOW(), NULL, NULL), +(1111, '列表', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:list', 1, 1, 1, NOW(), NULL, NULL), (1112, '新增', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:add', 2, 1, 1, NOW(), NULL, NULL), (1113, '修改', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:update', 3, 1, 1, NOW(), NULL, NULL), (1114, '删除', 1110, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:storage:delete', 4, 1, 1, NOW(), NULL, NULL), + (1190, '系统配置', 1000, 2, '/system/config', 'SystemConfig', 'system/config/index', NULL, 'desktop', false, false, false, NULL, 999, 1, 1, NOW(), NULL, NULL), (1191, '查看', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:list', 1, 1, 1, NOW(), NULL, NULL), (1192, '修改', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:update', 2, 1, 1, NOW(), NULL, NULL), (1193, '重置', 1190, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'system:config:reset', 3, 1, 1, NOW(), NULL, NULL), + (2000, '系统监控', 0, 1, '/monitor', 'Monitor', 'Layout', '/monitor/online', 'computer', false, false, false, NULL, 2, 1, 1, NOW(), NULL, NULL), (2010, '在线用户', 2000, 2, '/monitor/online', 'MonitorOnline', 'monitor/online/index', NULL, 'user', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), -(2011, '查看', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:list', 1, 1, 1, NOW(), NULL, NULL), +(2011, '列表', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:list', 1, 1, 1, NOW(), NULL, NULL), (2012, '强退', 2010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:online:kickout', 2, 1, 1, NOW(), NULL, NULL), (2020, '系统日志', 2000, 2, '/monitor/log', 'MonitorLog', 'monitor/log/index', NULL, 'history', false, false, false, NULL, 2, 1, 1, NOW(), NULL, NULL), -(2021, '查看', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:list', 1, 1, 1, NOW(), NULL, NULL), -(2022, '导出', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:export', 2, 1, 1, NOW(), NULL, NULL), -(3000, '系统工具', 0, 1, '/tool', 'Tool', 'Layout', '/tool/generator', 'tool', false, false, false, NULL, 3, 1, 1, NOW(), NULL, NULL), -(3010, '代码生成', 3000, 2, '/tool/generator', 'ToolGenerator', 'tool/generator/index', NULL, 'code', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), -(3011, '查看', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:list', 1, 1, 1, NOW(), NULL, NULL), -(3012, '配置', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:config', 2, 1, 1, NOW(), NULL, NULL), -(3013, '预览', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:preview', 3, 1, 1, NOW(), NULL, NULL), -(3014, '生成', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:generate', 4, 1, 1, NOW(), NULL, NULL), -(4000, '任务调度', 0, 1, '/schedule', 'Schedule', 'Layout', '/schedule/job', 'schedule', b'0', b'0', b'0', NULL, 997, 1, 1, NOW(), NULL, NULL), -(4010, '任务管理', 4000, 2, '/schedule/job', 'ScheduleJob', 'schedule/job/index', NULL, 'select-all', b'0', b'0', b'0', NULL, 1, 1, 1, NOW(), NULL, NULL), -(4011, '查看', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:list', 1, 1, 1, NOW(), NULL, NULL), -(4012, '新增', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:add', 2, 1, 1, NOW(), NULL, NULL), -(4013, '修改', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:update', 3, 1, 1, NOW(), NULL, NULL), -(4014, '删除', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:delete', 4, 1, 1, NOW(), NULL, NULL), -(4015, '执行', 4010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:trigger', 5, 1, 1, NOW(), NULL, NULL), -(4020, '任务日志', 4000, 2, '/schedule/log', 'ScheduleLog', 'schedule/log/index', NULL, 'find-replace', b'0', b'0', b'0', NULL, 2, 1, 1, NOW(), NULL, NULL), -(4021, '查看', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:list', 1, 1, 1, NOW(), NULL, NULL), -(4022, '停止', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:stop', 2, 1, 1, NOW(), NULL, NULL), -(4023, '重试', 4020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:retry', 3, 1, 1, NOW(), NULL, NULL), +(2021, '列表', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:list', 1, 1, 1, NOW(), NULL, NULL), +(2022, '详情', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:detail', 2, 1, 1, NOW(), NULL, NULL), +(2023, '导出', 2020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'monitor:log:export', 3, 1, 1, NOW(), NULL, NULL), + (10000, '关于项目', 0, 1, '/project', 'Project', 'Layout', NULL, 'apps', false, false, false, NULL, 999, 1, 1, NOW(), NULL, NULL), (10001, '接口文档', 10000, 2, 'https://api.continew.top/doc.html', NULL, NULL, NULL, 'code-square', true, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), (10002, 'Gitee', 10000, 2, 'https://gitee.com/continew/continew-admin', NULL, NULL, NULL, 'gitee', true, false, false, NULL, 2, 1, 1, NOW(), NULL, NULL), -(10003, 'GitHub', 10000, 2, 'https://github.com/charles7c/continew-admin', NULL, NULL, NULL, 'github', true, false, false, NULL, 3, 1, 1, NOW(), NULL, NULL); +(10003, 'GitHub', 10000, 2, 'https://github.com/continew-org/continew-admin', NULL, NULL, NULL, 'github', true, false, false, NULL, 3, 1, 1, NOW(), NULL, NULL); -- 初始化默认部门 INSERT INTO "sys_dept" diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_table.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_table.sql similarity index 86% rename from continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_table.sql rename to continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_table.sql index 171f13c2e..56305f7d8 100644 --- a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/continew-admin_table.sql +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/main_table.sql @@ -83,19 +83,19 @@ COMMENT ON COLUMN "sys_dept"."update_time" IS '修改时间'; COMMENT ON TABLE "sys_dept" IS '部门表'; CREATE TABLE IF NOT EXISTS "sys_role" ( - "id" int8 NOT NULL, - "name" varchar(30) NOT NULL, - "code" varchar(30) NOT NULL, - "data_scope" int2 NOT NULL DEFAULT 4, - "description" varchar(200) DEFAULT NULL, - "sort" int4 NOT NULL DEFAULT 999, - "is_system" bool NOT NULL DEFAULT false, + "id" int8 NOT NULL, + "name" varchar(30) NOT NULL, + "code" varchar(30) NOT NULL, + "data_scope" int2 NOT NULL DEFAULT 4, + "description" varchar(200) DEFAULT NULL, + "sort" int4 NOT NULL DEFAULT 999, + "is_system" bool NOT NULL DEFAULT false, "menu_check_strictly" bool DEFAULT false, "dept_check_strictly" bool DEFAULT false, - "create_user" int8 NOT NULL, - "create_time" timestamp NOT NULL, - "update_user" int8 DEFAULT NULL, - "update_time" timestamp DEFAULT NULL, + "create_user" int8 NOT NULL, + "create_time" timestamp NOT NULL, + "update_user" int8 DEFAULT NULL, + "update_time" timestamp DEFAULT NULL, PRIMARY KEY ("id") ); CREATE UNIQUE INDEX "uk_role_name" ON "sys_role" ("name"); @@ -177,14 +177,17 @@ COMMENT ON COLUMN "sys_user_password_history"."create_time" IS '创建时间'; COMMENT ON TABLE "sys_user_password_history" IS '用户历史密码表'; CREATE TABLE IF NOT EXISTS "sys_user_social" ( + "id" int8 NOT NULL, "source" varchar(255) NOT NULL, "open_id" varchar(255) NOT NULL, "user_id" int8 NOT NULL, "meta_json" text DEFAULT NULL, "last_login_time" timestamp DEFAULT NULL, - "create_time" timestamp NOT NULL + "create_time" timestamp NOT NULL, + PRIMARY KEY ("id") ); CREATE UNIQUE INDEX "uk_user_source_open_id" ON "sys_user_social" ("source", "open_id"); +COMMENT ON COLUMN "sys_user_social"."id" IS 'ID'; COMMENT ON COLUMN "sys_user_social"."source" IS '来源'; COMMENT ON COLUMN "sys_user_social"."open_id" IS '开放ID'; COMMENT ON COLUMN "sys_user_social"."user_id" IS '用户ID'; @@ -486,62 +489,3 @@ COMMENT ON COLUMN "sys_file"."update_user" IS '修改人'; COMMENT ON COLUMN "sys_file"."update_time" IS '修改时间'; COMMENT ON TABLE "sys_file" IS '文件表'; -CREATE TABLE IF NOT EXISTS "gen_config" ( - "table_name" varchar(64) NOT NULL, - "module_name" varchar(60) NOT NULL, - "package_name" varchar(60) NOT NULL, - "business_name" varchar(50) NOT NULL, - "author" varchar(100) NOT NULL, - "table_prefix" varchar(20) DEFAULT NULL, - "is_override" bool NOT NULL DEFAULT false, - "create_time" timestamp NOT NULL, - "update_time" timestamp DEFAULT NULL, - PRIMARY KEY ("table_name") -); -COMMENT ON COLUMN "gen_config"."table_name" IS '表名称'; -COMMENT ON COLUMN "gen_config"."module_name" IS '模块名称'; -COMMENT ON COLUMN "gen_config"."package_name" IS '包名称'; -COMMENT ON COLUMN "gen_config"."business_name" IS '业务名称'; -COMMENT ON COLUMN "gen_config"."author" IS '作者'; -COMMENT ON COLUMN "gen_config"."table_prefix" IS '表前缀'; -COMMENT ON COLUMN "gen_config"."is_override" IS '是否覆盖'; -COMMENT ON COLUMN "gen_config"."create_time" IS '创建时间'; -COMMENT ON COLUMN "gen_config"."update_time" IS '修改时间'; -COMMENT ON TABLE "gen_config" IS '生成配置表'; - -CREATE TABLE IF NOT EXISTS "gen_field_config" ( - "table_name" varchar(64) NOT NULL, - "column_name" varchar(64) NOT NULL, - "column_type" varchar(25) NOT NULL, - "column_size" int8 DEFAULT NULL, - "field_name" varchar(64) NOT NULL, - "field_type" varchar(25) NOT NULL, - "field_sort" int4 NOT NULL DEFAULT 999, - "comment" varchar(512) DEFAULT NULL, - "is_required" bool NOT NULL DEFAULT true, - "show_in_list" bool NOT NULL DEFAULT true, - "show_in_form" bool NOT NULL DEFAULT true, - "show_in_query" bool NOT NULL DEFAULT true, - "form_type" int2 DEFAULT NULL, - "query_type" int2 DEFAULT NULL, - "dict_code" varchar(30) DEFAULT NULL, - "create_time" timestamp NOT NULL -); -CREATE INDEX "idx_field_config_table_name" ON "gen_field_config" ("table_name"); -COMMENT ON COLUMN "gen_field_config"."table_name" IS '表名称'; -COMMENT ON COLUMN "gen_field_config"."column_name" IS '列名称'; -COMMENT ON COLUMN "gen_field_config"."column_type" IS '列类型'; -COMMENT ON COLUMN "gen_field_config"."column_size" IS '列大小'; -COMMENT ON COLUMN "gen_field_config"."field_name" IS '字段名称'; -COMMENT ON COLUMN "gen_field_config"."field_type" IS '字段类型'; -COMMENT ON COLUMN "gen_field_config"."field_sort" IS '字段排序'; -COMMENT ON COLUMN "gen_field_config"."comment" IS '注释'; -COMMENT ON COLUMN "gen_field_config"."is_required" IS '是否必填'; -COMMENT ON COLUMN "gen_field_config"."show_in_list" IS '是否在列表中显示'; -COMMENT ON COLUMN "gen_field_config"."show_in_form" IS '是否在表单中显示'; -COMMENT ON COLUMN "gen_field_config"."show_in_query" IS '是否在查询中显示'; -COMMENT ON COLUMN "gen_field_config"."form_type" IS '表单类型'; -COMMENT ON COLUMN "gen_field_config"."query_type" IS '查询方式'; -COMMENT ON COLUMN "gen_field_config"."dict_code" IS '字典编码'; -COMMENT ON COLUMN "gen_field_config"."create_time" IS '创建时间'; -COMMENT ON TABLE "gen_field_config" IS '字段配置表'; \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_generator.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_generator.sql new file mode 100644 index 000000000..2664e4ce6 --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_generator.sql @@ -0,0 +1,78 @@ +-- liquibase formatted sql + +-- changeset charles7c:1 +-- comment 初始化代码生成插件 +-- 初始化表结构 +CREATE TABLE IF NOT EXISTS "gen_config" ( + "table_name" varchar(64) NOT NULL, + "module_name" varchar(60) NOT NULL, + "package_name" varchar(60) NOT NULL, + "business_name" varchar(50) NOT NULL, + "author" varchar(100) NOT NULL, + "table_prefix" varchar(20) DEFAULT NULL, + "is_override" bool NOT NULL DEFAULT false, + "create_time" timestamp NOT NULL, + "update_time" timestamp DEFAULT NULL, + PRIMARY KEY ("table_name") +); +COMMENT ON COLUMN "gen_config"."table_name" IS '表名称'; +COMMENT ON COLUMN "gen_config"."module_name" IS '模块名称'; +COMMENT ON COLUMN "gen_config"."package_name" IS '包名称'; +COMMENT ON COLUMN "gen_config"."business_name" IS '业务名称'; +COMMENT ON COLUMN "gen_config"."author" IS '作者'; +COMMENT ON COLUMN "gen_config"."table_prefix" IS '表前缀'; +COMMENT ON COLUMN "gen_config"."is_override" IS '是否覆盖'; +COMMENT ON COLUMN "gen_config"."create_time" IS '创建时间'; +COMMENT ON COLUMN "gen_config"."update_time" IS '修改时间'; +COMMENT ON TABLE "gen_config" IS '生成配置表'; + +CREATE TABLE IF NOT EXISTS "gen_field_config" ( + "id" int8 NOT NULL, + "table_name" varchar(64) NOT NULL, + "column_name" varchar(64) NOT NULL, + "column_type" varchar(25) NOT NULL, + "column_size" int8 DEFAULT NULL, + "field_name" varchar(64) NOT NULL, + "field_type" varchar(25) NOT NULL, + "field_sort" int4 NOT NULL DEFAULT 999, + "comment" varchar(512) DEFAULT NULL, + "is_required" bool NOT NULL DEFAULT true, + "show_in_list" bool NOT NULL DEFAULT true, + "show_in_form" bool NOT NULL DEFAULT true, + "show_in_query" bool NOT NULL DEFAULT true, + "form_type" int2 DEFAULT NULL, + "query_type" int2 DEFAULT NULL, + "dict_code" varchar(30) DEFAULT NULL, + "create_time" timestamp NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "idx_field_config_table_name" ON "gen_field_config" ("table_name"); +COMMENT ON COLUMN "gen_field_config"."id" IS 'ID'; +COMMENT ON COLUMN "gen_field_config"."table_name" IS '表名称'; +COMMENT ON COLUMN "gen_field_config"."column_name" IS '列名称'; +COMMENT ON COLUMN "gen_field_config"."column_type" IS '列类型'; +COMMENT ON COLUMN "gen_field_config"."column_size" IS '列大小'; +COMMENT ON COLUMN "gen_field_config"."field_name" IS '字段名称'; +COMMENT ON COLUMN "gen_field_config"."field_type" IS '字段类型'; +COMMENT ON COLUMN "gen_field_config"."field_sort" IS '字段排序'; +COMMENT ON COLUMN "gen_field_config"."comment" IS '注释'; +COMMENT ON COLUMN "gen_field_config"."is_required" IS '是否必填'; +COMMENT ON COLUMN "gen_field_config"."show_in_list" IS '是否在列表中显示'; +COMMENT ON COLUMN "gen_field_config"."show_in_form" IS '是否在表单中显示'; +COMMENT ON COLUMN "gen_field_config"."show_in_query" IS '是否在查询中显示'; +COMMENT ON COLUMN "gen_field_config"."form_type" IS '表单类型'; +COMMENT ON COLUMN "gen_field_config"."query_type" IS '查询方式'; +COMMENT ON COLUMN "gen_field_config"."dict_code" IS '字典编码'; +COMMENT ON COLUMN "gen_field_config"."create_time" IS '创建时间'; +COMMENT ON TABLE "gen_field_config" IS '字段配置表'; + +-- 初始化默认菜单 +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 +(9000, '代码生成', 0, 1, '/tool', 'Tool', 'Layout', '/tool/generator', 'tool', false, false, false, NULL, 9, 1, 1, NOW(), NULL, NULL), +(9010, '代码生成', 9000, 2, '/tool/generator', 'ToolGenerator', 'tool/generator/index', NULL, 'code', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), +(9011, '列表', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:list', 1, 1, 1, NOW(), NULL, NULL), +(9012, '配置', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:config', 2, 1, 1, NOW(), NULL, NULL), +(9013, '预览', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:preview', 3, 1, 1, NOW(), NULL, NULL), +(9014, '生成', 9010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'tool:generator:generate', 4, 1, 1, NOW(), NULL, NULL); \ No newline at end of file diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_job.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_job.sql new file mode 100644 index 000000000..b65aa60bd --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_job.sql @@ -0,0 +1,21 @@ +-- liquibase formatted sql + +-- changeset kai:1 +-- comment 初始化任务调度插件 +-- 初始化默认菜单 +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 +(3000, '任务调度', 0, 1, '/schedule', 'Schedule', 'Layout', '/schedule/job', 'schedule', false, false, false, NULL, 3, 1, 1, NOW(), NULL, NULL), +(3010, '任务管理', 3000, 2, '/schedule/job', 'ScheduleJob', 'schedule/job/index', NULL, 'select-all', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), +(3011, '列表', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:list', 1, 1, 1, NOW(), NULL, NULL), +(3012, '详情', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:detail', 2, 1, 1, NOW(), NULL, NULL), +(3013, '新增', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:add', 3, 1, 1, NOW(), NULL, NULL), +(3014, '修改', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:update', 4, 1, 1, NOW(), NULL, NULL), +(3015, '删除', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:delete', 5, 1, 1, NOW(), NULL, NULL), +(3016, '执行', 3010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:job:trigger', 6, 1, 1, NOW(), NULL, NULL), +(3020, '任务日志', 3000, 2, '/schedule/log', 'ScheduleLog', 'schedule/log/index', NULL, 'find-replace', false, false, false, NULL, 2, 1, 1, NOW(), NULL, NULL), +(3021, '列表', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:list', 1, 1, 1, NOW(), NULL, NULL), +(3022, '详情', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:detail', 2, 1, 1, NOW(), NULL, NULL), +(3023, '停止', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:stop', 3, 1, 1, NOW(), NULL, NULL), +(3024, '重试', 3020, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'schedule:log:retry', 4, 1, 1, NOW(), NULL, NULL); diff --git a/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_open.sql b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_open.sql new file mode 100644 index 000000000..97b76a60d --- /dev/null +++ b/continew-admin-webapi/src/main/resources/db/changelog/postgresql/plugins/plugin_open.sql @@ -0,0 +1,49 @@ +-- liquibase formatted sql + +-- changeset chengzi:1 +-- comment 初始化能力开放插件 +-- 初始化表结构 +CREATE TABLE IF NOT EXISTS "sys_app" ( + "id" int8 DEFAULT NULL, + "name" varchar(255) DEFAULT NULL, + "app_key" varchar(255) DEFAULT NULL, + "app_secret" varchar(255) DEFAULT NULL, + "status" varchar(255) DEFAULT NULL, + "expiration_time" timestamp DEFAULT NULL, + "app_desc" varchar(255) DEFAULT NULL, + "secret_status" varchar(255) DEFAULT NULL, + "create_user" int8 NOT NULL, + "create_time" timestamp NOT NULL, + "update_user" int8 NOT NULL, + "update_time" timestamp NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "idx_app_create_user" ON "sys_app" ("create_user"); +CREATE INDEX "idx_app_update_user" ON "sys_app" ("update_user"); +COMMENT ON COLUMN "sys_app"."id" IS 'ID'; +COMMENT ON COLUMN "sys_app"."name" IS '名称'; +COMMENT ON COLUMN "sys_app"."app_key" IS '应用密钥'; +COMMENT ON COLUMN "sys_app"."app_secret" IS '应用密码'; +COMMENT ON COLUMN "sys_app"."status" IS '应用状态 (0: 未激活;1: 激活)'; +COMMENT ON COLUMN "sys_app"."expiration_time" IS '失效时间'; +COMMENT ON COLUMN "sys_app"."app_desc" IS '应用描述'; +COMMENT ON COLUMN "sys_app"."secret_status" IS '应用密码查看状态 (0: 未查看;1: 已查看)'; +COMMENT ON COLUMN "sys_app"."create_user" IS '创建人'; +COMMENT ON COLUMN "sys_app"."create_time" IS '创建时间'; +COMMENT ON COLUMN "sys_app"."update_user" IS '修改人'; +COMMENT ON COLUMN "sys_app"."update_time" IS '修改时间'; +COMMENT ON TABLE "sys_app" IS '应用表'; + +-- 初始化默认菜单 +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 +(7000, '能力开放', 0, 1, '/open', 'Open', 'Layout', '/open/app', 'expand', false, false, false, NULL, 7, 1, 1, NOW(), NULL, NULL), +(7010, '应用管理', 7000, 2, '/open/app', 'OpenApp', 'open/app/index', NULL, 'common', false, false, false, NULL, 1, 1, 1, NOW(), NULL, NULL), +(7011, '列表', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:list', 1, 1, 1, NOW(), NULL, NULL), +(7012, '详情', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:detail', 2, 1, 1, NOW(), NULL, NULL), +(7013, '新增', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:add', 3, 1, 1, NOW(), NULL, NULL), +(7014, '修改', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:update', 4, 1, 1, NOW(), NULL, NULL), +(7015, '删除', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:delete', 5, 1, 1, NOW(), NULL, NULL), +(7016, '导出', 7010, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'open:app:export', 6, 1, 1, NOW(), NULL, NULL); + diff --git a/pom.xml b/pom.xml index 68e7b2cd6..eb0d1d1ec 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,6 @@ continew-admin-system continew-admin-common continew-admin-extension - continew-admin-open @@ -68,17 +67,17 @@ ${revision} - + top.continew - continew-admin-generator + continew-admin-open ${revision} - + top.continew - continew-admin-open + continew-admin-generator ${revision}