liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
oidc:
  enabled: true
  clientId: xp-robotaxi
  clientSecret: SlfCibLrXbfXYBMx
  grant_type: client_credentials
  url: https://ldap.deploy-test.xiaopeng.com/oidc/token
  stsTokenUrl: https://authhub.deploy-test.xiaopeng.com/api/sts/get_token
  stsPolicyName: XpRobotaxiSTAGINGOss
  aliOssUrl: https://oss-cn-hangzhou.aliyuncs.com
  aliOssRegin: cn-hangzhou
  aliOssBucket: xp-robotaxi
  aliOssObjectPrefix: staging/
  aliOssUrlPublic: https://oss-cn-hangzhou.aliyuncs.com
  fileWaterMarkUrl:
 
spring:
  config:
    activate:
      on-profile: local
  autoconfigure:
    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
  token:
    secret: iymGhx1XkAAHrex2Zf4ASbiD9P2ksTam
 
  # 以下为本地数据库/中间件配置,后续迁移至 Nacos
  redis:
    database: 99
    host: r-bp1ip8die60uuo3ovypd.redis.rds.aliyuncs.com
    password: syAktm2x9uDusoF_
    port: 6379
  data:
    mongodb:
      host: dds-bp1f4a38f3cccad4-pub.mongodb.rds.aliyuncs.com
      port: 3717
      database: xp_robotaxi
      username: xp_robotaxi
      password: hDXSBe_hs0d5KxUf
  shardingsphere:
    datasource:
      names: xp0
      xp0:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: jdbc:mysql://pc-bp1o444934f546768po.rwlb.rds.aliyuncs.com:3306/xp_robotaxi?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
        username: xp_robotaxi
        password: PrcZ3f_Hjp0uTcaX
        druid:
          # 连接池初始化时创建的连接数。
          # 应根据实际应用场景设置,确保应用程序启动时即可获取数据库连接。
          initial-size: 10
          # 连接池中最小的空闲连接数,保证即使在低负载时也有足够的连接可用。
          min-idle: 10
          # 连接池中最大活动连接数,限制并发请求时的数据库连接数,避免过多的连接消耗系统资源。
          max-active: 100
          # 获取连接时的最大等待时间,超过该时间则抛出异常。单位通常为毫秒。
          max-wait: 60000
          # 两个连接检查之间的时间间隔,用于检测和清理空闲过久的连接。单位为毫秒。
          time-between-eviction-runs-millis: 60000
          # 连接在被清理前的最小空闲时间。单位为毫秒。
          min-evictable-idle-time-millis: 300000
          # 用于验证连接有效性的 SQL 查询语句。
          validation-query: SELECT 1
          # 如果为真,则连接空闲时会被定期测试有效性。
          test-while-idle: true
          # 如果为真,在获取连接前进行有效性测试。
          test-on-borrow: false
          # 如果为真,在归还连接时进行有效性测试。
          test-on-return: false
          # 是否开启 PreparedStatement 缓存。
          pool-prepared-statements: true
          # 单个连接上缓存的 PreparedStatement 最大数量。
          max-pool-prepared-statement-per-connection-size: 20
          # 指定要启用的过滤器,如 stat, log4j, wall 等,用于监控和日志记录。
          filters: stat,wall,log4j
          # 连接属性,例如配置日志级别或慢 SQL 阈值。
          connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
          # 是否自动回收超时连接
          remove-abandoned: true
          # 超时时间,单位秒
          remove-abandoned-timeout: 1800
          # 是否记录被遗弃的连接
          log-abandoned: true
          # StatViewServlet配置,访问监控页面
          stat-view-servlet:
            enabled: true
            url-pattern: /druid/*
            login-username: admin
            login-password: admin
            reset-enable: false
          # 防火墙配置
          wall:
            config:
              multi-statement-allow: false
    rules:
      sharding:
        tables:
          xp_charging_record:
            actual-data-nodes: xp0.xp_charging_record_$->{0..9}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-charging-record-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_clock_in:
            actual-data-nodes: xp0.xp_clock_in_$->{0..9}
            table-strategy:
              standard:
                sharding-column: app_user_id
                sharding-algorithm-name: xp-clock-in-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task:
            actual-data-nodes: xp0.xp_task_$->{0..19}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-task-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task_handle_detail:
            actual-data-nodes: xp0.xp_task_handle_detail_$->{0..19}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-task-handle-detail-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task_handle_detail_routine:
            actual-data-nodes: xp0.xp_task_handle_detail_routine_$->{0..19}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-task-handle-detail-routine-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_detection:
            actual-data-nodes: xp0.xp_vehicle_detection_$->{0..9}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-vehicle-detection-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_preparation:
            actual-data-nodes: xp0.xp_vehicle_preparation_$->{0..9}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-vehicle-preparation-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_repair:
            actual-data-nodes: xp0.xp_vehicle_repair_$->{0..9}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-vehicle-repair-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_work_order:
            actual-data-nodes: xp0.xp_work_order_$->{0..9}
            table-strategy:
              standard:
                sharding-column: feedback_user_phone
                sharding-algorithm-name: xp-work-order-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_work_order_log:
            actual-data-nodes: xp0.xp_work_order_log_$->{0..19}
            table-strategy:
              standard:
                sharding-column: work_order_id
                sharding-algorithm-name: xp-work-order-log-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
        sharding-algorithms:
          xp-charging-record-inline:
            type: INLINE
            props:
              algorithm-expression: xp_charging_record_${vehicle_id % 20}
          xp-clock-in-inline:
            type: INLINE
            props:
              algorithm-expression: xp_clock_in_${app_user_id % 10}
          xp-task-inline:
            type: INLINE
            props:
              algorithm-expression: xp_task_${vehicle_id % 20}
          xp-task-handle-detail-inline:
            type: INLINE
            props:
              algorithm-expression: xp_task_handle_detail_${task_id % 20}
          xp-task-handle-detail-routine-inline:
            type: INLINE
            props:
              algorithm-expression: xp_task_handle_detail_routine_${task_id % 20}
          xp-vehicle-detection-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_detection_${vehicle_id % 10}
          xp-vehicle-preparation-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_preparation_${vehicle_id % 10}
          xp-vehicle-repair-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_repair_${vehicle_id % 10}
          xp-work-order-inline:
            type: INLINE
            props:
              algorithm-expression: xp_work_order_${feedback_user_phone % 10}
          xp-work-order-log-inline:
            type: INLINE
            props:
              algorithm-expression: xp_work_order_log_${work_order_id % 20}
        key-generators:
          snowflake:
            type: SNOWFLAKE
      single-table:
        default-data-source-name: xp0
    props:
      sql-show: true
      sql-simple: true
 
seata:
  enabled: false
  application-id: ${spring.application.name}
  tx-service-group: seata_tx_group    #此处配置自定义的seata事务分组名称
  enable-auto-data-source-proxy: false    #关闭数据库代理
  service:
    vgroup-mapping:
      seata_tx_group: default
  data-source-proxy-mode: AT
  config:
    type: nacos
    nacos:
      # 开发环境
      server-addr: 192.168.110.80:8848
      namespace: 88de3938-82f9-4cab-97cf-6173202703e0
      group: DEFAULT_GROUP
      data-id: seata-server.properties
      username: nacos
      password: nacos
      # 生产环境
  #      server-addr: 192.168.0.137:8848,192.168.0.123:8848
  #      namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a
  #      group: DEFAULT_GROUP
  #      data-id: seata-server.properties
  #      username: nacos
  #      password: nacos
#  registry:
#    type: nacos
#    nacos:
#      application: seata-server
#      # 开发环境
#      server-addr: 192.168.110.80:8848
#      namespace: 88de3938-82f9-4cab-97cf-6173202703e0
#      group: DEFAULT_GROUP
#      username: nacos
#      password: nacos
#      # 生产环境
#  #      server-addr: 192.168.0.137:8848,192.168.0.123:8848
#  #      namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a
#  #      group: DEFAULT_GROUP
#  #      username: nacos
#  #      password: nacos
#  cloud:
#    nacos:
#      discovery:
#        # 开发环境
#        server-addr: 192.168.110.80:8848
#        namespace: 88de3938-82f9-4cab-97cf-6173202703e0
#        group: DEFAULT_GROUP
#        application: seata-server #Nacos 中 Seata 名称
#        username: nacos
#        password: nacos
#        # 生产环境
#    #        server-addr: 192.168.0.137:8848,192.168.0.123:8848
#    #        namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a
#    #        group: DEFAULT_GROUP
#    #        application: seata-server #Nacos 中 Seata 名称
#    #        username: nacos
#    #        password: nacos
#    sentinel:
#      transport:
#        dashboard: 192.168.0.137:8080  #  Sentinel控制台地址
#      eager: true
  #  datasource:
  #    driver-class-name: com.mysql.cj.jdbc.Driver
  #    url: jdbc:mysql://pc-bp1o444934f546768po.rwlb.rds.aliyuncs.com:3306/xp_robotaxi?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
  #    username: xp_robotaxi
  #    password: PrcZ3f_Hjp0uTcaX