- 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
107 lines
2.1 KiB
JSON
107 lines
2.1 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "sync_state",
|
|
"title": "同步状态跟踪",
|
|
"primary": "id",
|
|
"classification": "system"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"type": "VARCHAR(32)",
|
|
"nullable": false,
|
|
"default": "",
|
|
"comment": "主键"
|
|
},
|
|
{
|
|
"name": "entity_type",
|
|
"type": "VARCHAR(32)",
|
|
"nullable": false,
|
|
"default": "",
|
|
"comment": "实体类型: users/pricing/llmage/uapi"
|
|
},
|
|
{
|
|
"name": "entity_id",
|
|
"type": "VARCHAR(64)",
|
|
"nullable": true,
|
|
"default": "",
|
|
"comment": "实体标识(全量同步时为空)"
|
|
},
|
|
{
|
|
"name": "last_sync_time",
|
|
"type": "DATETIME",
|
|
"nullable": true,
|
|
"default": null,
|
|
"comment": "最后同步时间"
|
|
},
|
|
{
|
|
"name": "sync_version",
|
|
"type": "VARCHAR(32)",
|
|
"nullable": true,
|
|
"default": "",
|
|
"comment": "Sage返回的版本标识"
|
|
},
|
|
{
|
|
"name": "sync_status",
|
|
"type": "VARCHAR(16)",
|
|
"nullable": false,
|
|
"default": "success",
|
|
"comment": "同步状态: success/pending/failed"
|
|
},
|
|
{
|
|
"name": "error_msg",
|
|
"type": "TEXT",
|
|
"nullable": true,
|
|
"default": null,
|
|
"comment": "失败原因"
|
|
},
|
|
{
|
|
"name": "retry_count",
|
|
"type": "INT",
|
|
"nullable": false,
|
|
"default": 0,
|
|
"comment": "重试次数"
|
|
},
|
|
{
|
|
"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_entity_type",
|
|
"fields": [
|
|
"entity_type"
|
|
],
|
|
"unique": false
|
|
},
|
|
{
|
|
"name": "idx_entity_type_id",
|
|
"fields": [
|
|
"entity_type",
|
|
"entity_id"
|
|
],
|
|
"unique": true
|
|
},
|
|
{
|
|
"name": "idx_sync_status",
|
|
"fields": [
|
|
"sync_status"
|
|
],
|
|
"unique": false
|
|
}
|
|
],
|
|
"codes": []
|
|
} |