- 36 files: module structure following module-development-spec - 7 table definitions: users_cache, pricing_cache, llmage_cache, uapi_cache, sync_state, customer_balance, accounting_records - Auth: dapi_auth + uapi_sign - Sync: base_sync + entity-specific sync modules (users/pricing/uapi/llmage) - Cache: LRU cache manager with TTL - API: balance, accounting, users, pricing, health handlers - Config: YAML config loader with env overrides - Utils: HTTP client, crypto helpers
162 lines
3.1 KiB
JSON
162 lines
3.1 KiB
JSON
{
|
||
"summary": [
|
||
{
|
||
"name": "accounting_records",
|
||
"title": "记账记录",
|
||
"primary": "id",
|
||
"classification": "business"
|
||
}
|
||
],
|
||
"fields": [
|
||
{
|
||
"name": "id",
|
||
"type": "VARCHAR(32)",
|
||
"nullable": false,
|
||
"default": "",
|
||
"comment": "主键"
|
||
},
|
||
{
|
||
"name": "customer_id",
|
||
"type": "VARCHAR(32)",
|
||
"nullable": false,
|
||
"default": "",
|
||
"comment": "客户ID"
|
||
},
|
||
{
|
||
"name": "llmid",
|
||
"type": "VARCHAR(32)",
|
||
"nullable": true,
|
||
"default": "",
|
||
"comment": "模型ID"
|
||
},
|
||
{
|
||
"name": "model_name",
|
||
"type": "VARCHAR(128)",
|
||
"nullable": true,
|
||
"default": "",
|
||
"comment": "模型名称"
|
||
},
|
||
{
|
||
"name": "pricing_id",
|
||
"type": "VARCHAR(32)",
|
||
"nullable": true,
|
||
"default": "",
|
||
"comment": "定价ID"
|
||
},
|
||
{
|
||
"name": "input_tokens",
|
||
"type": "BIGINT",
|
||
"nullable": true,
|
||
"default": null,
|
||
"comment": "输入token数"
|
||
},
|
||
{
|
||
"name": "output_tokens",
|
||
"type": "BIGINT",
|
||
"nullable": true,
|
||
"default": null,
|
||
"comment": "输出token数"
|
||
},
|
||
{
|
||
"name": "total_tokens",
|
||
"type": "BIGINT",
|
||
"nullable": true,
|
||
"default": null,
|
||
"comment": "总token数"
|
||
},
|
||
{
|
||
"name": "quantity",
|
||
"type": "DECIMAL(15,4)",
|
||
"nullable": true,
|
||
"default": null,
|
||
"comment": "用量(图片数/分钟数等)"
|
||
},
|
||
{
|
||
"name": "amount",
|
||
"type": "DECIMAL(15,6)",
|
||
"nullable": false,
|
||
"default": 0.0,
|
||
"comment": "金额"
|
||
},
|
||
{
|
||
"name": "currency",
|
||
"type": "VARCHAR(8)",
|
||
"nullable": false,
|
||
"default": "CNY",
|
||
"comment": "货币单位"
|
||
},
|
||
{
|
||
"name": "request_id",
|
||
"type": "VARCHAR(64)",
|
||
"nullable": true,
|
||
"default": "",
|
||
"comment": "请求ID(幂等键)"
|
||
},
|
||
{
|
||
"name": "transno",
|
||
"type": "VARCHAR(64)",
|
||
"nullable": true,
|
||
"default": "",
|
||
"comment": "事务号"
|
||
},
|
||
{
|
||
"name": "status",
|
||
"type": "VARCHAR(16)",
|
||
"nullable": false,
|
||
"default": "pending",
|
||
"comment": "状态: pending/accounted/failed"
|
||
},
|
||
{
|
||
"name": "created_at",
|
||
"type": "DATETIME",
|
||
"nullable": false,
|
||
"default": "CURRENT_TIMESTAMP",
|
||
"comment": "创建时间"
|
||
},
|
||
{
|
||
"name": "updated_at",
|
||
"type": "DATETIME",
|
||
"nullable": false,
|
||
"default": "CURRENT_TIMESTAMP",
|
||
"comment": "更新时间"
|
||
}
|
||
],
|
||
"idxfields": [
|
||
{
|
||
"name": "idx_customer_id",
|
||
"fields": [
|
||
"customer_id"
|
||
],
|
||
"unique": false
|
||
},
|
||
{
|
||
"name": "idx_llmid",
|
||
"fields": [
|
||
"llmid"
|
||
],
|
||
"unique": false
|
||
},
|
||
{
|
||
"name": "idx_request_id",
|
||
"fields": [
|
||
"request_id"
|
||
],
|
||
"unique": true
|
||
},
|
||
{
|
||
"name": "idx_status",
|
||
"fields": [
|
||
"status"
|
||
],
|
||
"unique": false
|
||
},
|
||
{
|
||
"name": "idx_created_at",
|
||
"fields": [
|
||
"created_at"
|
||
],
|
||
"unique": false
|
||
}
|
||
],
|
||
"codes": []
|
||
} |