- 3 CRUD JSON files: customer_balance, accounting_records, sync_state - Build script with model validation, CRUD validation, DDL generation - DDL: db/schema.sql (72 lines, 7 tables) - Scripts: validate_models.py, validate_crud.py, generate_ddl.py
37 lines
2.4 KiB
JSON
37 lines
2.4 KiB
JSON
{
|
|
"sync_state": {
|
|
"params": {
|
|
"title": "同步状态管理",
|
|
"dbname": "sageapi",
|
|
"page_size": 20
|
|
},
|
|
"fields": [
|
|
{"name": "id", "title": "ID", "type": "string", "readonly": true, "width": 100},
|
|
{"name": "entity_type", "title": "实体类型", "type": "select", "width": 100, "options": [{"value": "users", "label": "用户"}, {"value": "pricing", "label": "定价"}, {"value": "uapi", "label": "UAPI"}, {"value": "llmage", "label": "LLMage"}]},
|
|
{"name": "entity_id", "title": "实体ID", "type": "string", "width": 120},
|
|
{"name": "last_sync_time", "title": "最后同步时间", "type": "datetime", "width": 160},
|
|
{"name": "sync_version", "title": "同步版本", "type": "string", "width": 100},
|
|
{"name": "sync_status", "title": "同步状态", "type": "select", "width": 80, "options": [{"value": "success", "label": "成功"}, {"value": "pending", "label": "待同步"}, {"value": "failed", "label": "失败"}]},
|
|
{"name": "error_msg", "title": "错误信息", "type": "text", "width": 200},
|
|
{"name": "retry_count", "title": "重试次数", "type": "int", "width": 70, "align": "right"},
|
|
{"name": "created_at", "title": "创建时间", "type": "datetime", "width": 160, "readonly": true},
|
|
{"name": "updated_at", "title": "更新时间", "type": "datetime", "width": 160, "readonly": true}
|
|
],
|
|
"list": {
|
|
"columns": ["entity_type", "entity_id", "sync_status", "last_sync_time", "retry_count", "updated_at"],
|
|
"filters": [
|
|
{"field": "entity_type", "type": "select", "label": "实体类型", "options": [{"value": "", "label": "全部"}, {"value": "users", "label": "用户"}, {"value": "pricing", "label": "定价"}, {"value": "uapi", "label": "UAPI"}, {"value": "llmage", "label": "LLMage"}]},
|
|
{"field": "sync_status", "type": "select", "label": "状态", "options": [{"value": "", "label": "全部"}, {"value": "success", "label": "成功"}, {"value": "pending", "label": "待同步"}, {"value": "failed", "label": "失败"}]}
|
|
],
|
|
"sort": {"field": "updated_at", "order": "desc"}
|
|
},
|
|
"view": {"fields": ["id", "entity_type", "entity_id", "last_sync_time", "sync_version", "sync_status", "error_msg", "retry_count", "created_at", "updated_at"]},
|
|
"create": {"enabled": false},
|
|
"update": {
|
|
"enabled": true,
|
|
"fields": ["sync_status", "retry_count"]
|
|
},
|
|
"delete": {"enabled": false}
|
|
}
|
|
}
|