77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
# Notification Service 配置文件
|
||
# 当前阶段:服务使用编程式直连(main.go 中通过 flag/env 传入地址),此文件仅作占位。
|
||
# 后续引入 Nacos 服务注册中心后,取消注释并在 main.go 中调用 config.Load() 加载此文件。
|
||
|
||
# 服务配置
|
||
service:
|
||
name: notification-service
|
||
version: 1.0.0
|
||
port: 20010 # Notification Service 端口
|
||
|
||
# 数据库配置
|
||
database:
|
||
host: localhost
|
||
port: 5432
|
||
user: postgres
|
||
password: ""
|
||
dbname: top-fans
|
||
sslmode: disable
|
||
timezone: Asia/Shanghai
|
||
schema: public
|
||
|
||
# 日志配置
|
||
logging:
|
||
level: info
|
||
encoding: json
|
||
output_paths:
|
||
- stdout
|
||
|
||
# 手机推送(uniPush)配置
|
||
# 留 push.url 为空字符串表示未配置;启动时 PUSH_ENABLED=true 但 url 为空会降级为 NoopPusher 并 warn。
|
||
# 推荐通过 env 注入(见 deploy/envs/notification.env),避免 vendor URL 入仓。
|
||
push:
|
||
enabled: true
|
||
url: "" # uniCloud sendMessage URL,通过 PUSH_URL env 覆盖
|
||
timeout_ms: 4000
|
||
|
||
dubbo:
|
||
# 应用配置
|
||
application:
|
||
name: notification-service
|
||
version: 1.0.0
|
||
|
||
# 注册中心配置(暂未启用,后续接入 Nacos 时取消注释)
|
||
# registries:
|
||
# nacos:
|
||
# protocol: nacos
|
||
# address: 127.0.0.1:8848
|
||
# timeout: 5s
|
||
|
||
# 协议配置
|
||
protocols:
|
||
triple:
|
||
name: tri
|
||
port: 20010 # Notification Service 端口
|
||
|
||
# Provider 配置
|
||
provider:
|
||
# registry-ids: nacos # 接入 Nacos 后取消注释
|
||
protocol-ids: triple
|
||
services:
|
||
NotificationService:
|
||
interface: "github.com.topfans.backend.pkg.proto.notification.NotificationService"
|
||
|
||
# Consumer 配置(暂未启用,后续接入外部依赖时按需开启)
|
||
consumer:
|
||
# registry-ids: nacos # 接入 Nacos 后取消注释
|
||
references: {}
|
||
# 例如接入 User Service:
|
||
# UserSocialService:
|
||
# protocol: tri
|
||
# interface: "github.com.topfans.backend.pkg.proto.user.UserSocialService"
|
||
# cluster: failover
|
||
# loadbalance: random
|
||
|
||
# 超时配置
|
||
timeout: 5s
|