Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc3dfdf

Browse files
Merge pull request zhoutaoo#96 from zhoutaoo/dev
Dev To Master
2 parents 3e66c2f + 72c35f7 commit dc3dfdf

File tree

23 files changed

+113
-94
lines changed

23 files changed

+113
-94
lines changed

‎auth/authentication-server/src/main/java/com/springboot/cloud/auth/authentication/provider/ResourceProviderFallback.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import com.springboot.cloud.sysadmin.organization.entity.po.Resource;
44
import com.springboot.cloud.common.core.entity.vo.Result;
5+
import org.springframework.stereotype.Component;
56

67
import java.util.HashSet;
78
import java.util.Set;
89

10+
@Component
911
public class ResourceProviderFallback implements ResourceProvider {
1012
@Override
1113
public Result<Set<Resource>> resources() {

‎auth/authentication-server/src/main/resources/application.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,27 @@ spring:
1313
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
1414
username: ${DATASOURCE_USERNAME:root}
1515
password: ${DATASOURCE_PASSWORD:root123}
16-
1716
zipkin:
1817
enabled: true
1918
sender:
2019
type: rabbit
2120
sleuth:
2221
sampler:
2322
probability: 1.0
24-
2523
mvc:
2624
throw-exception-if-no-handler-found: true
27-
2825
#jwt的密钥
2926
security:
3027
oauth2:
3128
jwt:
3229
signingKey: 123456
3330

31+
feign:
32+
sentinel:
33+
enabled: true
34+
okhttp:
35+
enabled: true
36+
3437
logging:
3538
level:
3639
org.springframework.web: debug
@@ -50,3 +53,4 @@ management:
5053
mybatis:
5154
configuration:
5255
map-underscore-to-camel-case: true
56+

‎auth/authorization-server/src/main/java/com/springboot/auth/authorization/provider/OrganizationProviderFallback.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import com.springboot.auth.authorization.entity.Role;
44
import com.springboot.auth.authorization.entity.User;
55
import com.springboot.cloud.common.core.entity.vo.Result;
6+
import org.springframework.stereotype.Component;
67

78
import java.util.HashSet;
89
import java.util.Set;
910

11+
@Component
1012
public class OrganizationProviderFallback implements OrganizationProvider {
1113

1214
@Override

‎auth/authorization-server/src/main/resources/application.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ logging:
4141
file:
4242
max-size: 1GB
4343

44+
feign:
45+
sentinel:
46+
enabled: true
47+
okhttp:
48+
enabled: true
49+
4450
management:
4551
endpoints:
4652
web:

‎auth/db/db.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ CREATE TABLE oauth_client_token
7878
-- DML数据准备
7979

8080
INSERT INTO oauth_client_details (client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove)
81-
VALUES ('test_client', NULL, '2ドルa10ドル2ドルszDKjvKHJCWE6YQNznogOeQF3USZHmCYj1fG7YbfK.vnTgNKLzri', 'read', 'client_credentials,authorization_code,password,refresh_token', 'http://baidu.com', NULL, 7200, 108000, NULL, NULL);
81+
VALUES ('test_client', NULL, '2ドルa10ドル2ドルszDKjvKHJCWE6YQNznogOeQF3USZHmCYj1fG7YbfK.vnTgNKLzri', 'read', 'client_credentials,authorization_code,mobile,password,refresh_token', 'http://baidu.com', NULL, 7200, 108000, NULL, NULL);
8282

8383

‎center/bus/src/main/resources/application.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ spring:
55
username: ${RABBIT_MQ_USERNAME:guest}
66
password: ${RABBIT_MQ_PASSWORD:guest}
77

8+
management:
9+
endpoints:
10+
web:
11+
exposure:
12+
include: '*'
813
logging:
914
level:
1015
root: info

‎center/pom.xml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
<version>0.0.1-SNAPSHOT</version>
1818
</parent>
1919

20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-web</artifactId>
24+
</dependency>
25+
</dependencies>
26+
2027
<modules>
2128
<module>bus</module>
2229
</modules>

‎common/core/src/main/java/com/springboot/cloud/common/core/entity/vo/Result.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public class Result<T> {
2424
@ApiModelProperty(value = "处理结果描述信息")
2525
private String mesg;
2626
@ApiModelProperty(value = "请求结果生成时间戳")
27-
private Instant timestamp;
27+
private Instant time;
2828
@ApiModelProperty(value = "处理结果数据信息")
2929
@JsonInclude(JsonInclude.Include.NON_NULL)
3030
private T data;
3131

3232
public Result() {
33-
this.timestamp = ZonedDateTime.now().toInstant();
33+
this.time = ZonedDateTime.now().toInstant();
3434
}
3535

3636
/**
@@ -39,7 +39,7 @@ public Result() {
3939
public Result(ErrorType errorType) {
4040
this.code = errorType.getCode();
4141
this.mesg = errorType.getMesg();
42-
this.timestamp = ZonedDateTime.now().toInstant();
42+
this.time = ZonedDateTime.now().toInstant();
4343
}
4444

4545
/**
@@ -62,7 +62,7 @@ private Result(String code, String mesg, T data) {
6262
this.code = code;
6363
this.mesg = mesg;
6464
this.data = data;
65-
this.timestamp = ZonedDateTime.now().toInstant();
65+
this.time = ZonedDateTime.now().toInstant();
6666
}
6767

6868
/**

‎demos/consumer-feign/src/main/resources/application.yml‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
1-
server:
2-
port: 8041
3-
41
spring:
5-
application:
6-
name: feign-consumer
7-
cloud:
8-
nacos:
9-
discovery:
10-
server-addr: ${REGISTER_HOST:localhost}:${REGISTER_PORT:8848}
11-
sentinel:
12-
transport:
13-
dashboard: ${SENTINEL_DASHBOARD_HOST:localhost}:${SENTINEL_DASHBOARD_PORT:8021}
14-
152
rabbitmq:
163
host: ${RABBIT_MQ_HOST:localhost}
174
port: ${RABBIT_MQ_PORT:5672}
185
username: ${RABBIT_MQ_USERNAME:guest}
196
password: ${RABBIT_MQ_PASSWORD:guest}
20-
217
zipkin:
228
sender:
239
type: rabbit
@@ -29,7 +15,6 @@ spring:
2915
enabled: true
3016
processor:
3117
enabled: true
32-
3318
mvc:
3419
throw-exception-if-no-handler-found: true
3520
servlet:
@@ -46,6 +31,12 @@ logging:
4631
file:
4732
max-size: 1GB
4833

34+
feign:
35+
sentinel:
36+
enabled: true
37+
okhttp:
38+
enabled: true
39+
4940
management:
5041
endpoints:
5142
web:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
server:
2+
port: 8041
3+
spring:
4+
application:
5+
name: feign-consumer
6+
cloud:
7+
nacos:
8+
discovery:
9+
server-addr: ${REGISTER_HOST:localhost}:${REGISTER_PORT:8848}
10+
config:
11+
server-addr: ${REGISTER_HOST:localhost}:${REGISTER_PORT:8848}
12+
file-extension: yml
13+
sentinel:
14+
transport:
15+
dashboard: ${SENTINEL_DASHBOARD_HOST:localhost}:${SENTINEL_DASHBOARD_PORT:8021}
16+
bus:
17+
trace:
18+
enabled: true

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /