kboss/b/cntoai/model_management_unlist.dspy
2026-05-20 19:10:26 +08:00

25 lines
869 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

def _escape(value):
if value is None:
return None
return str(value).replace("'", "''")
async def model_management_unlist(ns={}):
"""下架listing_status 置为 0统计归入待上架"""
model_id = ns.get('id')
if not model_id:
return {'status': False, 'msg': 'id is required'}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
update_sql = """
UPDATE model_management SET listing_status = 0 WHERE id = '%s';
""" % _escape(model_id)
await sor.sqlExe(update_sql, {})
return {'status': True, 'msg': 'model unlisted success'}
except Exception as e:
await sor.rollback()
return {'status': False, 'msg': 'model unlist failed, %s' % str(e)}
ret = await model_management_unlist(params_kw)
return ret