feat(supply-api): 完成核心模块实现
新增/修改内容: - config: 添加配置管理(config.example.yaml, config.go) - cache: 添加Redis缓存层(redis.go) - domain: 添加invariants不变量验证及测试 - middleware: 添加auth认证和idempotency幂等性中间件及测试 - repository: 添加完整数据访问层(account, package, settlement, idempotency, db) - sql: 添加幂等性表DDL脚本 代码覆盖: - auth middleware实现凭证边界验证 - idempotency middleware实现请求幂等性 - invariants实现业务不变量检查 - repository层实现完整的数据访问逻辑 关联issue: Round-1 R1-ISSUE-006 凭证边界硬门禁
This commit is contained in:
37
supply-api/config/config.example.yaml
Normal file
37
supply-api/config/config.example.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
# Supply API Development Configuration
|
||||
server:
|
||||
addr: ":18082"
|
||||
read_timeout: 10s
|
||||
write_timeout: 15s
|
||||
idle_timeout: 30s
|
||||
shutdown_timeout: 5s
|
||||
|
||||
database:
|
||||
host: "localhost"
|
||||
port: 5432
|
||||
user: "postgres"
|
||||
password: ""
|
||||
database: "supply_db"
|
||||
max_open_conns: 25
|
||||
max_idle_conns: 5
|
||||
conn_max_lifetime: 1h
|
||||
conn_max_idle_time: 10m
|
||||
|
||||
redis:
|
||||
host: "localhost"
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
pool_size: 10
|
||||
|
||||
token:
|
||||
secret_key: "${SUPPLY_TOKEN_SECRET_KEY}"
|
||||
issuer: "lijiaoqiao/supply-api"
|
||||
access_token_ttl: 1h
|
||||
refresh_token_ttl: 168h
|
||||
revocation_cache_ttl: 30s
|
||||
|
||||
audit:
|
||||
buffer_size: 1000
|
||||
flush_interval: 5s
|
||||
export_timeout: 30s
|
||||
Reference in New Issue
Block a user