feat:添加colg对接功能

This commit is contained in:
2026-11-03 21:44:30 +08:00
parent 3937185d0a
commit 4709ea4328
13 changed files with 1742 additions and 79 deletions
+20
View File
@@ -29,6 +29,26 @@ uv run ruff check .
- `core/basic/equipment_registry.py`: equipment version registry and cache.
- `database/connect.py`: SQLite and Redis connections.
## Gold Cache and Notifications
- Application startup checks both realtime and official gold caches, then checks
them every minute. Data older than 30 minutes refreshes without HTTP traffic.
Redis locks prevent duplicate work across workers. Realtime region pages stay
8 seconds apart. Failures retain the last successful data for up to 24 hours.
- Official authentication uses `HELPER_TOKEN` and `HELPER_ID`. Authentication
failures (`returnCode=-30003`, explicit token-expiry messages or HTTP 401) can
notify via Bark. Network errors do not trigger token-expiry notifications.
- Set optional `BARK_URL` in `config/.env`, `.env.dev`, `.env.prod` or the process
environment to your full Bark push URL, including its device key. There is no
default destination; unset/blank means no Bark request. Restart after changing
credentials. A successful alert is deduplicated per token for 24 hours; a new
token permits a new alert. Failed pushes remain retryable. No credentials are
included in notification text or logged push errors.
- Official gold responses also contain `max` and `min`: the largest/smallest
values of `10000 / price` across both rank arrays, in 万金币 per 100点券,
rounded to 4 decimals. Nonpositive/invalid prices are excluded; absent valid
quotes yield `null`. Existing rank arrays retain their 点券 per 100万金币 unit.
## Compatibility Rules
- Do not change `/calc` request and response contract without frontend migration approval.