kboss/b/message/del_msg.dspy
2025-07-16 14:27:17 +08:00

24 lines
717 B
Plaintext

async def del_msg(ns={}):
"""
修改已读状态
传多个id
:param ns:
:return:
"""
id = ns.get('id', []) # 获取消息 ID 列表
db = DBPools()
try:
async with db.sqlorContext('kboss') as sor:
if id:
for ids in id:
ns['del_flg'] = '1'
ns['id'] = ids
result = await sor.U('message', ns) # 更新删除标志为已删除
return {'status': True, 'msg':'删除成功'}
return {'status': False, 'msg': '删除失败,未提供消息 ID'}
except Exception as e:
return {'status': False, 'msg': str(e)}
ret = await del_msg(params_kw)
return ret