refactor(models): convert to json format per database-table-definition-spec

This commit is contained in:
yumoqing 2026-05-27 13:23:28 +08:00
parent 59d3c406ab
commit d44c2dae74
3 changed files with 50 additions and 27 deletions

View File

@ -72,7 +72,8 @@
"title": "最低余额", "title": "最低余额",
"type": "float", "type": "float",
"length": 20, "length": 20,
"default": 10 "default": 10,
"dec": 2
} }
], ],
"codes": [ "codes": [
@ -101,4 +102,4 @@
"textfield": "orgname" "textfield": "orgname"
} }
] ]
} }

View File

@ -4,81 +4,99 @@
{ {
"name": "llm_api_map", "name": "llm_api_map",
"title": "模型API映射表", "title": "模型API映射表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
"fields": [ "fields": [
{ {
"name": "id", "name": "id",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"title": "主键ID" "title": "主键ID",
"length": 32
}, },
{ {
"name": "llmid", "name": "llmid",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"title": "模型ID" "title": "模型ID",
"length": 32
}, },
{ {
"name": "llmcatelogid", "name": "llmcatelogid",
"type": "varchar(32)", "type": "str",
"not_null": true, "not_null": true,
"title": "模型分类ID" "title": "模型分类ID",
"length": 32
}, },
{ {
"name": "apiname", "name": "apiname",
"type": "varchar(100)", "type": "str",
"not_null": true, "not_null": true,
"title": "接口名称" "title": "接口名称",
"length": 100
}, },
{ {
"name": "query_apiname", "name": "query_apiname",
"type": "varchar(100)", "type": "str",
"title": "任务结果查询接口名称" "title": "任务结果查询接口名称",
"length": 100
}, },
{ {
"name": "query_period", "name": "query_period",
"type": "bigint", "type": "long",
"default": 30, "default": 30,
"title": "任务查询间隔(秒)" "title": "任务查询间隔(秒)"
}, },
{ {
"name": "ppid", "name": "ppid",
"type": "varchar(32)", "type": "str",
"title": "定价ID" "title": "定价ID",
"length": 32
}, },
{ {
"name": "isdefaultcatelog", "name": "isdefaultcatelog",
"type": "varchar(1)", "type": "str",
"not_null": true, "not_null": true,
"title": "缺省分类" "title": "缺省分类",
"length": 1
} }
], ],
"indexes": [ "indexes": [
{ {
"name": "idx_api_map_llmid", "name": "idx_api_map_llmid",
"type": "normal", "type": "normal",
"idxfields": ["llmid"], "idxfields": [
"llmid"
],
"idxtype": "index" "idxtype": "index"
}, },
{ {
"name": "idx_api_map_catelog", "name": "idx_api_map_catelog",
"type": "normal", "type": "normal",
"idxfields": ["llmcatelogid"], "idxfields": [
"llmcatelogid"
],
"idxtype": "index" "idxtype": "index"
}, },
{ {
"name": "idx_api_map_apiname", "name": "idx_api_map_apiname",
"type": "normal", "type": "normal",
"idxfields": ["apiname"], "idxfields": [
"apiname"
],
"idxtype": "index" "idxtype": "index"
}, },
{ {
"name": "uk_llmid_apiname", "name": "uk_llmid_apiname",
"type": "unique", "type": "unique",
"idxfields": ["llmid", "apiname"], "idxfields": [
"llmid",
"apiname"
],
"idxtype": "unique" "idxtype": "unique"
} }
], ],
@ -102,4 +120,4 @@
"textfield": "name" "textfield": "name"
} }
] ]
} }

View File

@ -58,13 +58,15 @@
"name": "responsed_seconds", "name": "responsed_seconds",
"title": "响应时间", "title": "响应时间",
"type": "float", "type": "float",
"length": 18 "length": 18,
"dec": 2
}, },
{ {
"name": "finish_seconds", "name": "finish_seconds",
"title": "结束时间", "title": "结束时间",
"type": "float", "type": "float",
"length": 18 "length": 18,
"dec": 2
}, },
{ {
"name": "status", "name": "status",
@ -82,13 +84,15 @@
"name": "amount", "name": "amount",
"title": "交易金额", "title": "交易金额",
"type": "float", "type": "float",
"length": 18 "length": 18,
"dec": 2
}, },
{ {
"name": "cost", "name": "cost",
"title": "交易成本", "title": "交易成本",
"type": "float", "type": "float",
"length": 18 "length": 18,
"dec": 2
}, },
{ {
"name": "userorgid", "name": "userorgid",