diff --git a/boot-starter/boot-starter-maven-plugin/mybatis-generator-extend-maven-plugin/src/main/java/com/micro/fast/mybatis/generator/extend/service/MybatisGeneratorExtend.java b/boot-starter/boot-starter-maven-plugin/mybatis-generator-extend-maven-plugin/src/main/java/com/micro/fast/mybatis/generator/extend/service/MybatisGeneratorExtend.java index 90a5413..e267c27 100644 --- a/boot-starter/boot-starter-maven-plugin/mybatis-generator-extend-maven-plugin/src/main/java/com/micro/fast/mybatis/generator/extend/service/MybatisGeneratorExtend.java +++ b/boot-starter/boot-starter-maven-plugin/mybatis-generator-extend-maven-plugin/src/main/java/com/micro/fast/mybatis/generator/extend/service/MybatisGeneratorExtend.java @@ -43,6 +43,7 @@ public class MybatisGeneratorExtend { PropertiesUtil.getProperty("mybatisGenerator.daoPackage")); MybatisGeneratorExtend.mybatisGenerator.setTablesPrefix( PropertiesUtil.getProperty("mybatisGenerator.tablesPrefix")); + MybatisGeneratorExtend.mybatisGenerator.setIsOverWrite("true"); } /** @@ -79,12 +80,12 @@ public class MybatisGeneratorExtend { Map mybatisGeneratorModel = new HashMap<>(); mybatisGeneratorModel.put("db",MybatisGeneratorExtend.db); mybatisGeneratorModel.put("mybatisGenerator",MybatisGeneratorExtend.mybatisGenerator); - boolean mybatisGeneratorFileSuccess = FreemarkerUtil.createFile("mybatisGenerator.ftl", mybatisGeneratorModel, "mybatisGenerator.properties",projectPath,null,mybatisGenerator.getIsOverWrite()); + boolean mybatisGeneratorFileSuccess = FreemarkerUtil.createFile("mybatisGenerator.ftl", mybatisGeneratorModel, "mybatisGenerator.properties",projectPath,null,"true"); File file = new File(JarUtil.getThisJarPathParent() + "/templates" + "/mybatisGenerator.ftl"); if (file.exists()){ file.delete(); } - boolean generatorConfigFileSuccess = FreemarkerUtil.createFile("generatorConfig.ftl", mybatisGeneratorModel, "generatorConfig.xml",projectPath,null,mybatisGenerator.getIsOverWrite()); + boolean generatorConfigFileSuccess = FreemarkerUtil.createFile("generatorConfig.ftl", mybatisGeneratorModel, "generatorConfig.xml",projectPath,null,"true"); File file1 = new File(JarUtil.getThisJarPathParent() + "/templates" + "/generatorConfig.ftl"); if (file1.exists()){ file1.delete(); diff --git a/ms/upms/pom.xml b/ms/upms/pom.xml index adc05c3..6902a71 100644 --- a/ms/upms/pom.xml +++ b/ms/upms/pom.xml @@ -100,7 +100,7 @@ true - false + true diff --git a/ms/upms/src/main/java/com/micro/fast/upms/controller/UpmsSystemController.java b/ms/upms/src/main/java/com/micro/fast/upms/controller/UpmsSystemController.java index 4f4cbea..f85664f 100644 --- a/ms/upms/src/main/java/com/micro/fast/upms/controller/UpmsSystemController.java +++ b/ms/upms/src/main/java/com/micro/fast/upms/controller/UpmsSystemController.java @@ -55,7 +55,7 @@ public class UpmsSystemController { @ApiOperation("修改信息") @PutMapping("/{id}") - public ServerResponse updateSystem(@Valid UpmsSystem upmsSystem, + public ServerResponse updateSystem( UpmsSystem upmsSystem, @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){ upmsSystem.setId(Integer.valueOf(id)); return upmsSystemService.update(upmsSystem); diff --git a/ms/upms/src/main/java/com/micro/fast/upms/dao/UpmsPermissionMapper.java b/ms/upms/src/main/java/com/micro/fast/upms/dao/UpmsPermissionMapper.java index 47da25b..ffcf752 100644 --- a/ms/upms/src/main/java/com/micro/fast/upms/dao/UpmsPermissionMapper.java +++ b/ms/upms/src/main/java/com/micro/fast/upms/dao/UpmsPermissionMapper.java @@ -4,15 +4,22 @@ import com.micro.fast.common.dao.SsmMapper; import com.micro.fast.upms.pojo.UpmsPermission; public interface UpmsPermissionMapper extends SsmMapper { + @Override int deleteByPrimaryKey(Integer id); + @Override int insert(UpmsPermission record); + @Override int insertSelective(UpmsPermission record); + @Override UpmsPermission selectByPrimaryKey(Integer id); + @Override int updateByPrimaryKeySelective(UpmsPermission record); + @Override int updateByPrimaryKey(UpmsPermission record); -} \ No newline at end of file + +} diff --git a/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsPermission.java b/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsPermission.java index 66848c6..a27c058 100644 --- a/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsPermission.java +++ b/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsPermission.java @@ -11,6 +11,8 @@ public class UpmsPermission implements Serializable { private String name; + private String description; + private Byte type; private String permissionValue; @@ -27,11 +29,12 @@ public class UpmsPermission implements Serializable { private static final long serialVersionUID = 1L; - public UpmsPermission(Integer id, Integer systemId, Integer pid, String name, Byte type, String permissionValue, String uri, String icon, Byte status, Long ctime, Long orders) { + public UpmsPermission(Integer id, Integer systemId, Integer pid, String name, String description, Byte type, String permissionValue, String uri, String icon, Byte status, Long ctime, Long orders) { this.id = id; this.systemId = systemId; this.pid = pid; this.name = name; + this.description = description; this.type = type; this.permissionValue = permissionValue; this.uri = uri; @@ -77,6 +80,14 @@ public class UpmsPermission implements Serializable { this.name = name == null ? null : name.trim(); } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + public Byte getType() { return type; } @@ -143,6 +154,7 @@ public class UpmsPermission implements Serializable { sb.append(", systemId=").append(systemId); sb.append(", pid=").append(pid); sb.append(", name=").append(name); + sb.append(", description=").append(description); sb.append(", type=").append(type); sb.append(", permissionValue=").append(permissionValue); sb.append(", uri=").append(uri); diff --git a/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsSystem.java b/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsSystem.java index 54451ec..49edc83 100644 --- a/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsSystem.java +++ b/ms/upms/src/main/java/com/micro/fast/upms/pojo/UpmsSystem.java @@ -3,7 +3,6 @@ package com.micro.fast.upms.pojo; import com.micro.fast.boot.starter.common.response.BaseConst; import org.hibernate.validator.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; public class UpmsSystem implements Serializable { @@ -24,7 +23,7 @@ public class UpmsSystem implements Serializable { private String name; @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请填写系统路由") - private String title; + private String route; @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请填写系统描述") private String description; @@ -33,9 +32,11 @@ public class UpmsSystem implements Serializable { private Long orders; + private String title; + private static final long serialVersionUID = 1L; - public UpmsSystem(Integer id, String icon, String banner, String theme, String basepath, Byte status, String name, String title, String description, Long ctime, Long orders) { + public UpmsSystem(Integer id, String icon, String banner, String theme, String basepath, Byte status, String name, String route, String description, Long ctime, Long orders, String title) { this.id = id; this.icon = icon; this.banner = banner; @@ -43,10 +44,11 @@ public class UpmsSystem implements Serializable { this.basepath = basepath; this.status = status; this.name = name; - this.title = title; + this.route = route; this.description = description; this.ctime = ctime; this.orders = orders; + this.title = title; } public UpmsSystem() { @@ -109,12 +111,12 @@ public class UpmsSystem implements Serializable { this.name = name == null ? null : name.trim(); } - public String getTitle() { - return title; + public String getRoute() { + return route; } - public void setTitle(String title) { - this.title = title == null ? null : title.trim(); + public void setRoute(String route) { + this.route = route == null ? null : route.trim(); } public String getDescription() { @@ -141,6 +143,14 @@ public class UpmsSystem implements Serializable { this.orders = orders; } + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -154,10 +164,11 @@ public class UpmsSystem implements Serializable { sb.append(", basepath=").append(basepath); sb.append(", status=").append(status); sb.append(", name=").append(name); - sb.append(", title=").append(title); + sb.append(", route=").append(route); sb.append(", description=").append(description); sb.append(", ctime=").append(ctime); sb.append(", orders=").append(orders); + sb.append(", title=").append(title); sb.append("]"); return sb.toString(); } diff --git a/ms/upms/src/main/resources/generatorConfig.xml b/ms/upms/src/main/resources/generatorConfig.xml index a4cc3cd..33832b7 100644 --- a/ms/upms/src/main/resources/generatorConfig.xml +++ b/ms/upms/src/main/resources/generatorConfig.xml @@ -66,6 +66,6 @@ -
+
\ No newline at end of file diff --git a/ms/upms/src/main/resources/mappers/UpmsPermissionMapper.xml b/ms/upms/src/main/resources/mappers/UpmsPermissionMapper.xml deleted file mode 100644 index c819485..0000000 --- a/ms/upms/src/main/resources/mappers/UpmsPermissionMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, system_id, pid, name, type, permission_value, uri, icon, status, ctime, orders - - - - delete from upms_permission - where id = #{id,jdbcType=INTEGER} - - - insert into upms_permission (id, system_id, pid, - name, type, permission_value, - uri, icon, status, - ctime, orders) - values (#{id,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{permissionValue,jdbcType=VARCHAR}, - #{uri,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}) - - - insert into upms_permission - - - id, - - - system_id, - - - pid, - - - name, - - - type, - - - permission_value, - - - uri, - - - icon, - - - status, - - - ctime, - - - orders, - - - - - #{id,jdbcType=INTEGER}, - - - #{systemId,jdbcType=INTEGER}, - - - #{pid,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=TINYINT}, - - - #{permissionValue,jdbcType=VARCHAR}, - - - #{uri,jdbcType=VARCHAR}, - - - #{icon,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{ctime,jdbcType=BIGINT}, - - - #{orders,jdbcType=BIGINT}, - - - - - update upms_permission - - - system_id = #{systemId,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=TINYINT}, - - - permission_value = #{permissionValue,jdbcType=VARCHAR}, - - - uri = #{uri,jdbcType=VARCHAR}, - - - icon = #{icon,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - ctime = #{ctime,jdbcType=BIGINT}, - - - orders = #{orders,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=INTEGER} - - - update upms_permission - set system_id = #{systemId,jdbcType=INTEGER}, - pid = #{pid,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=TINYINT}, - permission_value = #{permissionValue,jdbcType=VARCHAR}, - uri = #{uri,jdbcType=VARCHAR}, - icon = #{icon,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - ctime = #{ctime,jdbcType=BIGINT}, - orders = #{orders,jdbcType=BIGINT} - where id = #{id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/ms/upms/src/main/resources/mappers/UpmsSystemMapper.xml b/ms/upms/src/main/resources/mappers/UpmsSystemMapper.xml deleted file mode 100644 index c630ad1..0000000 --- a/ms/upms/src/main/resources/mappers/UpmsSystemMapper.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, icon, banner, theme, basepath, status, name, title, description, ctime, orders - - - - delete from upms_system - where id = #{id,jdbcType=INTEGER} - - - insert into upms_system (id, icon, banner, - theme, basepath, status, - name, title, description, - ctime, orders) - values (#{id,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, #{banner,jdbcType=VARCHAR}, - #{theme,jdbcType=VARCHAR}, #{basepath,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}) - - - insert into upms_system - - - id, - - - icon, - - - banner, - - - theme, - - - basepath, - - - status, - - - name, - - - title, - - - description, - - - ctime, - - - orders, - - - - - #{id,jdbcType=INTEGER}, - - - #{icon,jdbcType=VARCHAR}, - - - #{banner,jdbcType=VARCHAR}, - - - #{theme,jdbcType=VARCHAR}, - - - #{basepath,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{ctime,jdbcType=BIGINT}, - - - #{orders,jdbcType=BIGINT}, - - - - - update upms_system - - - icon = #{icon,jdbcType=VARCHAR}, - - - banner = #{banner,jdbcType=VARCHAR}, - - - theme = #{theme,jdbcType=VARCHAR}, - - - basepath = #{basepath,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - name = #{name,jdbcType=VARCHAR}, - - - title = #{title,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - ctime = #{ctime,jdbcType=BIGINT}, - - - orders = #{orders,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=INTEGER} - - - update upms_system - set icon = #{icon,jdbcType=VARCHAR}, - banner = #{banner,jdbcType=VARCHAR}, - theme = #{theme,jdbcType=VARCHAR}, - basepath = #{basepath,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - name = #{name,jdbcType=VARCHAR}, - title = #{title,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - ctime = #{ctime,jdbcType=BIGINT}, - orders = #{orders,jdbcType=BIGINT} - where id = #{id,jdbcType=INTEGER} - - - - - - - DELETE FROM upms_system - WHERE id IN - - #{item} - - - \ No newline at end of file diff --git a/ms/upms/src/main/resources/mybatisStart.properties b/ms/upms/src/main/resources/mybatisStart.properties index 475df99..f52425b 100644 --- a/ms/upms/src/main/resources/mybatisStart.properties +++ b/ms/upms/src/main/resources/mybatisStart.properties @@ -6,10 +6,10 @@ db.username=root db.password=studyj2e mybatisGenerator.pojoPackage=com.micro.fast.upms.pojo mybatisGenerator.daoPackage=com.micro.fast.upms.dao -mybatisGenerator.tablesPrefix=upms_system +mybatisGenerator.tablesPrefix=upms_permission # \uFFFD\uFFFD\uFFFD\uFFFDservice\uFFFD\uFFFDcontroller\uFFFD\uFFFD mybatisGenerator.servicePackage=com.micro.fast.upms.service mybatisGenerator.controllerPackage=com.micro.fast.upms.controller mybatisGenerator.serviceImplPackage=com.micro.fast.upms.service.impl mybatisGenerator.primaryKeyType=Integer -mybatisGenerator.isOverWrite=false \ No newline at end of file +mybatisGenerator.isOverWrite=true \ No newline at end of file