Pārlūkot izejas kodu

完善源码改造文档

lengfaqiang 2 gadi atpakaļ
vecāks
revīzija
0efcdd662e

+ 11 - 0
SOURCE_MODIFICATION.md

@@ -137,10 +137,21 @@
 ##### 展示效果
     当项目中pom文件对应进行配置后(可参考sentinel-dashboard/src/main/resources下config.txt进行项目配置),调用服务后,可在Sentinel Dashboard 页面进行展示查看 
     用户名与密码:sentinel/sentinel,可在application.properties进行配置
+----
+##### Sentinel展示
+![img_3.png](img_3.png)
+----
+##### Nacos展示以及响应结果
 ![img_1.png](img_1.png)
 ![img_2.png](img_2.png)
 ---
 
+#### 代码应用层面
+    1:自定义异常类编写(可参考矿拉拉下的sckw-common/sckw-core/web/exceptionHandler)
+    2:项目pom配置(可参考sentinel-dashboard/src/main/resources下config.txt进行项目配置)
+    3:nacos异常配置
+    4:项目中使用注解@SentinelResource()
+
 #### 4:配置文件改造(也可不改造,使用默认application.properties作为主配置文件)
 ##### 原有配置文件读取为sentinel-dashboard/src/main/resources中application.properties文件。当前修改为多源配置,增加prod、dev、test、local、配置进行灵活配置。
 

BIN
img_3.png


+ 1 - 1
sentinel-dashboard/src/main/resources/application-dev.properties

@@ -4,7 +4,7 @@ server.servlet.encoding.charset=UTF-8
 server.servlet.encoding.enabled=true
 
 # 服务端口、控制台地址、名称
-server.port=19527
+#server.port=19527
 csp.sentinel.dashboard.server=47.108.162.14:19527
 #csp.sentinel.dashboard.server=127.0.0.1:19527
 project.name=sentinel-dashboard

+ 1 - 1
sentinel-dashboard/src/main/resources/application.properties

@@ -2,7 +2,7 @@
 server.port=19527 
 #spring.application.name=项目名
 #环境 dev prod test
-spring.profiles.active=local
+spring.profiles.active=dev
 
 
 

+ 2 - 2
sentinel-dashboard/target/classes/application.properties

@@ -1,5 +1,5 @@
-# 端口号  可放在环境配置文件中,不同的环境使用不同端口
-server.port=19527
+# 端口号  可放在环境配置文件中,不同的环境使用不同端口 #默认为7080
+server.port=19527 
 #spring.application.name=项目名
 #环境 dev prod test
 spring.profiles.active=local