From 8fe844be4809c35fc2fe9c1798c6fdf646779010 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 20 May 2026 15:36:01 +0800 Subject: [PATCH] refactor: remove uapiset from sor_get_uapi() Remove uapiset intermediate table from JOIN chain. auth_apiname is now read directly from upapp table. Before: JOIN uapi a, upapp b, uapiset c WHERE b.apisetid = c.id After: JOIN uapi a, upapp b (auth_apiname from upapp) --- uapi/apidata.py | 5 ++--- uapi/appapi.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/uapi/apidata.py b/uapi/apidata.py index 8687fa6..2566cdf 100644 --- a/uapi/apidata.py +++ b/uapi/apidata.py @@ -25,10 +25,9 @@ async def get_deerer(upappid, callerid): async def sor_get_uapi(sor, upappid, apiname): sql = """select a.*, -c.auth_apiname -from uapi a, upapp b, uapiset c +b.auth_apiname +from uapi a, upapp b where a.apisetid = b.apisetid - and b.apisetid = c.id and a.name = ${apiname}$ and b.id = ${upappid}$""" recs = await sor.sqlExe(sql, {'upappid': upappid, 'apiname': apiname}) diff --git a/uapi/appapi.py b/uapi/appapi.py index 6d205cf..c860b8c 100644 --- a/uapi/appapi.py +++ b/uapi/appapi.py @@ -90,10 +90,9 @@ async def get_userapikey(sor, upappid, callerid): async def sor_get_uapi(sor, upappid, apiname): sql = """select a.*, -c.auth_apiname -from uapi a, upapp b, uapiset c +b.auth_apiname +from uapi a, upapp b where a.apisetid = b.apisetid - and b.apisetid = c.id and a.name = ${apiname}$ and b.id = ${upappid}$""" recs = await sor.sqlExe(sql, {'upappid': upappid, 'apiname': apiname})