mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
2.0
This commit is contained in:
@@ -53,11 +53,9 @@ public class ZuulConfig extends AlipayZuulConfiguration {
|
|||||||
|
|
||||||
## 注册到eureka显示hostname,非ip
|
## 注册到eureka显示hostname,非ip
|
||||||
|
|
||||||
```yaml
|
```properties
|
||||||
eureka:
|
eureka.instance.prefer-ip-address=true
|
||||||
instance:
|
eureka.instance.instance-id=${spring.cloud.client.ip-address}:${server.port}
|
||||||
prefer-ip-address: true
|
|
||||||
instance-id: ${spring.cloud.client.ip-address}:${server.port}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
@@ -98,10 +96,9 @@ public static class Swagger2 extends SwaggerSupport {
|
|||||||
|
|
||||||
yml添加:
|
yml添加:
|
||||||
|
|
||||||
```yaml
|
```properties
|
||||||
ribbon:
|
# https://blog.csdn.net/qq_36872046/article/details/81058045
|
||||||
# https://blog.csdn.net/qq_36872046/article/details/81058045
|
# 路由转发超时时间,毫秒,默认值1000,详见:RibbonClientConfiguration.DEFAULT_READ_TIMEOUT。
|
||||||
# 路由转发超时时间,毫秒,默认值1000,详见:RibbonClientConfiguration.DEFAULT_READ_TIMEOUT。
|
# 如果微服务端 处理时间过长,会导致ribbon read超时,解决办法将这个值调大一点
|
||||||
# 如果微服务端 处理时间过长,会导致ribbon read超时,解决办法将这个值调大一点
|
ribbon.ReadTimeout: 60000
|
||||||
ReadTimeout: 60000
|
|
||||||
```
|
```
|
@@ -28,26 +28,34 @@
|
|||||||
<artifactId>sop-service-common</artifactId>
|
<artifactId>sop-service-common</artifactId>
|
||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- sop相关配置 end-->
|
<!-- sop相关配置 end-->
|
||||||
|
|
||||||
|
<!-- 使用nacos注册中心
|
||||||
|
版本 0.2.x.RELEASE 对应的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 对应的是 Spring Boot 1.x 版本。
|
||||||
|
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-alibaba-nacos-discovery
|
||||||
|
-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
<version>0.2.2.RELEASE</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.gitee.sop</groupId>
|
<groupId>com.gitee.sop</groupId>
|
||||||
<artifactId>sdk-java</artifactId>
|
<artifactId>sdk-java</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
|
||||||
<artifactId>okhttp</artifactId>
|
|
||||||
<version>3.14.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.oschina.durcframework</groupId>
|
<groupId>net.oschina.durcframework</groupId>
|
||||||
|
24
sop-auth/src/main/resources/application-dev.properties
Normal file
24
sop-auth/src/main/resources/application-dev.properties
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
server.port=8087
|
||||||
|
spring.application.name=sop-auth
|
||||||
|
|
||||||
|
# ------- 需要改的配置 -------
|
||||||
|
# mysql数据库账号
|
||||||
|
mysql.username=root
|
||||||
|
mysql.password=root
|
||||||
|
|
||||||
|
# nacos地址
|
||||||
|
nacos.url=127.0.0.1:8848
|
||||||
|
|
||||||
|
# ------- 需要改的配置end -------
|
||||||
|
|
||||||
|
# nacos cloud配置
|
||||||
|
spring.cloud.nacos.discovery.server-addr=${nacos.url}
|
||||||
|
|
||||||
|
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
|
||||||
|
spring.datasource.username=${mysql.username}
|
||||||
|
spring.datasource.password=${mysql.password}
|
||||||
|
|
||||||
|
spring.thymeleaf.cache=false
|
||||||
|
|
||||||
|
logging.level.com.gitee=debug
|
@@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
server:
|
|
||||||
port: 8087
|
|
||||||
|
|
||||||
|
|
||||||
# 注册中心
|
|
||||||
eureka:
|
|
||||||
port: 1111
|
|
||||||
host: localhost
|
|
||||||
client:
|
|
||||||
serviceUrl:
|
|
||||||
defaultZone: http://${eureka.host}:${eureka.port}/eureka/
|
|
||||||
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
name: sop-auth
|
|
||||||
|
|
||||||
cloud:
|
|
||||||
zookeeper:
|
|
||||||
connect-string: localhost:2181
|
|
||||||
|
|
||||||
# 数据源
|
|
||||||
datasource:
|
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
|
||||||
url: jdbc:mysql://localhost:3306/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
|
|
||||||
thymeleaf:
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
# redis设置
|
|
||||||
# redis:
|
|
||||||
# host: localhost
|
|
||||||
# database: 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com:
|
|
||||||
gitee: debug
|
|
1
sop-auth/src/main/resources/application.properties
Normal file
1
sop-auth/src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
|||||||
|
spring.profiles.active=dev
|
@@ -1,3 +0,0 @@
|
|||||||
spring:
|
|
||||||
profiles:
|
|
||||||
active: dev
|
|
Reference in New Issue
Block a user