pipeline-sdlc/wwwroot/api/sd_proj_delete.dspy

15 lines
737 B
Plaintext

user_id = await get_user()
if not user_id:
return {"widgettype":"Error","options":{"title":"操作失败","message":'未登录',"cwidth":16,"cheight":9,"timeout":3}}
rec_id = params_kw.get('id', '')
if not rec_id:
return {"widgettype":"Error","options":{"title":"操作失败","message":'缺少id',"cwidth":16,"cheight":9,"timeout":3}}
try:
async with get_sor_context(request._run_ns, 'pipeline') as sor:
await sor.D('sd_projects', {'id': rec_id})
return {"widgettype":"Message","options":{"title":"操作成功","message":"ok","cwidth":16,"cheight":9,"timeout":3}}
except Exception as e:
return {"widgettype":"Error","options":{"title":"操作失败","message":str(e),"cwidth":16,"cheight":9,"timeout":3}}