This commit is contained in:
yumoqing 2024-03-19 15:09:58 +08:00
parent 11cd2e150d
commit b91704a695
3 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,27 @@
print(params_kw, 'delete_code.dspy')
ns = {
'id':params_kw['id'],
'del_flg':'1'
}
dbname = get_definition('codesdb')
db = DBPools()
async with db.sqlorContext(dbname) as sor:
r = await sor.U('appcodes', ns)
print('delete success');
return {
"widgettype":"Message",
"options":{
"title":"Delete Success",
"message":"ok"
}
}
print('Delete failed');
return {
"widgettype":"Error",
"options":{
"title":"Delete Error",
"message":"failed"
}
}

View File

@ -0,0 +1,28 @@
print(params_kw, 'delete_code.dspy')
ns = {
'id':params_kw['id'],
'del_flg':'1'
}
dbname = get_definition('codesdb')
db = DBPools()
async with db.sqlorContext(dbname) as sor:
r = await sor.U('appcodes_kv', ns)
print('delete success');
return {
"widgettype":"Message",
"options":{
"title":"Delete Success",
"message":"ok"
}
}
print('Delete failed');
return {
"widgettype":"Error",
"options":{
"title":"Delete Error",
"message":"failed"
}
}

View File

@ -0,0 +1,24 @@
print(params_kw, 'update_kv.dspy')
ns = params_kw.copy()
dbname = get_definition('codesdb')
db = DBPools()
async with db.sqlorContext(dbname) as sor:
r = await sor.U('appcodes_kv', ns)
print('update success');
return {
"widgettype":"Message",
"options":{
"title":"Update Success",
"message":"ok"
}
}
print('update failed');
return {
"widgettype":"Error",
"options":{
"title":"Update Error",
"message":"failed"
}
}