Procházet zdrojové kódy

:recycle: 重构代码。

冷冷 před 7 roky
rodič
revize
9e6ca907bb

+ 1 - 1
pigx-auth/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 3 - 0
pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/exception/ValidateCodeException.java

@@ -26,6 +26,9 @@ package com.pig4cloud.pigx.common.core.exception;
 public class ValidateCodeException extends Exception {
 	private static final long serialVersionUID = -7285211528095468156L;
 
+	public ValidateCodeException() {
+	}
+
 	public ValidateCodeException(String msg) {
 		super(msg);
 	}

+ 1 - 1
pigx-config/src/main/resources/bootstrap.yml

@@ -19,7 +19,7 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 
 # 暴露监控端点
 management:

+ 1 - 1
pigx-config/src/main/resources/config/application-dev.yml

@@ -2,7 +2,7 @@
 spring:
   redis:
     password:
-    host: localhost
+    host: pigx-redis
 # 暴露监控端点
 management:
   endpoints:

+ 3 - 3
pigx-config/src/main/resources/config/pigx-upms-dev.yml

@@ -2,11 +2,11 @@
 security:
   oauth2:
     client:
-      client-id: pig
-      client-secret: pig
+      client-id: pigx
+      client-secret: pigx
       scope: server
     resource:
-      token-info-uri: http://localhost:9999/auth/oauth/check_token
+      token-info-uri: http://pigx-gateway:9999/auth/oauth/check_token
 
 # 数据源
 spring:

+ 2 - 8
pigx-eureka/src/main/resources/bootstrap.yml

@@ -8,21 +8,15 @@ spring:
       password: pig
   application:
     name: pigx-eureka
-  boot:
-    admin:
-      client:
-        url: http://localhost:5001
-        instance:
-          name: PIGX-EUREKA
 
 # docker-compose部署时候 hostname 换成pigx-eureka
 # 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway
 eureka:
   instance:
-    hostname: localhost
+    hostname: pigx-eureka
     prefer-ip-address: true
   client:
-    register-with-eureka: false
+    register-with-eureka: true
     fetch-registry: false
     service-url:
       defaultZone: http://pig:pig@${eureka.instance.hostname}:${server.port}/eureka/

+ 3 - 3
pigx-gateway/pom.xml

@@ -56,9 +56,9 @@
 		</dependency>
 		<!--hutool-->
 		<dependency>
-			<groupId>cn.hutool</groupId>
-			<artifactId>hutool-all</artifactId>
-			<version>${hutool.version}</version>
+			<groupId>com.pig4cloud</groupId>
+			<artifactId>pigx-common-core</artifactId>
+			<version>${pigx.version}</version>
 		</dependency>
 		<!--接口文档-->
 		<dependency>

+ 0 - 47
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/exception/CheckedException.java

@@ -1,47 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.gateway.exception;
-
-/**
- * @author lengleng
- * @date 2018年07月22日
- * 异常包装类
- */
-public class CheckedException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-
-	public CheckedException() {
-	}
-
-	public CheckedException(String message) {
-		super(message);
-	}
-
-	public CheckedException(Throwable cause) {
-		super(cause);
-	}
-
-	public CheckedException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	public CheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-		super(message, cause, enableSuppression, writableStackTrace);
-	}
-}

+ 0 - 25
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/exception/ValidateCodeException.java

@@ -1,25 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.gateway.exception;
-
-/**
- * @author lengleng
- */
-public class ValidateCodeException extends Exception {
-
-}

+ 2 - 2
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/ImageCodeGatewayFilter.java

@@ -20,9 +20,9 @@ package com.pig4cloud.pigx.gateway.filter;
 import cn.hutool.core.codec.Base64;
 import cn.hutool.core.util.CharsetUtil;
 import cn.hutool.core.util.StrUtil;
+import com.pig4cloud.pigx.common.core.exception.CheckedException;
+import com.pig4cloud.pigx.common.core.exception.ValidateCodeException;
 import com.pig4cloud.pigx.gateway.config.FilterIgnorePropertiesConfig;
-import com.pig4cloud.pigx.gateway.exception.CheckedException;
-import com.pig4cloud.pigx.gateway.exception.ValidateCodeException;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cloud.gateway.filter.GatewayFilter;

+ 1 - 1
pigx-gateway/src/main/resources/bootstrap.yml

@@ -22,6 +22,6 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 
 

+ 1 - 1
pigx-upms/pigx-upms-biz/src/main/resources/bootstrap.yml

@@ -23,4 +23,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-visual/pigx-daemon/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-visual/pigx-monitor/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/