1.增加主模块,开发数据结构

2.修改实体类模板
3.更新sql文件
pull/1/head
wangziyangyang 2020-03-06 13:10:07 +08:00
parent 340e6ad05d
commit f4b6136268
18 changed files with 448 additions and 28 deletions

View File

@ -12,10 +12,11 @@
### 功能界面 ### 功能界面
![1](https://s2.ax1x.com/2020/03/06/3bQbMd.png) ![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. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
@ -42,7 +43,6 @@ springBoot+mybatis-plus+redis+shiro+hutool+layuimini+jenkins
* Javascript 工具库static/lib/lodash.min.js * Javascript 工具库static/lib/lodash.min.js
* Layui 树形表格插件 * Layui 树形表格插件
* https://gitee.com/whvse/treetable-lay * https://gitee.com/whvse/treetable-lay
* 图标库使用 * 图标库使用
* http://www.fontawesome.com.cn/faicons * http://www.fontawesome.com.cn/faicons
* 发送 ajax 示例:[详情](./docs/ajax.md) * 发送 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.enums
* 请求参数 * 请求参数
* 每张表的分页查询参数严格按照一张表对应一个请求参数对象进行开发如系统用户分页查询参数com.songpeng.sparchetype.system.request.SysUserPageReq * 每张表的分页查询参数严格按照一张表对应一个请求参数对象进行开发如系统用户分页查询参数com.songpeng.sparchetype.system.request.SysUserPageReq
*
# 总结 # 总结
Q群87652870 欢迎想一起开发的小伙伴。。本人前端太弱,都是自己乱摸索。还请有一个前端选手能一起弄 Q群87652870 欢迎想一起开发的小伙伴。。本人前端太弱,都是自己乱摸索。还请有一个前端选手能一起弄

View File

@ -209,6 +209,26 @@ CREATE TABLE `sp_sys_user_role` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) 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 -- Records of sp_sys_user_role
-- ---------------------------- -- ----------------------------

View File

@ -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;
/**
* <p>
*
* </p>
*
* @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);
}
}

View File

@ -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;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
@Controller
@RequestMapping("/basedata/sp-table-manager-item")
public class SpTableManagerItemController extends BaseController {
}

View File

@ -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;
/**
* <p>
*
* </p>
*
* @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<SpTableManagerItem> spTableManagerItems;
/**
*
*
* @return tableName
*/
public String getTableName() {
return this.tableName;
}
/**
*
*
* @param tableName
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
*
*
* @return tableDesc
*/
public String getTableDesc() {
return this.tableDesc;
}
/**
*
*
* @param tableDesc
*/
public void setTableDesc(String tableDesc) {
this.tableDesc = tableDesc;
}
/**
* 1 0 2
*
* @return isDeleted 1 0 2
*/
public String getIsDeleted() {
return this.isDeleted;
}
/**
* 1 0 2
*
* @param isDeleted 1 0 2
*/
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
/**
* (sys:menu:listsys:menu:create)
*
* @return permission (sys:menu:listsys:menu:create)
*/
public String getPermission() {
return this.permission;
}
/**
* (sys:menu:listsys:menu:create)
*
* @param permission (sys:menu:listsys:menu:create)
*/
public void setPermission(String permission) {
this.permission = permission;
}
}

View File

@ -0,0 +1,111 @@
package com.songpeng.sparchetype.basedata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songpeng.sparchetype.common.BaseEntity;
/**
* <p>
*
* </p>
*
* @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;
}
}

View File

@ -0,0 +1,16 @@
package com.songpeng.sparchetype.basedata.mapper;
import com.songpeng.sparchetype.basedata.entity.SpTableManagerItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
public interface SpTableManagerItemMapper extends BaseMapper<SpTableManagerItem> {
}

View File

@ -0,0 +1,16 @@
package com.songpeng.sparchetype.basedata.mapper;
import com.songpeng.sparchetype.basedata.entity.SpTableManager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
public interface SpTableManagerMapper extends BaseMapper<SpTableManager> {
}

View File

@ -0,0 +1,9 @@
package com.songpeng.sparchetype.basedata.request;
import com.songpeng.sparchetype.common.BasePageReq;
/**
*
*/
public class SpTableManagerReq extends BasePageReq {
}

