From f4b61362680be47102eedf60589560c2b05c0a87 Mon Sep 17 00:00:00 2001 From: wangziyangyang <707231019@qq.com> Date: Fri, 6 Mar 2020 13:10:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E4=B8=BB=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E5=BC=80=E5=8F=91=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= =?UTF-8?q?=202.=E4=BF=AE=E6=94=B9=E5=AE=9E=E4=BD=93=E7=B1=BB=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=203.=E6=9B=B4=E6=96=B0sql=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +- scripts/sql/MySQL-sparchetype_20200228.sql | 20 +++ .../controller/SpTableManagerController.java | 48 ++++++++ .../SpTableManagerItemController.java | 21 ++++ .../basedata/entity/SpTableManager.java | 115 ++++++++++++++++++ .../basedata/entity/SpTableManagerItem.java | 111 +++++++++++++++++ .../mapper/SpTableManagerItemMapper.java | 16 +++ .../basedata/mapper/SpTableManagerMapper.java | 16 +++ .../basedata/request/SpTableManagerReq.java | 9 ++ .../service/ISpTableManagerItemService.java | 16 +++ .../service/ISpTableManagerService.java | 16 +++ .../impl/SpTableManagerItemServiceImpl.java | 20 +++ .../impl/SpTableManagerServiceImpl.java | 20 +++ .../common/util/CodeGenerator.java | 8 +- .../src/main/resources/application.yml | 4 +- .../basedata/SpTableManagerItemMapper.xml | 5 + .../mapper/basedata/SpTableManagerMapper.xml | 5 + .../templates/codegenerator/entity.java.ftl | 15 --- 18 files changed, 448 insertions(+), 28 deletions(-) create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerController.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerItemController.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/entity/SpTableManager.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/entity/SpTableManagerItem.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/mapper/SpTableManagerItemMapper.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/mapper/SpTableManagerMapper.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/request/SpTableManagerReq.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/service/ISpTableManagerItemService.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/service/ISpTableManagerService.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/service/impl/SpTableManagerItemServiceImpl.java create mode 100644 sparchetype/src/main/java/com/songpeng/sparchetype/basedata/service/impl/SpTableManagerServiceImpl.java create mode 100644 sparchetype/src/main/resources/mapper/basedata/SpTableManagerItemMapper.xml create mode 100644 sparchetype/src/main/resources/mapper/basedata/SpTableManagerMapper.xml diff --git a/README.md b/README.md index 380bcb3..c069fd9 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,11 @@ ### 功能界面 ![1](https://s2.ax1x.com/2020/03/06/3bQbMd.png) -### 技术架构 -springBoot+mybatis-plus+redis+shiro+hutool+layuimini+jenkins +### swaggerAPI管理界面 +## 技术架构 +### springBoot+mybatis-plus+redis+shiro+hutool+layui+jenkins+swagger+freemarker 实现功能: 1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 @@ -42,7 +43,6 @@ springBoot+mybatis-plus+redis+shiro+hutool+layuimini+jenkins * Javascript 工具库:static/lib/lodash.min.js * Layui 树形表格插件 * https://gitee.com/whvse/treetable-lay - * 图标库使用 * http://www.fontawesome.com.cn/faicons * 发送 ajax 示例:[详情](./docs/ajax.md) @@ -53,10 +53,7 @@ springBoot+mybatis-plus+redis+shiro+hutool+layuimini+jenkins * 不同模块下的枚举:如 com.songpeng.sparchetype.system.enums * 请求参数 * 每张表的分页查询参数,严格按照一张表对应一个请求参数对象进行开发,如系统用户分页查询参数:com.songpeng.sparchetype.system.request.SysUserPageReq - * - - - + # 总结 Q群87652870 欢迎想一起开发的小伙伴。。本人前端太弱,都是自己乱摸索。还请有一个前端选手能一起弄 diff --git a/scripts/sql/MySQL-sparchetype_20200228.sql b/scripts/sql/MySQL-sparchetype_20200228.sql index 62a1e41..00e478c 100644 --- a/scripts/sql/MySQL-sparchetype_20200228.sql +++ b/scripts/sql/MySQL-sparchetype_20200228.sql @@ -209,6 +209,26 @@ CREATE TABLE `sp_sys_user_role` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +-- ---------------------------- +-- Table structure for sp_table_manager +-- ---------------------------- +DROP TABLE IF EXISTS `sp_table_manager`; +CREATE TABLE `sp_table_manager` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键', + `table_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '表名称', + `table_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表描述', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `create_username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人', + `update_time` datetime(0) NOT NULL COMMENT '最后更新时间', + `update_username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '最后更新人', + `is_deleted` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '逻辑删除:1 表示删除,0 表示未删除,2 表示禁用', + `permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '\"\"' COMMENT '授权(多个用逗号分隔,如:sys:menu:list,sys:menu:create)', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `index1`(`table_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + -- ---------------------------- -- Records of sp_sys_user_role -- ---------------------------- diff --git a/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerController.java b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerController.java new file mode 100644 index 0000000..e3a0971 --- /dev/null +++ b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerController.java @@ -0,0 +1,48 @@ +package com.songpeng.sparchetype.basedata.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.songpeng.sparchetype.basedata.request.SpTableManagerReq; +import com.songpeng.sparchetype.basedata.service.ISpTableManagerService; +import com.songpeng.sparchetype.blog.controller.admin.BlogController; +import com.songpeng.sparchetype.common.Result; +import com.songpeng.sparchetype.system.request.SysMenuPageReq; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; +import com.songpeng.sparchetype.common.BaseController; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + *
+ * 前端控制器 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@Controller +@RequestMapping("/basedata/") +public class SpTableManagerController extends BaseController { + @Autowired + private ISpTableManagerService iSpTableManagerService; + Logger log = LoggerFactory.getLogger(SpTableManagerController.class); + + /** + * + * @param req + * @return + */ + @PostMapping("/page") + @ResponseBody + public Result page(SpTableManagerReq req) { + IPage result = iSpTableManagerService.page(req); + return Result.success(result); + } + + +} diff --git a/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerItemController.java b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerItemController.java new file mode 100644 index 0000000..f1440f4 --- /dev/null +++ b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/controller/SpTableManagerItemController.java @@ -0,0 +1,21 @@ +package com.songpeng.sparchetype.basedata.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; +import com.songpeng.sparchetype.common.BaseController; + +/** + *+ * 前端控制器 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@Controller +@RequestMapping("/basedata/sp-table-manager-item") +public class SpTableManagerItemController extends BaseController { + +} diff --git a/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/entity/SpTableManager.java b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/entity/SpTableManager.java new file mode 100644 index 0000000..0be87d9 --- /dev/null +++ b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/entity/SpTableManager.java @@ -0,0 +1,115 @@ +package com.songpeng.sparchetype.basedata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.songpeng.sparchetype.common.BaseEntity; + +import java.util.List; + +/** + *+ * + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@TableName("sp_table_manager") +public class SpTableManager extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 表名称 + */ + private String tableName; + + /** + * 表描述 + */ + private String tableDesc; + + /** + * 逻辑删除:1 表示删除,0 表示未删除,2 表示禁用 + */ + private String isDeleted; + + /** + * 授权(多个用逗号分隔,如:sys:menu:list,sys:menu:create) + */ + private String permission; + /** + * 表显示的字段 + */ + private List+ * + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@TableName("sp_table_manager_item") +public class SpTableManagerItem extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 表名称id + */ + private String tableNameId; + + /** + * 字段 + */ + private String field; + + /** + * 字段描述 + */ + private String fieldDesc; + + /** + * 排序 + */ + private Integer sortNum; + + + /** + * 获取 表名称id + * + * @return tableNameId 表名称id + */ + public String getTableNameId() { + return this.tableNameId; + } + + /** + * 设置 表名称id + * + * @param tableNameId 表名称id + */ + public void setTableNameId(String tableNameId) { + this.tableNameId = tableNameId; + } + + /** + * 获取 字段 + * + * @return field 字段 + */ + public String getField() { + return this.field; + } + + /** + * 设置 字段 + * + * @param field 字段 + */ + public void setField(String field) { + this.field = field; + } + + /** + * 获取 字段描述 + * + * @return fieldDesc 字段描述 + */ + public String getFieldDesc() { + return this.fieldDesc; + } + + /** + * 设置 字段描述 + * + * @param fieldDesc 字段描述 + */ + public void setFieldDesc(String fieldDesc) { + this.fieldDesc = fieldDesc; + } + + /** + * 获取 排序 + * + * @return sortNum 排序 + */ + public Integer getSortNum() { + return this.sortNum; + } + + /** + * 设置 排序 + * + * @param sortNum 排序 + */ + public void setSortNum(Integer sortNum) { + this.sortNum = sortNum; + } +} diff --git a/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/mapper/SpTableManagerItemMapper.java b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/mapper/SpTableManagerItemMapper.java new file mode 100644 index 0000000..be08352 --- /dev/null +++ b/sparchetype/src/main/java/com/songpeng/sparchetype/basedata/mapper/SpTableManagerItemMapper.java @@ -0,0 +1,16 @@ +package com.songpeng.sparchetype.basedata.mapper; + +import com.songpeng.sparchetype.basedata.entity.SpTableManagerItem; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *+ * Mapper 接口 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +public interface SpTableManagerItemMapper extends BaseMapper+ * Mapper 接口 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +public interface SpTableManagerMapper extends BaseMapper+ * 服务类 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +public interface ISpTableManagerItemService extends IService+ * 服务类 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +public interface ISpTableManagerService extends IService+ * 服务实现类 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@Service +public class SpTableManagerItemServiceImpl extends ServiceImpl+ * 服务实现类 + *
+ * + * @author WangZiYang + * @since 2020-03-06 + */ +@Service +public class SpTableManagerServiceImpl extends ServiceImpl* ${table.comment!} @@ -21,15 +15,6 @@ package ${package.Entity}; * @author ${author} * @since ${date} */ -<#if entityLombokModel> - @Data - <#if superEntityClass??> - @EqualsAndHashCode(callSuper = true) - <#else> - @EqualsAndHashCode(callSuper = false) - #if> - @Accessors(chain = true) -#if> <#if table.convert> @TableName("${table.name}") #if>