kboss/b/product/add_user_inquiry.dspy
2025-08-14 17:15:44 +08:00

32 lines
1002 B
Plaintext

async def add_user_inquiry(ns={}):
if not ns.get('url_link'):
return {
'status': False,
'msg': '请传递url_link'
}
domain_name = ns.get('url_link').split("//")[1].split("/")[0]
if 'localhost' in domain_name:
domain_name = 'dev.opencomputing.cn'
db = DBPools()
async with db.sqlorContext('kboss') as sor:
ns_c = {
'id': uuid(),
'domain_name': domain_name,
'publish_type': ns.get('publish_type'),
'relate_id': ns.get('relate_id'),
'content': ns.get('content'),
'custom_type': ns.get('custom_type'),
'name': ns.get('name'),
'phone': ns.get('phone'),
'company': ns.get('company'),
'email': ns.get('email')
}
await sor.C('product_inquiry', ns_c)
return {
'status': True,
'msg': 'create success'
}
ret = await add_user_inquiry(params_kw)
return ret