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:
29
supply-api/.env.example
Normal file
29
supply-api/.env.example
Normal file
@@ -0,0 +1,29 @@
|
||||
# Supply API Environment Variables
|
||||
# Copy this file to .env and fill in the values
|
||||
|
||||
# Server
|
||||
SUPPLY_API_ADDR=:18082
|
||||
SUPPLY_API_READ_TIMEOUT=10s
|
||||
SUPPLY_API_WRITE_TIMEOUT=15s
|
||||
|
||||
# Database (PostgreSQL)
|
||||
SUPPLY_DB_HOST=localhost
|
||||
SUPPLY_DB_PORT=5432
|
||||
SUPPLY_DB_USER=postgres
|
||||
SUPPLY_DB_PASSWORD=
|
||||
SUPPLY_DB_NAME=supply_db
|
||||
SUPPLY_DB_MAX_OPEN_CONNS=25
|
||||
SUPPLY_DB_MAX_IDLE_CONNS=5
|
||||
|
||||
# Redis
|
||||
SUPPLY_REDIS_HOST=localhost
|
||||
SUPPLY_REDIS_PORT=6379
|
||||
SUPPLY_REDIS_PASSWORD=
|
||||
SUPPLY_REDIS_DB=0
|
||||
|
||||
# Token (JWT)
|
||||
# 生成密钥: openssl rand -base64 32
|
||||
SUPPLY_TOKEN_SECRET_KEY=
|
||||
|
||||
# Environment (dev/staging/prod)
|
||||
SUPPLY_ENV=dev
|
||||
Reference in New Issue
Block a user