From eaf440a6a9eca7983721c4b6605ebe59ec977199 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 17 Jun 2026 18:04:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0llmage=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=AD=97=E5=85=B8init/data.json=EF=BC=8CCRUD=20alters?= =?UTF-8?q?=E6=94=B9=E7=94=A8appcodes=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init/data.json | 47 ++++++++++++++++++++++++++++ json/llm.json | 8 ++--- json/llm_api_map.json | 6 ++++ json/llmusage.json | 15 ++++++++- json/llmusage_accounting_failed.json | 7 ++--- json/llmusage_history.json | 15 ++++++++- 6 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 init/data.json diff --git a/init/data.json b/init/data.json new file mode 100644 index 0000000..b9bc54f --- /dev/null +++ b/init/data.json @@ -0,0 +1,47 @@ +{ + "appcodes": [ + { + "id": "llm_status", + "name": "模型上架状态", + "hierarchy_flg": "0" + }, + { + "id": "llmusage_status", + "name": "调用状态", + "hierarchy_flg": "0" + }, + { + "id": "accounting_status", + "name": "记账状态", + "hierarchy_flg": "0" + }, + { + "id": "handled_flg", + "name": "是否已处理", + "hierarchy_flg": "0" + }, + { + "id": "isdefaultcatelog_flg", + "name": "是否缺省分类", + "hierarchy_flg": "0" + } + ], + "appcodes_kv": [ + {"id": "llm_status_published", "parentid": "llm_status", "k": "published", "v": "已上架"}, + {"id": "llm_status_unpublished", "parentid": "llm_status", "k": "unpublished", "v": "已下架"}, + + {"id": "llmusage_status_succeeded", "parentid": "llmusage_status", "k": "SUCCEEDED", "v": "成功"}, + {"id": "llmusage_status_failed", "parentid": "llmusage_status", "k": "FAILED", "v": "失败"}, + {"id": "llmusage_status_unknown", "parentid": "llmusage_status", "k": "UNKNOWN", "v": "未知"}, + + {"id": "accounting_status_created", "parentid": "accounting_status", "k": "created", "v": "待记账"}, + {"id": "accounting_status_accounted", "parentid": "accounting_status", "k": "accounted", "v": "已记账"}, + {"id": "accounting_status_failed", "parentid": "accounting_status", "k": "failed", "v": "记账失败"}, + + {"id": "handled_flg_0", "parentid": "handled_flg", "k": "0", "v": "未处理"}, + {"id": "handled_flg_1", "parentid": "handled_flg", "k": "1", "v": "已处理"}, + + {"id": "isdefaultcatelog_flg_0", "parentid": "isdefaultcatelog_flg", "k": "0", "v": "否"}, + {"id": "isdefaultcatelog_flg_1", "parentid": "isdefaultcatelog_flg", "k": "1", "v": "是"} + ] +} diff --git a/json/llm.json b/json/llm.json index e8e1e67..7ec904f 100644 --- a/json/llm.json +++ b/json/llm.json @@ -25,11 +25,9 @@ "alters": { "status": { "uitype": "code", - "data": [ - {"value": "", "text": "全部"}, - {"value": "published", "text": "已上架"}, - {"value": "unpublished", "text": "已下架"} - ] + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=llm_status", + "valueField": "k", + "textField": "v" }, "ppid":{ "dataurl":"{{entire_url('/pricing/get_all_pricing_programs.dspy')}}", diff --git a/json/llm_api_map.json b/json/llm_api_map.json index c221c85..38fd709 100644 --- a/json/llm_api_map.json +++ b/json/llm_api_map.json @@ -16,6 +16,12 @@ "dataurl": "{{entire_url('../api/get_search_apiname.dspy?allow_empty=1')}}?llmid={{params_kw.llmid}}", "valueField": "apiname", "textField": "apiname_text" + }, + "isdefaultcatelog": { + "uitype": "code", + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=isdefaultcatelog_flg", + "valueField": "k", + "textField": "v" } } }, diff --git a/json/llmusage.json b/json/llmusage.json index b263aa8..833bdcb 100644 --- a/json/llmusage.json +++ b/json/llmusage.json @@ -5,7 +5,20 @@ "sortby": "use_time desc", "browserfields": { "exclouded": ["id"], - "alters": {} + "alters": { + "status": { + "uitype": "code", + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=llmusage_status", + "valueField": "k", + "textField": "v" + }, + "accounting_status": { + "uitype": "code", + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=accounting_status", + "valueField": "k", + "textField": "v" + } + } }, "editexclouded": ["id"], "editable": { diff --git a/json/llmusage_accounting_failed.json b/json/llmusage_accounting_failed.json index be68369..156a0cd 100644 --- a/json/llmusage_accounting_failed.json +++ b/json/llmusage_accounting_failed.json @@ -8,10 +8,9 @@ "alters": { "handled": { "uitype": "code", - "data": [ - {"value": "0", "text": "未处理"}, - {"value": "1", "text": "已处理"} - ] + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=handled_flg", + "valueField": "k", + "textField": "v" } } }, diff --git a/json/llmusage_history.json b/json/llmusage_history.json index 2224e81..b267024 100644 --- a/json/llmusage_history.json +++ b/json/llmusage_history.json @@ -5,7 +5,20 @@ "sortby": "use_time desc", "browserfields": { "exclouded": ["id"], - "alters": {} + "alters": { + "status": { + "uitype": "code", + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=llmusage_status", + "valueField": "k", + "textField": "v" + }, + "accounting_status": { + "uitype": "code", + "dataurl": "{{entire_url('/appbase/get_appcodes_kv.dspy')}}?parentid=accounting_status", + "valueField": "k", + "textField": "v" + } + } }, "editexclouded": ["id"], "editable": {