diff --git a/reallife_asset.egg-info/PKG-INFO b/reallife_asset.egg-info/PKG-INFO new file mode 100644 index 0000000..cd88a1b --- /dev/null +++ b/reallife_asset.egg-info/PKG-INFO @@ -0,0 +1,7 @@ +Metadata-Version: 2.4 +Name: reallife_asset +Version: 1.0.0 +Summary: Real Person Portrait Asset Management Module - supports multiple vendors (Volcengine Ark, etc.) +Requires-Python: >=3.8 +Requires-Dist: sqlor +Requires-Dist: bricks_for_python diff --git a/reallife_asset.egg-info/SOURCES.txt b/reallife_asset.egg-info/SOURCES.txt new file mode 100644 index 0000000..a516437 --- /dev/null +++ b/reallife_asset.egg-info/SOURCES.txt @@ -0,0 +1,11 @@ +README.md +pyproject.toml +reallife_asset/__init__.py +reallife_asset/init.py +reallife_asset/rl_volcengine_client.py +reallife_asset/volcengine_client.py +reallife_asset.egg-info/PKG-INFO +reallife_asset.egg-info/SOURCES.txt +reallife_asset.egg-info/dependency_links.txt +reallife_asset.egg-info/requires.txt +reallife_asset.egg-info/top_level.txt \ No newline at end of file diff --git a/reallife_asset.egg-info/dependency_links.txt b/reallife_asset.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/reallife_asset.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/reallife_asset.egg-info/requires.txt b/reallife_asset.egg-info/requires.txt new file mode 100644 index 0000000..3f3a3f3 --- /dev/null +++ b/reallife_asset.egg-info/requires.txt @@ -0,0 +1,2 @@ +sqlor +bricks_for_python diff --git a/reallife_asset.egg-info/top_level.txt b/reallife_asset.egg-info/top_level.txt new file mode 100644 index 0000000..c323353 --- /dev/null +++ b/reallife_asset.egg-info/top_level.txt @@ -0,0 +1 @@ +reallife_asset diff --git a/reallife_asset/__pycache__/__init__.cpython-310.pyc b/reallife_asset/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..3898b4d Binary files /dev/null and b/reallife_asset/__pycache__/__init__.cpython-310.pyc differ diff --git a/reallife_asset/__pycache__/init.cpython-310.pyc b/reallife_asset/__pycache__/init.cpython-310.pyc new file mode 100644 index 0000000..eac77c1 Binary files /dev/null and b/reallife_asset/__pycache__/init.cpython-310.pyc differ diff --git a/reallife_asset/__pycache__/rl_volcengine_client.cpython-310.pyc b/reallife_asset/__pycache__/rl_volcengine_client.cpython-310.pyc new file mode 100644 index 0000000..aa02bac Binary files /dev/null and b/reallife_asset/__pycache__/rl_volcengine_client.cpython-310.pyc differ diff --git a/scripts/__pycache__/load_path.cpython-310.pyc b/scripts/__pycache__/load_path.cpython-310.pyc new file mode 100644 index 0000000..423b9c1 Binary files /dev/null and b/scripts/__pycache__/load_path.cpython-310.pyc differ diff --git a/wwwroot/api/rl_asset_create.dspy b/wwwroot/api/rl_asset_create.dspy index 33ea07e..3fa994e 100644 --- a/wwwroot/api/rl_asset_create.dspy +++ b/wwwroot/api/rl_asset_create.dspy @@ -16,10 +16,10 @@ result = await rl_create_asset( user_id=user_id ) -return json.dumps({ +return { "widgettype": "Message", "options": { "message": f"素材上传已提交: {result.get('vendor_asset_id', '')}" if result.get('success') else result.get('message', '上传失败'), "type": "success" if result.get('success') else "error" } -}) +} diff --git a/wwwroot/api/rl_asset_delete.dspy b/wwwroot/api/rl_asset_delete.dspy index f6ea927..2faac01 100644 --- a/wwwroot/api/rl_asset_delete.dspy +++ b/wwwroot/api/rl_asset_delete.dspy @@ -6,10 +6,10 @@ if not rid: result = await rl_delete_asset(rid) -return json.dumps({ +return { "widgettype": "Message", "options": { "message": "删除成功" if result.get("success") else result.get("message", "删除失败"), "type": "success" if result.get("success") else "error" } -}) +} diff --git a/wwwroot/api/rl_asset_group_create.dspy b/wwwroot/api/rl_asset_group_create.dspy index f721435..275c91a 100644 --- a/wwwroot/api/rl_asset_group_create.dspy +++ b/wwwroot/api/rl_asset_group_create.dspy @@ -14,10 +14,10 @@ result = await rl_create_validate_session( user_id=user_id ) -return json.dumps({ +return { "widgettype": "Message", "options": { "message": f"认证链接已生成: {result.get('h5_link', '')}", "type": "success" if result.get('success') else "error" } -}) +} diff --git a/wwwroot/api/rl_asset_group_delete.dspy b/wwwroot/api/rl_asset_group_delete.dspy index 25b2646..951800b 100644 --- a/wwwroot/api/rl_asset_group_delete.dspy +++ b/wwwroot/api/rl_asset_group_delete.dspy @@ -6,10 +6,10 @@ if not rid: result = await rl_delete_group(rid) -return json.dumps({ +return { "widgettype": "Message", "options": { "message": "删除成功" if result.get("success") else result.get("message", "删除失败"), "type": "success" if result.get("success") else "error" } -}) +} diff --git a/wwwroot/api/rl_asset_group_update.dspy b/wwwroot/api/rl_asset_group_update.dspy index 211eb5a..86c3fc2 100644 --- a/wwwroot/api/rl_asset_group_update.dspy +++ b/wwwroot/api/rl_asset_group_update.dspy @@ -5,11 +5,11 @@ now = datetime.now().strftime("%Y-%m-%d %H:%M:%S") dbname = get_module_dbname('reallife_asset') db = DBPools() async with db.sqlorContext(dbname) as sor: - upd = {"update_time": now} + upd = {"update_time": now, "id": rid} for f in ['name', 'title', 'description', 'status']: v = params_kw.get(f) if v is not None: upd[f] = v - await sor.U("rl_asset_group", {**upd, "id": rid}) + await sor.U("rl_asset_group", upd) -return {"success": True, "message": "更新成功"} +return {"widgettype":"Message","options":{"title":"更新成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} diff --git a/wwwroot/api/rl_asset_update.dspy b/wwwroot/api/rl_asset_update.dspy index 0daf634..9ecf376 100644 --- a/wwwroot/api/rl_asset_update.dspy +++ b/wwwroot/api/rl_asset_update.dspy @@ -5,11 +5,11 @@ now = datetime.now().strftime("%Y-%m-%d %H:%M:%S") dbname = get_module_dbname('reallife_asset') db = DBPools() async with db.sqlorContext(dbname) as sor: - upd = {"update_time": now} + upd = {"update_time": now, "id": rid, "org_id": org_id} for f in ['name', 'status']: v = params_kw.get(f) if v is not None: upd[f] = v - await sor.U("rl_asset", upd, {"id": rid, "org_id": org_id}) + await sor.U("rl_asset", upd) -return {"success": True, "message": "更新成功"} +return {"widgettype":"Message","options":{"title":"更新成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} diff --git a/wwwroot/api/rl_org_group_create.dspy b/wwwroot/api/rl_org_group_create.dspy index 6396cfb..3f363fb 100644 --- a/wwwroot/api/rl_org_group_create.dspy +++ b/wwwroot/api/rl_org_group_create.dspy @@ -17,4 +17,4 @@ dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: await sor.I("rl_org_group", data) -return {"success": True, "id": id} +return {"widgettype":"Message","options":{"title":"创建成功","message":"ok","cwidth":16,"cheight":9,"timeout":3,"user_data": data}} diff --git a/wwwroot/api/rl_org_group_delete.dspy b/wwwroot/api/rl_org_group_delete.dspy index f53b58c..77bc778 100644 --- a/wwwroot/api/rl_org_group_delete.dspy +++ b/wwwroot/api/rl_org_group_delete.dspy @@ -1,9 +1,10 @@ id = params_kw.get('id', '') -if not id: return {"success": False, "message": "id required"} +if not id: + return {"widgettype":"Error","options":{"title":"删除失败","message":"id required","cwidth":16,"cheight":9,"timeout":3}} db = DBPools() dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: await sor.D("rl_org_group", {"id": id}) -return {"success": True} +return {"widgettype":"Message","options":{"title":"删除成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} diff --git a/wwwroot/api/rl_org_group_update.dspy b/wwwroot/api/rl_org_group_update.dspy index 9ae279c..69be448 100644 --- a/wwwroot/api/rl_org_group_update.dspy +++ b/wwwroot/api/rl_org_group_update.dspy @@ -1,11 +1,13 @@ id = params_kw.get('id', '') -if not id: return {"success": False, "message": "id required"} +if not id: + return {"widgettype":"Error","options":{"title":"更新失败","message":"id required","cwidth":16,"cheight":9,"timeout":3}} db = DBPools() dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: recs = await sor.R("rl_org_group", {"id": id}) - if not recs: return {"success": False, "message": "Not found"} + if not recs: + return {"widgettype":"Error","options":{"title":"更新失败","message":"Not found","cwidth":16,"cheight":9,"timeout":3}} upd = {} for k in ['status', 'vendor_group_id', 'local_group_id', 'vendor']: @@ -15,4 +17,4 @@ for k in ['status', 'vendor_group_id', 'local_group_id', 'vendor']: async with db.sqlorContext(dbname) as sor: await sor.U("rl_org_group", {**upd, "id": id}) -return {"success": True} +return {"widgettype":"Message","options":{"title":"更新成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} diff --git a/wwwroot/api/rl_vendor_config_create.dspy b/wwwroot/api/rl_vendor_config_create.dspy index 0cc77b0..9547500 100644 --- a/wwwroot/api/rl_vendor_config_create.dspy +++ b/wwwroot/api/rl_vendor_config_create.dspy @@ -7,16 +7,15 @@ upappid = params_kw.get('upappid', '') api_mapping = params_kw.get('api_mapping', '{}') if not vendor: - return {"success": False, "message": "供应商标识不能为空"} + return {"widgettype":"Error","options":{"title":"创建失败","message":"供应商标识不能为空","cwidth":16,"cheight":9,"timeout":3}} if not upappid: - return {"success": False, "message": "上位系统ID不能为空"} + return {"widgettype":"Error","options":{"title":"创建失败","message":"上位系统ID不能为空","cwidth":16,"cheight":9,"timeout":3}} -# Validate api_mapping is valid JSON try: api_mapping_dict = json.loads(api_mapping) if api_mapping else {} api_mapping = json.dumps(api_mapping_dict, ensure_ascii=False) except json.JSONDecodeError: - return {"success": False, "message": "API映射必须是有效的JSON"} + return {"widgettype":"Error","options":{"title":"创建失败","message":"API映射必须是有效的JSON","cwidth":16,"cheight":9,"timeout":3}} data = { "id": id, @@ -36,4 +35,4 @@ dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: await sor.I("rl_vendor_config", data) -return {"success": True, "id": id} +return {"widgettype":"Message","options":{"title":"创建成功","message":"ok","cwidth":16,"cheight":9,"timeout":3,"user_data": data}} diff --git a/wwwroot/api/rl_vendor_config_delete.dspy b/wwwroot/api/rl_vendor_config_delete.dspy index efccae6..c7d4e80 100644 --- a/wwwroot/api/rl_vendor_config_delete.dspy +++ b/wwwroot/api/rl_vendor_config_delete.dspy @@ -1,9 +1,10 @@ id = params_kw.get('id', '') -if not id: return {"success": False, "message": "id required"} +if not id: + return {"widgettype":"Error","options":{"title":"删除失败","message":"id required","cwidth":16,"cheight":9,"timeout":3}} db = DBPools() dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: await sor.D("rl_vendor_config", {"id": id}) -return {"success": True} +return {"widgettype":"Message","options":{"title":"删除成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}} diff --git a/wwwroot/api/rl_vendor_config_update.dspy b/wwwroot/api/rl_vendor_config_update.dspy index 0b0d977..4204526 100644 --- a/wwwroot/api/rl_vendor_config_update.dspy +++ b/wwwroot/api/rl_vendor_config_update.dspy @@ -1,29 +1,30 @@ id = params_kw.get('id', '') -if not id: return {"success": False, "message": "id required"} +if not id: + return {"widgettype":"Error","options":{"title":"更新失败","message":"id required","cwidth":16,"cheight":9,"timeout":3}} db = DBPools() dbname = get_module_dbname('reallife_asset') async with db.sqlorContext(dbname) as sor: recs = await sor.R("rl_vendor_config", {"id": id}) - if not recs: return {"success": False, "message": "Not found"} + if not recs: + return {"widgettype":"Error","options":{"title":"更新失败","message":"Not found","cwidth":16,"cheight":9,"timeout":3}} upd = {} for k in ['status', 'callback_url', 'vendor', 'vendor_title', 'upappid']: if params_kw.get(k) is not None: upd[k] = params_kw.get(k) -# Update api_mapping if provided api_mapping = params_kw.get('api_mapping', None) if api_mapping is not None: try: api_mapping_dict = json.loads(api_mapping) if api_mapping else {} upd['api_mapping'] = json.dumps(api_mapping_dict, ensure_ascii=False) except json.JSONDecodeError: - return {"success": False, "message": "API映射必须是有效的JSON"} + return {"widgettype":"Error","options":{"title":"更新失败","message":"API映射必须是有效的JSON","cwidth":16,"cheight":9,"timeout":3}} upd['update_time'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") async with db.sqlorContext(dbname) as sor: await sor.U("rl_vendor_config", {**upd, "id": id}) -return {"success": True} +return {"widgettype":"Message","options":{"title":"更新成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}}