updte
This commit is contained in:
parent
4af3ff5000
commit
f2b432df51
@ -19,7 +19,8 @@ async def sync_model_to_llm(ns={}):
|
|||||||
}
|
}
|
||||||
domain = domain_li[0]['pvalue']
|
domain = domain_li[0]['pvalue']
|
||||||
bearer_token = user_key[0]['pvalue']
|
bearer_token = user_key[0]['pvalue']
|
||||||
sync_orgid = await get_sync_orgid(sor)
|
# sync_orgid = await get_sync_orgid(sor)
|
||||||
|
sync_orgid = "mIWUHBeeDM8mwAFPIQ8pS" # 固定写
|
||||||
if not sync_orgid:
|
if not sync_orgid:
|
||||||
return {
|
return {
|
||||||
'status': False,
|
'status': False,
|
||||||
@ -63,11 +64,17 @@ async def sync_model_to_llm(ns={}):
|
|||||||
'appid': item.get('upappid') or '',
|
'appid': item.get('upappid') or '',
|
||||||
'providerkey': provider_orgcode,
|
'providerkey': provider_orgcode,
|
||||||
'state': '1',
|
'state': '1',
|
||||||
'start_date': item.get('enabled_date'),
|
'start_date': '2026-07-01',
|
||||||
'end_date': item.get('expired_date') or '9999-12-31',
|
'end_date': '9999-12-31',
|
||||||
'salemode': ns.get('salemode') or '0',
|
'settle_flowid': '0',
|
||||||
'settle_mode': ns.get('settle_mode') or '0',
|
'salemode': '0',
|
||||||
'settle_datep': ns.get('settle_datep')
|
'settle_mode': '3',
|
||||||
|
'settle_datep': 'M00',
|
||||||
|
'contactor': '连战',
|
||||||
|
'contactor_phone': '13800138000',
|
||||||
|
'emailaddress': 'lianzhan@cntoai.com',
|
||||||
|
'address': '北京市海淀区',
|
||||||
|
'org_type': '4'
|
||||||
}
|
}
|
||||||
provider_res = await path_call('../provider/providerAdd.dspy', provider_ns)
|
provider_res = await path_call('../provider/providerAdd.dspy', provider_ns)
|
||||||
if not provider_res.get('status'):
|
if not provider_res.get('status'):
|
||||||
@ -89,17 +96,14 @@ async def sync_model_to_llm(ns={}):
|
|||||||
'providerpid': item.get('id'),
|
'providerpid': item.get('id'),
|
||||||
'protocolid': protocolid,
|
'protocolid': protocolid,
|
||||||
'name': item.get('name'),
|
'name': item.get('name'),
|
||||||
'description': item.get('description'),
|
|
||||||
'ptype': item.get('catelogname') or category_list.get('catelogname') or '',
|
|
||||||
'state': '1',
|
|
||||||
'product_code': item.get('model'),
|
'product_code': item.get('model'),
|
||||||
'reseller_orgid': sync_orgid,
|
'reseller_orgid': sync_orgid,
|
||||||
'salemode': ns.get('salemode') or '0',
|
|
||||||
'productgroup': item.get('catelog_id') or item.get('catelogid') or category_list.get('catelogid'),
|
|
||||||
'label': item.get('catelogname') or category_list.get('catelogname'),
|
'label': item.get('catelogname') or category_list.get('catelogname'),
|
||||||
'unit': ns.get('unit'),
|
'classify': 'A',
|
||||||
'discount': ns.get('discount'),
|
'ptype': '21',
|
||||||
'floorprice': ns.get('floorprice')
|
'unit': 'hour',
|
||||||
|
'discount': '1',
|
||||||
|
'product_area': '北京'
|
||||||
}
|
}
|
||||||
product_res = await path_call('../product/productAdd.dspy', product_ns)
|
product_res = await path_call('../product/productAdd.dspy', product_ns)
|
||||||
if not product_res.get('status'):
|
if not product_res.get('status'):
|
||||||
@ -112,23 +116,33 @@ async def sync_model_to_llm(ns={}):
|
|||||||
# 查找数据库中是否已经存在,不存在就插入
|
# 查找数据库中是否已经存在,不存在就插入
|
||||||
exist_llm = await sor.R('llm', {'model': item.get('model')})
|
exist_llm = await sor.R('llm', {'model': item.get('model')})
|
||||||
if exist_llm:
|
if exist_llm:
|
||||||
|
# 更新
|
||||||
|
exits_id = exist_llm[0].get('id')
|
||||||
|
await sor.U('llm', {'id': exits_id}, item)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
new_llms = {
|
new_llms = {
|
||||||
'id': item.get('id'),
|
'id': item.get('id'),
|
||||||
'name': item.get('name'),
|
'name': item.get('name'),
|
||||||
'model': item.get('model'),
|
'model': item.get('model'),
|
||||||
'description': item.get('description'),
|
'description': item.get('description'),
|
||||||
'llmcatelogid': item.get('catelog_id') or item.get('catelogid'),
|
|
||||||
'iconid': item.get('iconid'),
|
'iconid': item.get('iconid'),
|
||||||
'upappid': item.get('upappid'),
|
'upappid': item.get('upappid'),
|
||||||
'apiname': item.get('apiname'),
|
'providerid': item.get('providerid'),
|
||||||
'providerid': provider_orgid,
|
'ownerid': item.get('ownerid'),
|
||||||
'ownerid': item.get('ownerid') or '0',
|
|
||||||
'enabled_date': item.get('enabled_date'),
|
'enabled_date': item.get('enabled_date'),
|
||||||
'expired_date': item.get('expired_date'),
|
'expired_date': item.get('expired_date'),
|
||||||
'query_apiname': item.get('query_apiname') or '',
|
'min_balance': item.get('min_balance'),
|
||||||
|
'status': item.get('status'),
|
||||||
|
'catelogname': item.get('catelogname'),
|
||||||
|
'catelog_id': item.get('catelog_id'),
|
||||||
|
'apiname': item.get('apiname'),
|
||||||
|
'query_apiname': item.get('query_apiname'),
|
||||||
'query_period': item.get('query_period'),
|
'query_period': item.get('query_period'),
|
||||||
'ppid': protocolid,
|
'ppid': item.get('ppid'),
|
||||||
|
'provider_name': item.get('provider_name'),
|
||||||
|
'pricing_display': item.get('pricing_display'),
|
||||||
|
'provider_iconurl': item.get('provider_iconurl')
|
||||||
}
|
}
|
||||||
new_llms_count += 1
|
new_llms_count += 1
|
||||||
new_llms_list.append(new_llms.get('model'))
|
new_llms_list.append(new_llms.get('model'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user