Prechádzať zdrojové kódy

user-service 和 search-service 暂不使用 nacos config

reghao 1 týždeň pred
rodič
commit
74b8a93d74

+ 3 - 3
search/search-service/pom.xml

@@ -147,10 +147,10 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
+        </dependency>-->
 
         <dependency>
             <groupId>org.springdoc</groupId>
@@ -191,7 +191,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-                    <!--<include>application-${profile.active}.yml</include>-->
+                    <include>application-${profile.active}.yml</include>
                     <include>mapper/**</include>
                     <include>*.xml</include>
                 </includes>

+ 11 - 11
search/search-service/src/main/resources/application.yml

@@ -6,14 +6,14 @@ spring:
   threads:
     virtual:
       enabled: true
-  cloud:
-    nacos:
-      config:
-        server-addr: 127.0.0.1
-        group: DEFAULT_GROUP
-        file-extension: yaml
-        username: nacos
-        password: Test_123456
-  config:
-    import:
-      - nacos:${spring.application.name}-${spring.profiles.active}
+#  cloud:
+#    nacos:
+#      config:
+#        server-addr: 127.0.0.1
+#        group: DEFAULT_GROUP
+#        file-extension: yaml
+#        username: nacos
+#        password: Test_123456
+#  config:
+#    import:
+#      - nacos:${spring.application.name}-${spring.profiles.active}

+ 3 - 3
user/user-service/pom.xml

@@ -78,10 +78,10 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
+        </dependency>-->
 
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -141,7 +141,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-<!--                    <include>application-${profile.active}.yml</include>-->
+                    <include>application-${profile.active}.yml</include>
                     <include>mapper/**</include>
                     <include>*.xml</include>
                 </includes>

+ 47 - 5
user/user-service/src/main/resources/application-dev.yml

@@ -1,8 +1,40 @@
 dubbo:
+  application:
+    name: user-service
+    qos-enable: true
+    qos-port: 16104
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.user.app.rpc
+  protocol:
+    name: dubbo
+    port: 6104
   registry:
     group: dubbo
     address: zookeeper://127.0.0.1:2181
+server:
+  port: 6004
+  tomcat:
+    max-http-form-post-size: 4MB
 spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://127.0.0.1/tnb_account_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
   cloud:
     discovery:
       enabled: true
@@ -10,14 +42,24 @@ spring:
       discovery:
         server-addr: 127.0.0.1:8848
         username: nacos
-        password: E4B2M7W8Dx
+        password: Test_123456
   data:
     redis:
       database: 0
       host: 127.0.0.1
       port: 6379
       password: Test_123456
-  datasource:
-    url: jdbc:mysql://127.0.0.1/tnb_account_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-    username: test
-    password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**/**.xml
+  type-aliases-package: cn.reghao.tnb.user.app.model.po
+management:
+  endpoints:
+    web:
+      #      base-path: /api/user/actuator
+      exposure:
+        include: "*"
+  metrics:
+    tags:
+      application: ${spring.application.name}

+ 47 - 5
user/user-service/src/main/resources/application-test.yml

@@ -1,8 +1,40 @@
 dubbo:
+  application:
+    name: user-service
+    qos-enable: true
+    qos-port: 16104
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.user.app.rpc
+  protocol:
+    name: dubbo
+    port: 6104
   registry:
     group: dubbo
     address: zookeeper://192.168.0.209:2181
+server:
+  port: 6004
+  tomcat:
+    max-http-form-post-size: 4MB
 spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://192.168.0.209/tnb_account_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test@123456
   cloud:
     discovery:
       enabled: true
@@ -16,8 +48,18 @@ spring:
       database: 0
       host: 192.168.0.209
       port: 6379
-      password: Test_123456
-  datasource:
-    url: jdbc:mysql://192.168.0.209:3306/tnb_account_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-    username: test
-    password: Test_123456
+      password: Test@123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**/**.xml
+  type-aliases-package: cn.reghao.tnb.user.app.model.po
+management:
+  endpoints:
+    web:
+      #      base-path: /api/user/actuator
+      exposure:
+        include: "*"
+  metrics:
+    tags:
+      application: ${spring.application.name}

+ 14 - 11
user/user-service/src/main/resources/application.yml

@@ -3,14 +3,17 @@ spring:
     name: user-service
   profiles:
     active: @profile.active@
-  cloud:
-    nacos:
-      config:
-        server-addr: 127.0.0.1
-        group: DEFAULT_GROUP
-        file-extension: yaml
-        username: nacos
-        password: Test_123456
-  config:
-    import:
-      - nacos:${spring.application.name}-${spring.profiles.active}
+  threads:
+    virtual:
+      enabled: true
+#  cloud:
+#    nacos:
+#      config:
+#        server-addr: 127.0.0.1
+#        group: DEFAULT_GROUP
+#        file-extension: yaml
+#        username: nacos
+#        password: Test_123456
+#  config:
+#    import:
+#      - nacos:${spring.application.name}-${spring.profiles.active}