From 00967186e3b6d07e61229e1229186f22bca3cd57 Mon Sep 17 00:00:00 2001 From: lishouyu <18332763730@163.com> Date: Sat, 19 Aug 2017 09:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9Esql=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- {bash => all/bash}/docker_shipyarn_run.sh | 0 {bash => all/bash}/docker_shipyarn_stop.sh | 0 all/sql/cms.sql | 20 ++ all/sql/upms.sql | 266 ++++++++++++++++++ common/pom.xml | 171 ++++++++--- .../micro/fast/common/CommonApplication.java | 1 - .../com/micro/fast/common/util/AESUtil.java | 147 ---------- .../com/micro/fast/common/util/JdbcUtil.java | 89 ------ .../common/util/MybatisGeneratorUtil.java | 173 ------------ .../micro/fast/common/util/StringUtil.java | 157 ----------- .../micro/fast/common/util/VelocityUtil.java | 68 ----- common/src/main/resources/generatorConfig.xml | 85 ++++++ .../main/resources/templates/Controller.vm | 25 -- .../src/main/resources/templates/Service.vm | 13 - .../main/resources/templates/ServiceImpl.vm | 29 -- .../main/resources/templates/ServiceMock.vm | 14 - .../resources/templates/generatorConfig.vm | 74 ----- .../src/main/resources/application.yml | 4 +- docker-compose.yml | 2 +- .../src/main/resources/application.yml | 27 -- .../src/main/resources/bootstrap.yml | 2 +- .../src/main/resources/application.yml | 27 -- .../src/main/resources/bootstrap.yml | 2 +- pom.xml | 57 ++-- upms/src/main/resources/application.yml | 30 -- upms/src/main/resources/bootstrap.yml | 2 +- 27 files changed, 546 insertions(+), 947 deletions(-) rename {bash => all/bash}/docker_shipyarn_run.sh (100%) rename {bash => all/bash}/docker_shipyarn_stop.sh (100%) create mode 100644 all/sql/cms.sql create mode 100644 all/sql/upms.sql delete mode 100644 common/src/main/java/com/micro/fast/common/util/AESUtil.java delete mode 100644 common/src/main/java/com/micro/fast/common/util/JdbcUtil.java delete mode 100644 common/src/main/java/com/micro/fast/common/util/MybatisGeneratorUtil.java delete mode 100644 common/src/main/java/com/micro/fast/common/util/StringUtil.java delete mode 100644 common/src/main/java/com/micro/fast/common/util/VelocityUtil.java create mode 100644 common/src/main/resources/generatorConfig.xml delete mode 100644 common/src/main/resources/templates/Controller.vm delete mode 100644 common/src/main/resources/templates/Service.vm delete mode 100644 common/src/main/resources/templates/ServiceImpl.vm delete mode 100644 common/src/main/resources/templates/ServiceMock.vm delete mode 100644 common/src/main/resources/templates/generatorConfig.vm delete mode 100644 eureka-server/src/main/resources/application.yml delete mode 100644 eureka-server2/src/main/resources/application.yml delete mode 100644 upms/src/main/resources/application.yml diff --git a/README.md b/README.md index 20ddb97..9f1e8c7 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ 中心外所有服务的注册空间的配置空间都指定正 确,本项目中本地运行时则是都指定到本机的 ip地址** -###配置中心 端口号 10001 +###配置中心 端口号 9999 监控 19999 www.config.server.com -###注册中心 端口号 10002 +###注册中心 端口号 10002 监控 20002 www.eureka.server.com -###注册中心2 端口号 10003 +###注册中心2 端口号 10003 监控 20003 www.eureka.server2.com -###用户权限管理中心 端口号 10004 +###用户权限管理中心 端口号 10004 监控 20004 www.upms.com diff --git a/bash/docker_shipyarn_run.sh b/all/bash/docker_shipyarn_run.sh similarity index 100% rename from bash/docker_shipyarn_run.sh rename to all/bash/docker_shipyarn_run.sh diff --git a/bash/docker_shipyarn_stop.sh b/all/bash/docker_shipyarn_stop.sh similarity index 100% rename from bash/docker_shipyarn_stop.sh rename to all/bash/docker_shipyarn_stop.sh diff --git a/all/sql/cms.sql b/all/sql/cms.sql new file mode 100644 index 0000000..3d7a0a2 --- /dev/null +++ b/all/sql/cms.sql @@ -0,0 +1,20 @@ +/* + Source Server : 127.0.0.1 + Source Host : localhost:3306 + Source Database : micro + + Target Server Type : MYSQL + Target Server Version : 5.7 + File Encoding : utf-8 +*/ +# 外键检查,不能有外键 +SET FOREIGN_KEY_CHECKS = 0; + +-- ------------------- +-- 创建micro数据库 +-- ------------------- +CREATE DATABASE IF NOT EXISTS micro + CHARACTER SET utf8; +USE micro; + +-- cms内容管理系统 diff --git a/all/sql/upms.sql b/all/sql/upms.sql new file mode 100644 index 0000000..48e3875 --- /dev/null +++ b/all/sql/upms.sql @@ -0,0 +1,266 @@ +/* + Source Server : 127.0.0.1 + Source Host : localhost:3306 + Source Database : micro + + Target Server Type : MYSQL + Target Server Version : 5.7 + File Encoding : utf-8 +*/ +# 外键检查,不能有外键 +SET FOREIGN_KEY_CHECKS = 0; + +-- ------------------- +-- 创建micro数据库 +-- ------------------- +CREATE DATABASE IF NOT EXISTS micro + CHARACTER SET utf8; +USE micro; +-- upms用户权限管理系统 + +-- ------------------------- +-- upms_log upms操作日志 +-- ------------------------- +DROP TABLE IF EXISTS upms_log; +CREATE TABLE `upms_log` ( + `id` INT AUTO_INCREMENT NOT NULL + COMMENT '日志编号', + `descirption` VARCHAR(100) DEFAULT NULL + COMMENT '操作描述', + `username` VARCHAR(20) DEFAULT NULL + COMMENT '操作用户', + `start_time` BIGINT(20) DEFAULT NULL + COMMENT '操作时间', + `spend_time` INT DEFAULT NULL + COMMENT '消耗时间', + `base_path` VARCHAR(100) DEFAULT NULL + COMMENT '根路径', + `uri` VARCHAR(200) DEFAULT NULL + COMMENT 'URI', + `url` VARCHAR(200) DEFAULT NULL + COMMENT 'URL', + `method` VARCHAR(10) DEFAULT NULL + COMMENT '请求的类型', + `parameter` MEDIUMTEXT DEFAULT NULL + COMMENT '请求参数', + `user_agent` VARCHAR(200) DEFAULT NULL + COMMENT '用户标识', + `ip` VARCHAR(30) DEFAULT NULL + COMMENT 'ip地址', + `result` MEDIUMTEXT DEFAULT NULL + COMMENT '响应结果', + `permissions` VARCHAR(100) DEFAULT NULL + COMMENT '权限值', + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- ------------------ +-- upms_user upms用户表 +-- ------------------ +DROP TABLE IF EXISTS upms_user; +CREATE TABLE upms_user ( + `id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '用户的编号', + `username` VARCHAR(20) NOT NULL + COMMENT '用户名', + `password` VARCHAR(32) NOT NULL + COMMENT '密码加密后的md5值(密码+盐值)', + `salt` VARCHAR(32) DEFAULT NULL + COMMENT '盐值', + `realname` VARCHAR(20) DEFAULT NULL + COMMENT '真实姓名', + `avatar` VARCHAR(150) DEFAULT NULL + COMMENT '头像', + `phone` VARCHAR(20) DEFAULT NULL + COMMENT '电话', + `email` VARCHAR(50) DEFAULT NULL + COMMENT '电子邮箱', + `sex` TINYINT(4) DEFAULT NULL + COMMENT '性别', + `locked` TINYINT(4) DEFAULT NULL + COMMENT '账号状态', + `ctime` BIGINT(20) DEFAULT NULL + COMMENT '创建时间', + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- -------------------------- +-- upms_organization upms组织表 +-- --------------------------- +DROP TABLE IF EXISTS upms_organization; +CREATE TABLE upms_organization ( + `id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '组织的编号', + `pid` INT(10) DEFAULT NULL + COMMENT '所属上级', + `name` VARCHAR(20) DEFAULT NULL + COMMENT '组织名称', + `description` VARCHAR(1000) DEFAULT NULL + COMMENT '组织描述', + `ctime` BIGINT(20) DEFAULT NULL + COMMENT '创建时间', + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- --------------------- +-- upms_role upms角色表 +-- --------------------- +DROP TABLE IF EXISTS upms_role; +CREATE TABLE upms_role ( + `id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '角色编号', + `name` VARCHAR(20) DEFAULT NULL + COMMENT '角色名称', + `description` VARCHAR(1000) DEFAULT NULL + COMMENT '角色描述', + `ctime` BIGINT(20) DEFAULT NULL + COMMENT '创建时间', + `orders` BIGINT(20) DEFAULT NULL + COMMENT '排序', + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- --------------------------- +-- upms_permission upms权限 +-- --------------------------- +DROP TABLE IF EXISTS upms_permission; +CREATE TABLE upms_permission ( + `id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '权限编号', + `system_id` INT(10) DEFAULT NULL + COMMENT '所属系统', + `pid` INT(10) DEFAULT NULL + COMMENT '所属上级', + `name` VARCHAR(20) DEFAULT NULL + COMMENT '名称', + `type` TINYINT(4) DEFAULT NULL + COMMENT '类型 1.目录2.菜单3.按钮', + `permission_value` VARCHAR(50) DEFAULT NULL + COMMENT '权限值', + `uri` VARCHAR(100) DEFAULT NULL + COMMENT '路径', + `icon` VARCHAR(50) DEFAULT NULL + COMMENT '图标', + `status` TINYINT(4) DEFAULT NULL + COMMENT '状态 0 禁止 1 正常', + `ctime` BIGINT(20) DEFAULT NULL + COMMENT '创建时间', + `orders` BIGINT(20) DEFAULT NULL + COMMENT '排序', + PRIMARY KEY (`id`), + KEY `system_id_index` (`system_id`) USING BTREE COMMENT 'B+树索引' +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- ------------------------- +-- upms_system upms系统表 +-- ------------------------- +DROP TABLE IF EXISTS upms_system; +CREATE TABLE upms_system ( + `id` INT(10) NOT NULL AUTO_INCREMENT + COMMENT '系统编号', + `icon` VARCHAR(50) DEFAULT NULL + COMMENT '图标', + `banner` VARCHAR(150) DEFAULT NULL + COMMENT '背景', + `theme` VARCHAR(50) DEFAULT NULL + COMMENT '主题', + `basepath` VARCHAR(100) DEFAULT NULL + COMMENT '根目录', + `status` TINYINT(4) DEFAULT NULL + COMMENT '状态 -1 黑名单 1 正常', + `name` VARCHAR(20) DEFAULT NULL + COMMENT '系统名称', + `title` VARCHAR(20) DEFAULT NULL + COMMENT '系统标题', + `description` VARCHAR(300) DEFAULT NULL + COMMENT '系统描述', + `ctime` BIGINT(20) DEFAULT NULL + COMMENT '创建时间', + `orders` BIGINT(20) DEFAULT NULL + COMMENT '排序', + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- -------------------------- +-- upms_user_organization 用户_组织关联表 +-- -------------------------- +DROP TABLE IF EXISTS upms_user_organization; +CREATE TABLE upms_user_organization ( + `user_organization_id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '编号', + `user_id` INT(10) NOT NULL + COMMENT '用户编号', + `organization_id` INT(10) NOT NULL + COMMENT '组织编号', + PRIMARY KEY (`user_organization_id`), + KEY `user_id_index` (`user_id`) USING BTREE COMMENT 'B+树索引', + KEY `organization_id_index` (`organization_id`) USING BTREE COMMENT 'B+树索引' +) + ENGINE = InnoDB + DEFAULT CHARACTER SET = utf8; + +-- ---------------------------- +-- upms_user_role 用户_角色关联表 +-- ---------------------------- +DROP TABLE IF EXISTS upms_user_role; +CREATE TABLE upms_user_role ( + `user_role_id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '编号', + `user_id` INT(10) NOT NULL + COMMENT '用户编号', + `role_id` INT(10) NOT NULL + COMMENT '角色编号', + PRIMARY KEY (`user_role_id`), + KEY `user_id_index` (`user_id`) USING BTREE COMMENT 'B+树索引', + KEY `role_id_index` (`role_id`) USING BTREE COMMENT 'B+树索引' +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + +-- ---------------------------------- +-- upms_user_permission 用户_权限关联表 +-- ---------------------------------- +DROP TABLE IF EXISTS upms_user_permission; +DROP TABLE IF EXISTS upms_user_permissioon; +CREATE TABLE upms_user_permission ( + `user_permission_id` INT(10) AUTO_INCREMENT NOT NULL + COMMENT '编号', + `user_id` INT(10) NOT NULL + COMMENT '用户编号', + `permission_id` INT(10) NOT NULL + COMMENT '权限编号', + `type` TINYINT(4) NOT NULL + COMMENT '权限类型 -1 减权限', + PRIMARY KEY (`user_permission_id`), + KEY `user_id_index` (`user_id`) USING BTREE COMMENT 'B+树索引', + KEY `permission_id_index` (`permission_id`) USING BTREE COMMENT 'B+树索引' +) + ENGINE = InnoDB + DEFAULT CHARSET utf8; + +-- ---------------------------------- +-- upms_role_permission 角色_权限关联表 +-- ---------------------------------- +DROP TABLE IF EXISTS upms_role_permission; +CREATE TABLE upms_role_permission ( + `role_permission_id` INT(10) AUTO_INCREMENT NOT NULL COMMENT '编号', + `role_id` INT(10) NOT NULL COMMENT '角色编号', + `permission_id` INT(10) NOT NULL COMMENT '权限编号', + PRIMARY KEY (`role_permission_id`), + KEY `role_id_index` (`role_id`) USING BTREE COMMENT 'B+树索引', + KEY `permission_id_index` (`permission_id`) USING BTREE COMMENT 'B+书索引' +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; diff --git a/common/pom.xml b/common/pom.xml index a607881..a639e06 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent 1.5.4.RELEASE - + @@ -26,38 +26,47 @@ 1.8 1.8 1.8 + 3.4.1 + 1.3.0 - - org.springframework.boot - spring-boot-starter-actuator - + + org.springframework.cloud spring-cloud-starter-bus-amqp + org.springframework.cloud spring-cloud-starter-config + org.springframework.cloud spring-cloud-starter-eureka + org.springframework.cloud spring-cloud-starter-feign org.springframework.cloud - spring-cloud-starter-hystrix + spring-cloud-starter-ribbon + + + + org.springframework.boot + spring-boot-starter-actuator org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-hystrix - + + org.springframework.cloud spring-cloud-starter-sleuth @@ -65,50 +74,106 @@ org.springframework.cloud spring-cloud-starter-zipkin - - org.springframework.boot - spring-boot-starter-data-redis - + + io.zipkin.java + zipkin-autoconfigure-ui + runtime + + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.session + spring-session-data-redis + + org.springframework.boot spring-boot-starter-freemarker + org.springframework.boot spring-boot-starter-web - + + + org.springframework.boot + spring-boot-starter-aop + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.0 + + + + com.github.pagehelper + pagehelper + 4.1.0 + + + com.github.miemiedev + mybatis-paginator + 1.2.17 + + + com.github.jsqlparser + jsqlparser + 0.9.4 + + mysql mysql-connector-java runtime - - io.zipkin.java - zipkin-autoconfigure-ui - runtime - - - org.springframework.boot - spring-boot-starter-test - test - + + + com.alibaba + druid + 1.0.26 + + + + org.hibernate + hibernate-validator + + + org.apache.tomcat.embed + tomcat-embed-el + + + + commons-io + commons-io + 2.4 + + + + io.springfox + springfox-swagger2 + 2.6.1 + + + io.springfox + springfox-swagger-ui + 2.6.1 + org.mybatis.generator mybatis-generator-core 1.3.5 + - org.apache.velocity - velocity - 1.7 - - - - commons-io - commons-io - 2.4 + org.springframework.boot + spring-boot-starter-test + test @@ -123,15 +188,51 @@ - org.springframework.boot spring-boot-maven-plugin + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.2 + + true + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + compile + compile + + compile + + + + testCompile + test-compile + + testCompile + + + + + 1.8 + 1.8 + UTF-8 + + ${project.basedir}/src/main/resources/lib + + + - - diff --git a/common/src/main/java/com/micro/fast/common/CommonApplication.java b/common/src/main/java/com/micro/fast/common/CommonApplication.java index 18aee0a..cbdd424 100644 --- a/common/src/main/java/com/micro/fast/common/CommonApplication.java +++ b/common/src/main/java/com/micro/fast/common/CommonApplication.java @@ -1,7 +1,6 @@ package com.micro.fast.common; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.netflix.feign.EnableFeignClients; diff --git a/common/src/main/java/com/micro/fast/common/util/AESUtil.java b/common/src/main/java/com/micro/fast/common/util/AESUtil.java deleted file mode 100644 index a504b19..0000000 --- a/common/src/main/java/com/micro/fast/common/util/AESUtil.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.micro.fast.common.util; - - - -import javax.crypto.*; -import javax.crypto.spec.SecretKeySpec; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -import sun.misc.BASE64Decoder; -import sun.misc.BASE64Encoder; -/** - * AES加解密工具类 - * Created by shuzheng on 2017/2/5. - */ -public class AESUtil { - /** - * 注释 . - */ - private static final String encodeRules = "zheng"; - - /** - * 加密 - * 1.构造密钥生成器 - * 2.根据ecnodeRules规则初始化密钥生成器 - * 3.产生密钥 - * 4.创建和初始化密码器 - * 5.内容加密 - * 6.返回字符串. - */ - private static String AESEncode(String content) { - try { - //1.构造密钥生成器,指定为AES算法,不区分大小写 - KeyGenerator keygen = KeyGenerator.getInstance("AES"); - //2.根据ecnodeRules规则初始化密钥生成器 - //生成一个128位的随机源,根据传入的字节数组 - SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); - random.setSeed(encodeRules.getBytes()); - keygen.init(128, random); - //3.产生原始对称密钥 - SecretKey original_key = keygen.generateKey(); - //4.获得原始对称密钥的字节数组 - byte[] raw = original_key.getEncoded(); - //5.根据字节数组生成AES密钥 - SecretKey key = new SecretKeySpec(raw, "AES"); - //6.根据指定算法AES自成密码器 - Cipher cipher = Cipher.getInstance("AES"); - //7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密解密(Decrypt_mode)操作,第二个参数为使用的KEY - cipher.init(Cipher.ENCRYPT_MODE, key); - //8.获取加密内容的字节数组(这里要设置为utf-8)不然内容中如果有中文和英文混合中文就会解密为乱码 - byte[] byte_encode = content.getBytes("utf-8"); - //9.根据密码器的初始化方式--加密:将数据加密 - byte[] byte_AES = cipher.doFinal(byte_encode); - //10.将加密后的数据转换为字符串 - //这里用Base64Encoder中会找不到包 - //解决办法: - //在项目的Build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。 - String AES_encode = new String(new BASE64Encoder().encode(byte_AES)); - //11.将字符串返回 - return AES_encode; - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - e.printStackTrace(); - } catch (BadPaddingException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - //如果有错就返加nulll - return null; - } - - /** - * 解密 - * 解密过程: - * 1.同加密1-4步 - * 2.将加密后的字符串反纺成byte[]数组 - * 3.将加密内容解密 - */ - public static String AESDecode(String content) { - try { - //1.构造密钥生成器,指定为AES算法,不区分大小写 - KeyGenerator keygen = KeyGenerator.getInstance("AES"); - //2.根据ecnodeRules规则初始化密钥生成器 - //生成一个128位的随机源,根据传入的字节数组 - SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); - random.setSeed(encodeRules.getBytes()); - keygen.init(128, random); - //3.产生原始对称密钥 - SecretKey original_key = keygen.generateKey(); - //4.获得原始对称密钥的字节数组 - byte[] raw = original_key.getEncoded(); - //5.根据字节数组生成AES密钥 - SecretKey key = new SecretKeySpec(raw, "AES"); - //6.根据指定算法AES自成密码器 - Cipher cipher = Cipher.getInstance("AES"); - //7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密(Decrypt_mode)操作,第二个参数为使用的KEY - cipher.init(Cipher.DECRYPT_MODE, key); - //8.将加密并编码后的内容解码成字节数组 - byte[] byte_content = new BASE64Decoder().decodeBuffer(content); - /* - * 解密 - */ - byte[] byte_decode = cipher.doFinal(byte_content); - String AES_decode = new String(byte_decode, "utf-8"); - return AES_decode; - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - throw new RuntimeException("兄弟,配置文件中的密码需要使用AES加密,请使用com.zheng.common.util.AESUtil工具类修改这些值!"); - //e.printStackTrace(); - } catch (BadPaddingException e) { - e.printStackTrace(); - } - //如果有错就返加nulll - return null; - } - - public static void main(String[] args) { - String[] keys = { - "", "123456" - }; - System.out.println("key | AESEncode | AESDecode"); - for (String key : keys) { - System.out.print(key + " | "); - String encryptString = AESEncode(key); - System.out.print(encryptString + " | "); - String decryptString = AESDecode(encryptString); - System.out.println(decryptString); - } - } - -} diff --git a/common/src/main/java/com/micro/fast/common/util/JdbcUtil.java b/common/src/main/java/com/micro/fast/common/util/JdbcUtil.java deleted file mode 100644 index 8cebb93..0000000 --- a/common/src/main/java/com/micro/fast/common/util/JdbcUtil.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.micro.fast.common.util; - -import java.sql.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * JDBC工具类 - * Created by ZhangShuzheng on 2017/1/10. - */ -public class JdbcUtil { - - // 定义数据库的链接 - private Connection conn; - // 定义sql语句的执行对象 - private PreparedStatement pstmt; - // 定义查询返回的结果集合 - private ResultSet rs; - - // 初始化 - public JdbcUtil(String driver, String url, String username, String password) { - try { - Class.forName(driver); - conn = DriverManager.getConnection(url, username, password); - System.out.println("数据库连接成功"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - // 更新数据 - public boolean updateByParams(String sql, List params) throws SQLException { - // 影响行数 - int result = -1; - pstmt = conn.prepareStatement(sql); - int index = 1; - // 填充sql语句中的占位符 - if (null != params && !params.isEmpty()) { - for (int i = 0; i < params.size(); i ++) { - pstmt.setObject(index ++, params.get(i)); - } - } - result = pstmt.executeUpdate(); - return result > 0 ? true : false; - } - - // 查询多条记录 - public List selectByParams(String sql, List params) throws SQLException { - List list = new ArrayList<> (); - int index = 1; - pstmt = conn.prepareStatement(sql); - if (null != params && !params.isEmpty()) { - for (int i = 0; i < params.size(); i ++) { - pstmt.setObject(index++, params.get(i)); - } - } - rs = pstmt.executeQuery(); - ResultSetMetaData metaData = rs.getMetaData(); - int cols_len = metaData.getColumnCount(); - while (rs.next()) { - Map map = new HashMap(); - for (int i = 0; i < cols_len; i ++) { - String cols_name = metaData.getColumnName(i + 1); - Object cols_value = rs.getObject(cols_name); - if (null == cols_value) { - cols_value = ""; - } - map.put(cols_name, cols_value); - } - list.add(map); - } - return list; - } - - // 释放连接 - public void release() { - try { - if (null != rs) rs.close(); - if (null != pstmt) pstmt.close(); - if (null != conn) conn.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - System.out.println("释放数据库连接"); - } - -} diff --git a/common/src/main/java/com/micro/fast/common/util/MybatisGeneratorUtil.java b/common/src/main/java/com/micro/fast/common/util/MybatisGeneratorUtil.java deleted file mode 100644 index 976f723..0000000 --- a/common/src/main/java/com/micro/fast/common/util/MybatisGeneratorUtil.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.micro.fast.common.util; - -import org.apache.commons.lang.ObjectUtils; -import org.apache.velocity.VelocityContext; -import org.mybatis.generator.api.MyBatisGenerator; -import org.mybatis.generator.config.Configuration; -import org.mybatis.generator.config.xml.ConfigurationParser; -import org.mybatis.generator.internal.DefaultShellCallback; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.*; - -import static com.micro.fast.common.util.StringUtil.lineToHump; - - -/** - * 代码生成类 - * Created by ZhangShuzheng on 2017/1/10. - */ -public class MybatisGeneratorUtil { - - // generatorConfig模板路径 - private static String generatorConfig_vm = "/templates/generatorConfig.vm"; - // Service模板路径 - private static String service_vm = "/templates/Service.vm"; - // ServiceMock模板路径 - private static String serviceMock_vm = "/templates/ServiceMock.vm"; - // ServiceImpl模板路径 - private static String serviceImpl_vm = "/templates/ServiceImpl.vm"; - - /** - * 根据模板生成generatorConfig.xml文件 - * @param jdbc_driver 驱动路径 - * @param jdbc_url 链接 - * @param jdbc_username 帐号 - * @param jdbc_password 密码 - * @param module 项目模块 - * @param database 数据库 - * @param table_prefix 表前缀 - * @param package_name 包名 - */ - public static void generator( - String jdbc_driver, - String jdbc_url, - String jdbc_username, - String jdbc_password, - String module, - String database, - String table_prefix, - String package_name, - Map last_insert_id_tables) throws Exception{ - - generatorConfig_vm = MybatisGeneratorUtil.class.getResource(generatorConfig_vm).getPath().replaceFirst("/", ""); - service_vm = MybatisGeneratorUtil.class.getResource(service_vm).getPath().replaceFirst("/", ""); - serviceMock_vm = MybatisGeneratorUtil.class.getResource(serviceMock_vm).getPath().replaceFirst("/", ""); - serviceImpl_vm = MybatisGeneratorUtil.class.getResource(serviceImpl_vm).getPath().replaceFirst("/", ""); - - String targetProject = module + "/" + module + "-dao"; - String basePath = MybatisGeneratorUtil.class.getResource("/").getPath().replace("/target/classes/", "").replace(targetProject, "").replaceFirst("/", ""); - String generatorConfig_xml = MybatisGeneratorUtil.class.getResource("/").getPath().replace("/target/classes/", "") + "/src/main/resources/generatorConfig.xml"; - targetProject = basePath + targetProject; - String sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '" + database + "' AND table_name LIKE '" + table_prefix + "_%';"; - - System.out.println("========== 开始生成generatorConfig.xml文件 =========="); - List> tables = new ArrayList<>(); - try { - VelocityContext context = new VelocityContext(); - Map table; - - // 查询定制前缀项目的所有表 - JdbcUtil jdbcUtil = new JdbcUtil(jdbc_driver, jdbc_url, jdbc_username, AESUtil.AESDecode(jdbc_password)); - List result = jdbcUtil.selectByParams(sql, null); - for (Map map : result) { - System.out.println(map.get("TABLE_NAME")); - table = new HashMap<>(); - table.put("table_name", map.get("TABLE_NAME")); - table.put("model_name", lineToHump(ObjectUtils.toString(map.get("TABLE_NAME")))); - tables.add(table); - } - jdbcUtil.release(); - - String targetProject_sqlMap = basePath + module + "/" + module + "-rpc-service"; - context.put("tables", tables); - context.put("generator_javaModelGenerator_targetPackage", package_name + ".dao.model"); - context.put("generator_sqlMapGenerator_targetPackage", package_name + ".dao.mapper"); - context.put("generator_javaClientGenerator_targetPackage", package_name + ".dao.mapper"); - context.put("targetProject", targetProject); - context.put("targetProject_sqlMap", targetProject_sqlMap); - context.put("generator_jdbc_password", AESUtil.AESDecode(jdbc_password)); - context.put("last_insert_id_tables", last_insert_id_tables); - VelocityUtil.generate(generatorConfig_vm, generatorConfig_xml, context); - // 删除旧代码 - deleteDir(new File(targetProject + "/src/main/java/" + package_name.replaceAll("\\.", "/") + "/dao/model")); - deleteDir(new File(targetProject + "/src/main/java/" + package_name.replaceAll("\\.", "/") + "/dao/mapper")); - deleteDir(new File(targetProject_sqlMap + "/src/main/java/" + package_name.replaceAll("\\.", "/") + "/dao/mapper")); - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println("========== 结束生成generatorConfig.xml文件 =========="); - - System.out.println("========== 开始运行MybatisGenerator =========="); - List warnings = new ArrayList<>(); - File configFile = new File(generatorConfig_xml); - ConfigurationParser cp = new ConfigurationParser(warnings); - Configuration config = cp.parseConfiguration(configFile); - DefaultShellCallback callback = new DefaultShellCallback(true); - MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); - myBatisGenerator.generate(null); - for (String warning : warnings) { - System.out.println(warning); - } - System.out.println("========== 结束运行MybatisGenerator =========="); - - System.out.println("========== 开始生成Service =========="); - String ctime = new SimpleDateFormat("yyyy/M/d").format(new Date()); - String servicePath = basePath + module + "/" + module + "-rpc-api" + "/src/main/java/" + package_name.replaceAll("\\.", "/") + "/rpc/api"; - String serviceImplPath = basePath + module + "/" + module + "-rpc-service" + "/src/main/java/" + package_name.replaceAll("\\.", "/") + "/rpc/service/impl"; - for (int i = 0; i < tables.size(); i++) { - String model = lineToHump(ObjectUtils.toString(tables.get(i).get("table_name"))); - String service = servicePath + "/" + model + "Service.java"; - String serviceMock = servicePath + "/" + model + "ServiceMock.java"; - String serviceImpl = serviceImplPath + "/" + model + "ServiceImpl.java"; - // 生成service - File serviceFile = new File(service); - if (!serviceFile.exists()) { - VelocityContext context = new VelocityContext(); - context.put("package_name", package_name); - context.put("model", model); - context.put("ctime", ctime); - VelocityUtil.generate(service_vm, service, context); - System.out.println(service); - } - // 生成serviceMock - File serviceMockFile = new File(serviceMock); - if (!serviceMockFile.exists()) { - VelocityContext context = new VelocityContext(); - context.put("package_name", package_name); - context.put("model", model); - context.put("ctime", ctime); - VelocityUtil.generate(serviceMock_vm, serviceMock, context); - System.out.println(serviceMock); - } - // 生成serviceImpl - File serviceImplFile = new File(serviceImpl); - if (!serviceImplFile.exists()) { - VelocityContext context = new VelocityContext(); - context.put("package_name", package_name); - context.put("model", model); - context.put("mapper", StringUtil.toLowerCaseFirstOne(model)); - context.put("ctime", ctime); - VelocityUtil.generate(serviceImpl_vm, serviceImpl, context); - System.out.println(serviceImpl); - } - } - System.out.println("========== 结束生成Service =========="); - - System.out.println("========== 开始生成Controller =========="); - System.out.println("========== 结束生成Controller =========="); - } - - // 递归删除非空文件夹 - public static void deleteDir(File dir) { - if (dir.isDirectory()) { - File[] files = dir.listFiles(); - for (int i = 0; i < files.length; i++) { - deleteDir(files[i]); - } - } - dir.delete(); - } - -} diff --git a/common/src/main/java/com/micro/fast/common/util/StringUtil.java b/common/src/main/java/com/micro/fast/common/util/StringUtil.java deleted file mode 100644 index 62347a1..0000000 --- a/common/src/main/java/com/micro/fast/common/util/StringUtil.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.micro.fast.common.util; - - -import org.apache.commons.lang.StringUtils; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * String 工具类 - * Created by shuzheng on 2016/12/07. - */ -public class StringUtil { - - private static Pattern linePattern = Pattern.compile("_(\\w)"); - private static Pattern humpPattern = Pattern.compile("[A-Z]"); - - /** - * 下划线转驼峰 - * @param str - * @return - */ - private static String lineToHump(String str) { - if (null == str || "".equals(str)) { - return str; - } - str = str.toLowerCase(); - Matcher matcher = linePattern.matcher(str); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - matcher.appendReplacement(sb, matcher.group(1).toUpperCase()); - } - matcher.appendTail(sb); - - str = sb.toString(); - str = str.substring(0, 1).toUpperCase() + str.substring(1); - - return str; - } - - /** - * 驼峰转下划线(简单写法,效率低于{@link #humpToLine2(String)}) - * @param str - * @return - */ - public static String humpToLine(String str) { - return str.replaceAll("[A-Z]", "_$0").toLowerCase(); - } - - /** - * 驼峰转下划线,效率比上面高 - * @param str - * @return - */ - public static String humpToLine2(String str) { - Matcher matcher = humpPattern.matcher(str); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase()); - } - matcher.appendTail(sb); - return sb.toString(); - } - - /** - * 首字母转小写 - * @param s - * @return - */ - public static String toLowerCaseFirstOne(String s) { - if (StringUtils.isBlank(s)) { - return s; - } - if (Character.isLowerCase(s.charAt(0))) { - return s; - } else { - return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString(); - } - } - - /** - * 首字母转大写 - * @param s - * @return - */ - public static String toUpperCaseFirstOne(String s) { - if (StringUtils.isBlank(s)) { - return s; - } - if (Character.isUpperCase(s.charAt(0))) { - return s; - } else { - return (new StringBuffer()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString(); - } - } - - /** - * object转String - * @param object - * @return - */ - public static String getString(Object object) { - return getString(object, ""); - } - - public static String getString(Object object, String defaultValue) { - if (null == object) { - return defaultValue; - } - try { - return object.toString(); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * object转Integer - * @param object - * @return - */ - public static int getInt(Object object) { - return getInt(object, -1); - } - - public static int getInt(Object object, Integer defaultValue) { - if (null == object) { - return defaultValue; - } - try { - return Integer.parseInt(object.toString()); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * object转Boolean - * @param object - * @return - */ - public static boolean getBoolean(Object object) { - return getBoolean(object, false); - } - - public static boolean getBoolean(Object object, Boolean defaultValue) { - if (null == object) { - return defaultValue; - } - try { - return Boolean.parseBoolean(object.toString()); - } catch (Exception e) { - return defaultValue; - } - } - -} diff --git a/common/src/main/java/com/micro/fast/common/util/VelocityUtil.java b/common/src/main/java/com/micro/fast/common/util/VelocityUtil.java deleted file mode 100644 index eade626..0000000 --- a/common/src/main/java/com/micro/fast/common/util/VelocityUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.micro.fast.common.util; - -import org.apache.commons.io.output.FileWriterWithEncoding; -import org.apache.commons.lang.StringUtils; -import org.apache.velocity.Template; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.Velocity; -import org.apache.velocity.app.VelocityEngine; - -import java.io.File; -import java.util.Properties; - -/** - * Velocity工具类 - * Created by ZhangShuzheng on 2017/1/10. - */ -public class VelocityUtil { - - /** - * 根据模板生成文件 - * @param inputVmFilePath 模板路径 - * @param outputFilePath 输出文件路径 - * @param context - * @throws Exception - */ - public static void generate(String inputVmFilePath, String outputFilePath, VelocityContext context) throws Exception { - try { - Properties properties = new Properties(); - properties.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, getPath(inputVmFilePath)); - Velocity.init(properties); - //VelocityEngine engine = new VelocityEngine(); - Template template = Velocity.getTemplate(getFile(inputVmFilePath), "utf-8"); - File outputFile = new File(outputFilePath); - FileWriterWithEncoding writer = new FileWriterWithEncoding(outputFile, "utf-8"); - template.merge(context, writer); - writer.close(); - } catch (Exception ex) { - throw ex; - } - } - - /** - * 根据文件绝对路径获取目录 - * @param filePath - * @return - */ - public static String getPath(String filePath) { - String path = ""; - if (StringUtils.isNotBlank(filePath)) { - path = filePath.substring(0, filePath.lastIndexOf("/") + 1); - } - return path; - } - - /** - * 根据文件绝对路径获取文件 - * @param filePath - * @return - */ - public static String getFile(String filePath) { - String file = ""; - if (StringUtils.isNotBlank(filePath)) { - file = filePath.substring(filePath.lastIndexOf("/") + 1); - } - return file; - } - -} diff --git a/common/src/main/resources/generatorConfig.xml b/common/src/main/resources/generatorConfig.xml new file mode 100644 index 0000000..1af5863 --- /dev/null +++ b/common/src/main/resources/generatorConfig.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + + + +
+
+
+
\ No newline at end of file diff --git a/common/src/main/resources/templates/Controller.vm b/common/src/main/resources/templates/Controller.vm deleted file mode 100644 index 8cdf728..0000000 --- a/common/src/main/resources/templates/Controller.vm +++ /dev/null @@ -1,25 +0,0 @@ -package ${groupId}.${module}.${layer}.controller; - -import ${groupId}.common.base.BaseController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -/** - * ${modelname}controller - * Created by shuzheng on ${ctime}. - */ -@Controller -@RequestMapping("/manage") -@Api(value = "${modelname}控制器", description = "${modelname}管理") -public class ${model}Controller extends BaseController { - - private static Logger _log = LoggerFactory.getLogger(${model}Controller.class); - - - -} \ No newline at end of file diff --git a/common/src/main/resources/templates/Service.vm b/common/src/main/resources/templates/Service.vm deleted file mode 100644 index d04b42a..0000000 --- a/common/src/main/resources/templates/Service.vm +++ /dev/null @@ -1,13 +0,0 @@ -package ${package_name}.rpc.api; - -import com.zheng.common.base.BaseService; -import ${package_name}.dao.model.${model}; -import ${package_name}.dao.model.${model}Example; - -/** -* ${model}Service接口 -* Created by shuzheng on ${ctime}. -*/ -public interface ${model}Service extends BaseService<${model}, ${model}Example> { - -} \ No newline at end of file diff --git a/common/src/main/resources/templates/ServiceImpl.vm b/common/src/main/resources/templates/ServiceImpl.vm deleted file mode 100644 index 2ffa250..0000000 --- a/common/src/main/resources/templates/ServiceImpl.vm +++ /dev/null @@ -1,29 +0,0 @@ -package ${package_name}.rpc.service.impl; - -import com.zheng.common.annotation.BaseService; -import com.zheng.common.base.BaseServiceImpl; -import ${package_name}.dao.mapper.${model}Mapper; -import ${package_name}.dao.model.${model}; -import ${package_name}.dao.model.${model}Example; -import ${package_name}.rpc.api.${model}Service; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** -* ${model}Service实现 -* Created by shuzheng on ${ctime}. -*/ -@Service -@Transactional -@BaseService -public class ${model}ServiceImpl extends BaseServiceImpl<${model}Mapper, ${model}, ${model}Example> implements ${model}Service { - - private static Logger _log = LoggerFactory.getLogger(${model}ServiceImpl.class); - - @Autowired - ${model}Mapper ${mapper}Mapper; - -} \ No newline at end of file diff --git a/common/src/main/resources/templates/ServiceMock.vm b/common/src/main/resources/templates/ServiceMock.vm deleted file mode 100644 index b008fba..0000000 --- a/common/src/main/resources/templates/ServiceMock.vm +++ /dev/null @@ -1,14 +0,0 @@ -package ${package_name}.rpc.api; - -import com.zheng.common.base.BaseServiceMock; -import ${package_name}.dao.mapper.${model}Mapper; -import ${package_name}.dao.model.${model}; -import ${package_name}.dao.model.${model}Example; - -/** -* 降级实现${model}Service接口 -* Created by shuzheng on ${ctime}. -*/ -public class ${model}ServiceMock extends BaseServiceMock<${model}Mapper, ${model}, ${model}Example> implements ${model}Service { - -} diff --git a/common/src/main/resources/templates/generatorConfig.vm b/common/src/main/resources/templates/generatorConfig.vm deleted file mode 100644 index 31c4f1b..0000000 --- a/common/src/main/resources/templates/generatorConfig.vm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #foreach($table in $tables) - #if($last_insert_id_tables.containsKey($!table.table_name) == true) - - -
- #else -
- #end - #end -
-
diff --git a/config-server/src/main/resources/application.yml b/config-server/src/main/resources/application.yml index 869a542..7a6635b 100644 --- a/config-server/src/main/resources/application.yml +++ b/config-server/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: git: uri: https://git.oschina.net/kklt1996/config-server/ server: - port: 10001 + port: 9999 # 健康检查的相关配置 management: health: @@ -18,7 +18,7 @@ management: enabled: false diskspace: enabled: true - port: 20001 + port: 19999 # info 信息的获取 info: app: diff --git a/docker-compose.yml b/docker-compose.yml index c399ff3..c01fd98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ umps: - build: ./upms + build: ./upms.sql ports: - "10004:10004" - "20004:20004" diff --git a/eureka-server/src/main/resources/application.yml b/eureka-server/src/main/resources/application.yml deleted file mode 100644 index c54c25d..0000000 --- a/eureka-server/src/main/resources/application.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 只是用来在本地编写文件用,无任何使用 -info: - app: - profiles: dev - name: eureka-server #从pom.xml中获取 - description: eureka-server -spring: - application: - name: eureka-server # 实例的名称 -server: - port: 10002 -eureka: - client: - service-url: - defaultZone: http://127.0.0.1:10003/eureka #和其他注册中心连接 - instance: - hostname: www.eureka.server.com # 实例的主机名 -# 健康检查的配置 -management: - health: - mail: - enabled: false - redis: - enabled: false - security: - enabled: false #springbooot1.5.*以后如果要使用refresh功能的要设置false - port: 20002 \ No newline at end of file diff --git a/eureka-server/src/main/resources/bootstrap.yml b/eureka-server/src/main/resources/bootstrap.yml index 2befaa2..8911124 100644 --- a/eureka-server/src/main/resources/bootstrap.yml +++ b/eureka-server/src/main/resources/bootstrap.yml @@ -2,7 +2,7 @@ spring: cloud: config: - uri: http://127.0.0.1:10001/ + uri: http://127.0.0.1:9999/ profile: dev label: master name: eureka-server diff --git a/eureka-server2/src/main/resources/application.yml b/eureka-server2/src/main/resources/application.yml deleted file mode 100644 index 30c3ad6..0000000 --- a/eureka-server2/src/main/resources/application.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 只是用来在本地编写文件用,无任何使用 -info: - app: - profiles: dev - name: eureka-server2 #从pom.xml中获取 - description: eureka-server2 -spring: - application: - name: eureka-server2 # 实例的名称 -server: - port: 10003 -eureka: - client: - service-url: - defaultZone: http://127.0.0.1:10002/eureka #和其他注册中心连接 - instance: - hostname: www.eureka.server2.com # 实例的主机名 -# 健康检查的配置 -management: - health: - mail: - enabled: false - redis: - enabled: false - security: - enabled: false #springbooot1.5.*以后如果要使用refresh功能的要设置false - port: 20003 \ No newline at end of file diff --git a/eureka-server2/src/main/resources/bootstrap.yml b/eureka-server2/src/main/resources/bootstrap.yml index fc5cea5..31190b6 100644 --- a/eureka-server2/src/main/resources/bootstrap.yml +++ b/eureka-server2/src/main/resources/bootstrap.yml @@ -4,4 +4,4 @@ spring: name: eureka-server2 profile: dev label: master - uri: http://127.0.0.1:10001/ + uri: http://127.0.0.1:9999/ diff --git a/pom.xml b/pom.xml index ac47605..cbc8e50 100644 --- a/pom.xml +++ b/pom.xml @@ -1,28 +1,29 @@ - - - 4.0.0 - - com.micro.fast - micro-fast - 0.0.1-SNAPSHOT - pom - - micro-fast - micro-fast enterprise class solutions - - - UTF-8 - UTF-8 - 1.8 - 1.8 - 1.8 - 1.8 - - - config-server - eureka-server - eureka-server2 - upms - - + + + 4.0.0 + + com.micro.fast + micro-fast + 0.0.1-SNAPSHOT + pom + + micro-fast + micro-fast enterprise class solutions + + + UTF-8 + UTF-8 + 1.8 + 1.8 + 1.8 + 1.8 + + + config-server + eureka-server + eureka-server2 + upms + common + + diff --git a/upms/src/main/resources/application.yml b/upms/src/main/resources/application.yml deleted file mode 100644 index 39869a1..0000000 --- a/upms/src/main/resources/application.yml +++ /dev/null @@ -1,30 +0,0 @@ -# 只是用来在本地编写文件用,无任何使用 -info: - app: - profiles: dev - name: upms - description: upms -spring: - application: - name: upms -server: - port: 10004 -eureka: - client: - serviceUrl: - defaultZone: http://127.0.0.1:10002/eureka/,http://127.0.0.1:10003/eureka/ #配置所有的注册中心 - instance: - hostname: www.upms.com -feign: - hystrix: - enabled: true #开启监控熔断 -# 健康检查的相关配置 -management: - health: - mail: - enabled: false - redis: - enabled: false - security: - enabled: false #springbooot1.5.*以后如果要使用refresh功能的要设置false - port: 20004 diff --git a/upms/src/main/resources/bootstrap.yml b/upms/src/main/resources/bootstrap.yml index edc5b86..46b252c 100644 --- a/upms/src/main/resources/bootstrap.yml +++ b/upms/src/main/resources/bootstrap.yml @@ -2,7 +2,7 @@ spring: cloud: config: - uri: http://127.0.0.1:10001/ + uri: http://127.0.0.1:9999/ profile: dev label: master name: upms \ No newline at end of file