View File

@ -0,0 +1,16 @@
package com.songpeng.sparchetype.basedata.service;
import com.songpeng.sparchetype.basedata.entity.SpTableManagerItem;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
public interface ISpTableManagerItemService extends IService<SpTableManagerItem> {
}

View File

@ -0,0 +1,16 @@
package com.songpeng.sparchetype.basedata.service;
import com.songpeng.sparchetype.basedata.entity.SpTableManager;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
public interface ISpTableManagerService extends IService<SpTableManager> {
}

View File

@ -0,0 +1,20 @@
package com.songpeng.sparchetype.basedata.service.impl;
import com.songpeng.sparchetype.basedata.entity.SpTableManagerItem;
import com.songpeng.sparchetype.basedata.mapper.SpTableManagerItemMapper;
import com.songpeng.sparchetype.basedata.service.ISpTableManagerItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
@Service
public class SpTableManagerItemServiceImpl extends ServiceImpl<SpTableManagerItemMapper, SpTableManagerItem> implements ISpTableManagerItemService {
}

View File

@ -0,0 +1,20 @@
package com.songpeng.sparchetype.basedata.service.impl;
import com.songpeng.sparchetype.basedata.entity.SpTableManager;
import com.songpeng.sparchetype.basedata.mapper.SpTableManagerMapper;
import com.songpeng.sparchetype.basedata.service.ISpTableManagerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author WangZiYang
* @since 2020-03-06
*/
@Service
public class SpTableManagerServiceImpl extends ServiceImpl<SpTableManagerMapper, SpTableManager> implements ISpTableManagerService {
}

View File

@ -33,18 +33,18 @@ public class CodeGenerator {
GlobalConfig gc = new GlobalConfig(); GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir"); String projectPath = System.getProperty("user.dir");
gc.setOutputDir(projectPath + "/src/main/java"); gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("SongPeng"); gc.setAuthor("WangZiYang");
gc.setOpen(false); gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解 // gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc); mpg.setGlobalConfig(gc);
// 数据源配置 // 数据源配置
DataSourceConfig dsc = new DataSourceConfig(); DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://127.0.0.1:3306/sparchetype?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT"); dsc.setUrl("jdbc:mysql://192.168.52.76:3306/sparchetype?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowPublicKeyRetrieval=true");
// dsc.setSchemaName("public"); // dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root"); dsc.setUsername("admin");
dsc.setPassword("root"); dsc.setPassword("123456");
mpg.setDataSource(dsc); mpg.setDataSource(dsc);
// 包配置 // 包配置

View File

@ -10,9 +10,9 @@ spring:
swagger: swagger:
controller: com.songpeng.sparchetype controller: com.songpeng.sparchetype
description: 后台管理系统 description: MES接口管理
enable: true enable: true
license: 宋鹏 license: wangziyang
licenseUrl: https://www.cnblogs.com licenseUrl: https://www.cnblogs.com
title: Api 测试 title: Api 测试
version: 1.0.0 version: 1.0.0

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.songpeng.sparchetype.basedata.mapper.SpTableManagerItemMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.songpeng.sparchetype.basedata.mapper.SpTableManagerMapper">
</mapper>

View File

@ -7,12 +7,6 @@ package ${package.Entity};
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
</#if> </#if>
<#if entityLombokModel>
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
</#if>
/** /**
* <p> * <p>
* ${table.comment!} * ${table.comment!}
@ -21,15 +15,6 @@ package ${package.Entity};
* @author ${author} * @author ${author}
* @since ${date} * @since ${date}
*/ */
<#if entityLombokModel>
@Data
<#if superEntityClass??>
@EqualsAndHashCode(callSuper = true)
<#else>
@EqualsAndHashCode(callSuper = false)
</#if>
@Accessors(chain = true)
</#if>
<#if table.convert> <#if table.convert>
@TableName("${table.name}") @TableName("${table.name}")
</#if> </#if>