From 7cf4a70b486041ea1eec35ca8bf4f6f67743fa3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Wed, 22 Aug 2018 20:58:48 +0800 Subject: [PATCH 1/9] =?UTF-8?q?:bug:=20eureka=20host=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-eureka/src/main/resources/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pigx-eureka/src/main/resources/bootstrap.yml b/pigx-eureka/src/main/resources/bootstrap.yml index 8f1cbe986..2c36ec856 100644 --- a/pigx-eureka/src/main/resources/bootstrap.yml +++ b/pigx-eureka/src/main/resources/bootstrap.yml @@ -13,7 +13,7 @@ spring: # 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway eureka: instance: - hostname: pigx-eureka + hostname: localhost prefer-ip-address: true client: register-with-eureka: false From caa923843e927fb84ba0b966191ee0441651a925 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Mon, 3 Sep 2018 12:56:06 +0800 Subject: [PATCH 2/9] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-config/src/main/resources/config/pigx-auth-dev.yml | 4 ++-- pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 4 ++-- pigx-config/src/main/resources/config/pigx-daemon-dev.yml | 6 +++--- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pigx-config/src/main/resources/config/pigx-auth-dev.yml b/pigx-config/src/main/resources/config/pigx-auth-dev.yml index f8a9b6464..0a9e9aee8 100644 --- a/pigx-config/src/main/resources/config/pigx-auth-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-auth-dev.yml @@ -4,5 +4,5 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 46304f871..108ad7d41 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -12,8 +12,8 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index effd2ac2c..2051c1515 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -13,12 +13,12 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false elasticjob: # 分布式任务协调依赖zookeeper zookeeper: - server-lists: 114.116.45.246:13181 + server-lists: 127.0.0.1:2181 namespace: pigx-daemon # 普通任务 simples: diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index 541b41bde..aff10bc63 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -12,8 +12,8 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false # mybaits 模块配置 mybatis-plus: From 9f933f7d6eec3a19d1671d8bbbade64f9a8973e2 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Mon, 3 Sep 2018 13:36:07 +0800 Subject: [PATCH 3/9] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-config/src/main/resources/config/pigx-auth-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-daemon-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pigx-config/src/main/resources/config/pigx-auth-dev.yml b/pigx-config/src/main/resources/config/pigx-auth-dev.yml index 0a9e9aee8..8abdbf645 100644 --- a/pigx-config/src/main/resources/config/pigx-auth-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-auth-dev.yml @@ -4,5 +4,5 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 108ad7d41..19fde2cb1 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -12,7 +12,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false jackson: time-zone: GMT+8 diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index 2051c1515..892f6174e 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -13,7 +13,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false elasticjob: # 分布式任务协调依赖zookeeper diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index aff10bc63..bfa68b9c9 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -12,7 +12,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false # mybaits 模块配置 From 5f94fe8323f63c1fbdc4845cdb3c1046000ae819 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Tue, 4 Sep 2018 18:04:32 +0800 Subject: [PATCH 4/9] =?UTF-8?q?:memo:=20=E7=BC=96=E5=86=99=E6=96=87?= =?UTF-8?q?=E6=A1=A3:=E6=96=B0=E5=A2=9Eelastic-job=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E5=B9=B3=E5=8F=B0=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/md/catalog.md | 2 + doc/md/elastic-job-monitor-platform.md | 74 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 doc/md/elastic-job-monitor-platform.md diff --git a/doc/md/catalog.md b/doc/md/catalog.md index f9de413e8..3450b0ba5 100644 --- a/doc/md/catalog.md +++ b/doc/md/catalog.md @@ -7,3 +7,5 @@ > [代码生成使用](codegen.md) > [社交登录使用](social.md) + +> [任务监控平台搭建](elastic-job-monitor-platform.md) diff --git a/doc/md/elastic-job-monitor-platform.md b/doc/md/elastic-job-monitor-platform.md new file mode 100644 index 000000000..05e028c55 --- /dev/null +++ b/doc/md/elastic-job-monitor-platform.md @@ -0,0 +1,74 @@ +# Elastic-Job作业监控平台搭建 + +## 获取源码 +首先是上github下载elastic-job的源码,目前最新的地址如下: https://github.com/elasticjob/elastic-job-lite + +下载前要注意源码需要和你使用的elastic-job版本一致。 + +![20189416555](http://p7sojn4oj.bkt.clouddn.com/20189416555.png) + + +1. 在你喜欢的终端应用里执行以下命令: + +```bash +git clone https://github.com/elasticjob/elastic-job-lite.git +``` + +2. 下载完成以后cd到仓库 + +3. 以PigX所使用的2.1.5版本为例,执行以下命令切换到2.1.5标签的代码: + +```bash +git checkout 2.1.5 +``` + +## 编译源码 + +这个过程很简单,执行命令: + +```bash +mvn package -DskipTests +``` + +## 开始使用 + +1. 进入/elastic-job-lite/elastic-job-lite-console/target文件夹,有一个叫做```elastic-job-lite-console-2.1.5.tar.gz```的文件就是我们需要的了。 + +2. 解压之,执行bin目录下的start脚本,这货默认运行在```8899```端口,以用户名:```root```和密码:```root```进行登录 + +3. 知道大家可能看不懂,右上角切换一波语言吧! + +4. 以pigx最新的1.6.0的稳定版代码为例,查看配置中心下的```pigx-daemon-dev.yml```文件,与我们目前相关的配置文件如下: + +```yml +## 定时任务 +spring: + # 保存定时任务的数据源 + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.jdbc.Driver + username: root + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + elasticjob: + # 分布式任务协调依赖zookeeper + zookeeper: + server-lists: 127.0.0.1:2181 + namespace: pigx-daemon +``` + +通过全局配置-注册中心配置,填入以下参数: + +![201894174025](http://p7sojn4oj.bkt.clouddn.com/201894174025.png) + +然后修改全局配置-事件追踪数据源配置,填入以下参数: + +![20189417457](http://p7sojn4oj.bkt.clouddn.com/20189417457.png) + +在操作处点击连接,出现已连的字样表示连接成功。 + +![201894174634](http://p7sojn4oj.bkt.clouddn.com/201894174634.png) + +最终效果如下: + +![20189418110](http://p7sojn4oj.bkt.clouddn.com/20189418110.png) \ No newline at end of file From c305d9c205dcb91a136dac70aac6471301b07160 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Mon, 24 Sep 2018 20:03:08 +0800 Subject: [PATCH 5/9] =?UTF-8?q?:recycle:=20swagger=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=BB=98=E8=AE=A4=E6=8E=92=E9=99=A4=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E7=AB=AF=E7=82=B9=E5=92=8CSpring=20Boot=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/SwaggerAutoConfiguration.java | 13 +++++---- .../main/resources/config/application-dev.yml | 29 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java index b7e404104..84ee6db98 100644 --- a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java +++ b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java @@ -17,7 +17,6 @@ package com.pig4cloud.pigx.common.swagger.config; -import cn.hutool.core.collection.CollUtil; import com.google.common.base.Predicate; import com.google.common.base.Predicates; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -34,6 +33,7 @@ import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -46,7 +46,10 @@ import java.util.List; @EnableAutoConfiguration public class SwaggerAutoConfiguration { - private static final String DEFAULT_EXCLUDE_PATH = "/error"; + /** + * 默认的排除路径,排除Spring Boot默认的错误处理路径和端点 + */ + private static final List DEFAULT_EXCLUDE_PATH = Arrays.asList("/error","/actuator/**"); private static final String BASE_PATH = "/**"; @Bean @@ -58,7 +61,7 @@ public class SwaggerAutoConfiguration { @Bean public Docket api(SwaggerProperties swaggerProperties) { // base-path处理 - if (CollUtil.isEmpty(swaggerProperties.getBasePath())) { + if (swaggerProperties.getBasePath().isEmpty()) { swaggerProperties.getBasePath().add(BASE_PATH); } //noinspection unchecked @@ -66,8 +69,8 @@ public class SwaggerAutoConfiguration { swaggerProperties.getBasePath().forEach(path -> basePath.add(PathSelectors.ant(path))); // exclude-path处理 - if (CollUtil.isEmpty(swaggerProperties.getExcludePath())) { - swaggerProperties.getExcludePath().add(DEFAULT_EXCLUDE_PATH); + if (swaggerProperties.getExcludePath().isEmpty()) { + swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH); } List> excludePath = new ArrayList<>(); swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path))); diff --git a/pigx-config/src/main/resources/config/application-dev.yml b/pigx-config/src/main/resources/config/application-dev.yml index 468da6722..f0d60ca6d 100644 --- a/pigx-config/src/main/resources/config/application-dev.yml +++ b/pigx-config/src/main/resources/config/application-dev.yml @@ -72,25 +72,22 @@ mybatis-plus: #swagger公共信息 swagger: - title: 'PigX Swagger API' - description: '全宇宙最牛逼的Spring Cloud微服务开发脚手架' - version: '1.4.0' - license: 'Powered By PigX' - licenseUrl: 'https://gitee.com/log4j/pig/wikis' - terms-of-service-url: 'https://gitee.wang/pig/pigx' - exclude-path: - - /actuator/** - - /error + title: PigX Swagger API + description: 全宇宙最牛逼的Spring Cloud微服务开发脚手架 + version: 1.6.2 + license: Powered By PigX + licenseUrl: https://pig4cloud.com/ + terms-of-service-url: https://pig4cloud.com/ contact: - name: '冷冷' - email: 'wangiegie@gmail.com' - url: 'https://gitee.wang/pig/pigx' + name: 冷冷 + email: wangiegie@gmail.com + url: https://pig4cloud.com/about.html authorization: - name: 'pigX OAuth' - auth-regex: '^.*$' + name: pigX OAuth + auth-regex: ^.*$ authorization-scope-list: - - scope: 'server' - description: 'server all' + - scope: server + description: server all token-url-list: - ${security.auth.server}/token From 9278a31f1c47127856caceabf0bc8fdd4f5dce3f Mon Sep 17 00:00:00 2001 From: lishangbu Date: Thu, 27 Sep 2018 22:45:39 +0800 Subject: [PATCH 6/9] =?UTF-8?q?:recycle:=20=E9=87=8D=E6=9E=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81:=20=E5=A3=B0=E6=98=8E=E5=A4=8D=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pigx/auth/endpoint/PigxTokenEndpoint.java | 3 ++- .../pigx/common/core/constant/CommonConstant.java | 8 ++++---- .../com/pig4cloud/pigx/codegen/util/GenUtils.java | 11 ++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java index 142b71fe6..5199aa653 100644 --- a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java +++ b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java @@ -22,6 +22,7 @@ package com.pig4cloud.pigx.auth.endpoint; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.plugins.Page; +import com.pig4cloud.pigx.common.core.constant.SecurityConstants; import com.pig4cloud.pigx.common.core.util.R; import com.pig4cloud.pigx.common.security.service.PigxUser; import lombok.AllArgsConstructor; @@ -53,7 +54,7 @@ import java.util.Map; @AllArgsConstructor @RequestMapping("/oauth") public class PigxTokenEndpoint { - private static final String PIGX_OAUTH_ACCESS = "pigx_oauth:access:"; + private static final String PIGX_OAUTH_ACCESS = SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX + "access:"; private final TokenStore tokenStore; private final RedisTemplate redisTemplate; diff --git a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java index 5b0e0c472..1688d41be 100644 --- a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java +++ b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java @@ -78,12 +78,12 @@ public interface CommonConstant { String CONTENT_TYPE = "application/json; charset=utf-8"; /** - * 阿里大鱼 + * 前端工程名 */ - String ALIYUN_SMS = "aliyun_sms"; + String FRONT_END_PROJECT = "pigx-ui"; /** - * 路由信息Redis保存的key + * 后端工程名 */ - String ROUTE_KEY = "_ROUTE_KEY"; + String BACK_END_PROJECT = "pigx"; } diff --git a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/util/GenUtils.java b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/util/GenUtils.java index 5c9d56ef5..3843544aa 100644 --- a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/util/GenUtils.java +++ b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/util/GenUtils.java @@ -24,6 +24,7 @@ import cn.hutool.core.util.StrUtil; import com.pig4cloud.pigx.codegen.entity.ColumnEntity; import com.pig4cloud.pigx.codegen.entity.GenConfig; import com.pig4cloud.pigx.codegen.entity.TableEntity; +import com.pig4cloud.pigx.common.core.constant.CommonConstant; import com.pig4cloud.pigx.common.core.exception.CheckedException; import lombok.extern.slf4j.Slf4j; import org.apache.commons.configuration.Configuration; @@ -239,7 +240,7 @@ public class GenUtils { * 获取文件名 */ private static String getFileName(String template, String className, String packageName, String moduleName) { - String packagePath = "pigx" + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator; + String packagePath = CommonConstant.BACK_END_PROJECT + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator; if (StringUtils.isNotBlank(packageName)) { packagePath += packageName.replace(".", File.separator) + File.separator + moduleName + File.separator; } @@ -265,7 +266,7 @@ public class GenUtils { } if (template.contains(MAPPER_XML_VM)) { - return "pigx" + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "mapper" + File.separator + className + "Mapper.xml"; + return CommonConstant.BACK_END_PROJECT + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "mapper" + File.separator + className + "Mapper.xml"; } if (template.contains(MENU_SQL_VM)) { @@ -273,16 +274,16 @@ public class GenUtils { } if (template.contains(INDEX_VUE_VM)) { - return "pigx-ui" + File.separator + "src" + File.separator + "views" + + return CommonConstant.FRONT_END_PROJECT + File.separator + "src" + File.separator + "views" + File.separator + moduleName + File.separator + className.toLowerCase() + File.separator + "index.vue"; } if (template.contains(API_JS_VM)) { - return "pigx-ui" + File.separator + "src" + File.separator + "api" + File.separator + className.toLowerCase() + ".js"; + return CommonConstant.FRONT_END_PROJECT + File.separator + "src" + File.separator + "api" + File.separator + className.toLowerCase() + ".js"; } if (template.contains(CRUD_JS_VM)) { - return "pigx-ui" + File.separator + "src" + File.separator + "const" + + return CommonConstant.FRONT_END_PROJECT + File.separator + "src" + File.separator + "const" + File.separator + "crud" + File.separator + className.toLowerCase() + ".js"; } From 7b4913781d2027d4891bf79acd3512756e329e80 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Sat, 29 Sep 2018 21:16:13 +0800 Subject: [PATCH 7/9] =?UTF-8?q?:fire:=20=E7=B2=BE=E7=AE=80=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E9=81=97=E7=95=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/constant/CommonConstant.java | 24 ------------------- .../service/PigxUserDetailsServiceImpl.java | 7 +++--- .../pigx/admin/controller/DictController.java | 1 - .../pigx/admin/controller/LogController.java | 2 -- .../pigx/admin/controller/RoleController.java | 1 - 5 files changed, 3 insertions(+), 32 deletions(-) diff --git a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java index 1688d41be..909f70ba7 100644 --- a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java +++ b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstant.java @@ -24,20 +24,6 @@ package com.pig4cloud.pigx.common.core.constant; * @date 2017/10/29 */ public interface CommonConstant { - /** - * token请求头名称 - */ - String REQ_HEADER = "Authorization"; - - /** - * token分割符 - */ - String TOKEN_SPLIT = "Bearer "; - - /** - * jwt签名 - */ - String SIGN_KEY = "PIG"; /** * 删除 */ @@ -57,16 +43,6 @@ public interface CommonConstant { */ String MENU = "0"; - /** - * 按钮 - */ - String BUTTON = "1"; - - /** - * 删除标记 - */ - String DEL_FLAG = "del_flag"; - /** * 编码 */ diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/service/PigxUserDetailsServiceImpl.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/service/PigxUserDetailsServiceImpl.java index db6f18550..376de0158 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/service/PigxUserDetailsServiceImpl.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/service/PigxUserDetailsServiceImpl.java @@ -98,10 +98,9 @@ public class PigxUserDetailsServiceImpl implements PigxUserDetailsService { Collection authorities = AuthorityUtils.createAuthorityList(dbAuthsSet.toArray(new String[0])); SysUser user = info.getSysUser(); - boolean enabled = StrUtil.equals(user.getDelFlag(), CommonConstant.STATUS_NORMAL); - // 构造security用户 - return new PigxUser(user.getUserId(), user.getDeptId(), user.getUsername(), SecurityConstants.BCRYPT + user.getPassword(), enabled, - true, true, true, authorities); + // 构造security用户 + return new PigxUser(user.getUserId(), user.getDeptId(), user.getUsername(), SecurityConstants.BCRYPT + user.getPassword(), + StrUtil.equals(user.getDelFlag(), CommonConstant.STATUS_NORMAL),true, true, true, authorities); } } diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/DictController.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/DictController.java index b0a0953af..bc930fb1e 100644 --- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/DictController.java +++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/DictController.java @@ -71,7 +71,6 @@ public class DictController { */ @GetMapping("/dictPage") public Page dictPage(@RequestParam Map params) { - params.put(CommonConstant.DEL_FLAG, CommonConstant.STATUS_NORMAL); return sysDictService.selectPage(new Query<>(params), new EntityWrapper<>()); } diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/LogController.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/LogController.java index 52b1629bc..ed79c6f20 100644 --- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/LogController.java +++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/LogController.java @@ -25,7 +25,6 @@ import com.baomidou.mybatisplus.plugins.Page; import com.pig4cloud.pigx.admin.api.entity.SysLog; import com.pig4cloud.pigx.admin.api.vo.PreLogVo; import com.pig4cloud.pigx.admin.service.SysLogService; -import com.pig4cloud.pigx.common.core.constant.CommonConstant; import com.pig4cloud.pigx.common.core.util.Query; import com.pig4cloud.pigx.common.core.util.R; import lombok.AllArgsConstructor; @@ -58,7 +57,6 @@ public class LogController { */ @GetMapping("/logPage") public Page logPage(@RequestParam Map params) { - params.put(CommonConstant.DEL_FLAG, CommonConstant.STATUS_NORMAL); return sysLogService.selectPage(new Query<>(params), new EntityWrapper<>()); } diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/RoleController.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/RoleController.java index 1684abc8e..28f5e584d 100644 --- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/RoleController.java +++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/RoleController.java @@ -110,7 +110,6 @@ public class RoleController { */ @GetMapping("/rolePage") public Page rolePage(@RequestParam Map params) { - params.put(CommonConstant.DEL_FLAG, CommonConstant.STATUS_NORMAL); return sysRoleService.selectwithDeptPage(new Query<>(params), new EntityWrapper<>()); } From c458676b5626d9c356055140b4a6b8c1c184f105 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Sat, 29 Sep 2018 23:15:57 +0800 Subject: [PATCH 8/9] =?UTF-8?q?:bookmark:=E5=8F=91=E5=B8=83=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=89=88=E6=9C=AC:1.6.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 5 ----- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 4 ---- 2 files changed, 9 deletions(-) diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 19fde2cb1..1247ffb3a 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -19,8 +19,3 @@ spring: date-format: yyyy-MM-dd HH:mm:ss resources: static-locations: classpath:/static/,classpath:/views/ - -# mybaits 模块配置 -mybatis-plus: - typeAliasesPackage: com.pig4cloud.pigx.codegen.entity - diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index bfa68b9c9..7f7c71a9d 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -15,10 +15,6 @@ spring: password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false -# mybaits 模块配置 -mybatis-plus: - typeAliasesPackage: com.pig4cloud.pigx.admin.api.entity - # swagger相关配置,覆盖全局配置 swagger: authorization: From 0e4ad03e989eaee9af6cfbe1bc042f1bf10c25d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Sun, 30 Sep 2018 09:41:53 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'pigx-config/src/main/?= =?UTF-8?q?resources/config/pigx-upms-dev.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :wrench: 修改配置文件。支持多SQL执行 --- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index 7f7c71a9d..becfc823e 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -13,7 +13,7 @@ spring: driver-class-name: com.mysql.jdbc.Driver username: root password: root - url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true # swagger相关配置,覆盖全局配置 swagger: