diff --git a/b/ali/DescribeRegions.dspy b/b/ali/DescribeRegions.dspy index 0456c6b..d113422 100644 --- a/b/ali/DescribeRegions.dspy +++ b/b/ali/DescribeRegions.dspy @@ -73,7 +73,7 @@ class KYYAliECS: destination_resource=ns.get('destination_resource'), spot_duration=ns.get('spot_duration'), spot_strategy=ns.get('spot_strategy'), - instance_charge_type=ns.get('instance_charge_type') + #instance_charge_type=ns.get('instance_charge_type') ) runtime = util_models.RuntimeOptions() try: @@ -122,7 +122,7 @@ class KYYAliECS: minimum_baseline_credit=ns.get('minimum_baseline_credit'), minimum_initial_credit=ns.get('minimum_initial_credit'), max_results=ns.get('max_results'), - next_token=ns.get('next_token'), + #next_token=ns.get('next_token'), ) runtime = util_models.RuntimeOptions() try: diff --git a/b/baiduc/baidu_confirm_refund_order.dspy b/b/baiduc/baidu_confirm_refund_order.dspy index fb13695..42737c4 100644 --- a/b/baiduc/baidu_confirm_refund_order.dspy +++ b/b/baiduc/baidu_confirm_refund_order.dspy @@ -777,6 +777,7 @@ async def baidu_confirm_refund_order(ns={}): db = DBPools() async with db.sqlorContext('kboss') as sor: + orderss = (await sor.R('bz_order', {'orderid': ns.get('order_id')}))[1] users = await sor.R('baidu_users', {'user_id': ns['userid']}) ns['baidu_id'] = users[0]['baidu_id'] if users else None if not ns['baidu_id']: @@ -794,6 +795,7 @@ async def baidu_confirm_refund_order(ns={}): db = DBPools() async with db.sqlorContext('kboss') as sor: refund_status_li = await sor.R('baidu_orders', {'orderid': order_id}) + refund_status_li_info = await sor.R('baidu_orders', {'orderid': order_id})[2] refundstatus = refund_status_li[0]['refundstatus'] refund_id = refund_status_li[0]['id'] @@ -879,7 +881,7 @@ async def baidu_confirm_refund_order(ns={}): # 分割 # 增加延迟 - await asyncio.sleep(5) + await asyncio.sleep(10) # 把 NEED_CONFIRM的本地库改为CREATED await update_baidu_order_list({'userid': ns.get('userid')}) diff --git a/b/baiduc/baidu_users_get_post_pay.dspy b/b/baiduc/baidu_users_get_post_pay.dspy index 6820347..e699c56 100644 --- a/b/baiduc/baidu_users_get_post_pay.dspy +++ b/b/baiduc/baidu_users_get_post_pay.dspy @@ -652,7 +652,7 @@ async def baidu_users_get_post_pay(ns={}): # if baidu_id != 'f61b662bcd684499b6403371365715b9': # continue try: - user_orgid = (await sor.R('users', {'id': userid}))[0]['orgid'] + user_orgid = (await sor.R('users', {'id': userid}))[0]['orgid'][1] user_parentid = (await sor.R('organization', {'id': user_orgid}))[0]['parentid'] await get_resourcechargeitem_billlist(userid=userid, baidu_id=baidu_id, user_orgid=user_orgid, user_parentid=user_parentid, pageno=1, sor=sor) except Exception as e: diff --git a/b/baiduc/baidu_confirm_auto_renew_order.dspy b/b/baiduc/info_test_.dspy similarity index 99% rename from b/baiduc/baidu_confirm_auto_renew_order.dspy rename to b/baiduc/info_test_.dspy index 2f22643..50bf764 100644 --- a/b/baiduc/baidu_confirm_auto_renew_order.dspy +++ b/b/baiduc/info_test_.dspy @@ -1,3 +1,4 @@ +# 弃用接口 不再读取整个文件逻辑 async def user_action_record(ns={}): ns_dic = { 'id': uuid(), @@ -777,7 +778,8 @@ async def update_baidu_order_list(ns={}): } } -async def baidu_confirm_auto_renew_order(ns={}): +async def info_test_(ns={}): + # 弃用接口 不再读取整个文件逻辑 if ns.get('domain_name'): orgid_li = await sor.R('reseller', {'domain_name': ns.get('domain_name'), 'del_flg': '0'}) orgid = orgid_li[0]['orgid'] @@ -811,7 +813,7 @@ async def baidu_confirm_auto_renew_order(ns={}): 'log_level': 'ERROR', 'log_content': '续费订单 %s 失败 %s' % (order_id, str(renew_status)), 'user_id': user_id, - 'request_url': '/baiduc/baidu_confirm_auto_renew_order.dspy' + 'request_url': '/baiduc/info_test_.dspy' } await sor.C('warn_error_log', ns_err_log) @@ -830,5 +832,5 @@ async def baidu_confirm_auto_renew_order(ns={}): } } -ret = await baidu_confirm_auto_renew_order(params_kw) +ret = await info_test_(params_kw) return ret \ No newline at end of file diff --git a/b/capital/change_ecs_name.dspy b/b/capital/change_ecs_name.dspy index 9da0230..4e9cf57 100644 --- a/b/capital/change_ecs_name.dspy +++ b/b/capital/change_ecs_name.dspy @@ -11,6 +11,8 @@ async def change_ecs_name(ns={}): "EcsId": ns.get("EcsId"), "Name": ns.get("Name") } + print(body) + print(get_signature(action, method, ecs_url, param)) url = get_signature(action, method, ecs_url, param) async with aiohttp.ClientSession() as session: async with session.request(method, url, json=body) as response: diff --git a/b/capital/delete_eip.dspy b/b/capital/delete_eip.dspy index e31a9a7..15b51c9 100644 --- a/b/capital/delete_eip.dspy +++ b/b/capital/delete_eip.dspy @@ -6,6 +6,10 @@ async def delete_eip(ns={}): param = {} url = get_signature(action, method, NETWORK_URL, param=param) body = {'EIPId': ns.get('EIPId')} + + print(body) + print(url) + async with aiohttp.ClientSession() as session: async with session.request(method, url, json=body) as response: resp = await response.text() diff --git a/b/capital/describe_eip.dspy b/b/capital/describe_eip.dspy index 77789f1..9e76ff4 100644 --- a/b/capital/describe_eip.dspy +++ b/b/capital/describe_eip.dspy @@ -28,6 +28,8 @@ async def describe_eip(ns={}): else: result['status'] = False result['msg'] = result.pop('Message') + print(result) + result['price'] = 0.001 return result ret = await describe_eip(params_kw) diff --git a/b/cntoai/model_management_pin_top.dspy b/b/cntoai/model_management_pin_top.dspy index 3a47250..44dc8e9 100644 --- a/b/cntoai/model_management_pin_top.dspy +++ b/b/cntoai/model_management_pin_top.dspy @@ -31,6 +31,12 @@ async def model_management_pin_top(ns={}): if current_order <= min_order: return {'status': True, 'msg': 'already at top', 'data': {'sort_order': current_order}} + if current_order == 'min_order': + return {'status': True, 'msg': 'already at top', 'data': {'sort_order': current_order}} + + if current_order == 'max_order': + return {'status': True, 'msg': 'already at bottom', 'data': {'sort_order': current_order}} + new_order = min_order - 1 update_sql = """ UPDATE model_management SET sort_order = %s WHERE id = '%s'; diff --git a/b/cntoai/test_chat.py b/b/cntoai/test_chat.py index 3432eac..962b55e 100644 --- a/b/cntoai/test_chat.py +++ b/b/cntoai/test_chat.py @@ -61,6 +61,18 @@ class ChatApiClient: path = path if path.startswith("/") else f"/{path}" return f"{self.base_url}{path}" + def _auth_headers(self, extra: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + if USERID: + headers["X-User-Id"] = USERID + if API_KEY: + headers["X-Api-Key"] = API_KEY + if API_URL: + headers["X-Api-Url"] = API_URL + if extra: + headers.update(extra) + return headers + def _auth(self, extra: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: params: Dict[str, Any] = {} if USERID: diff --git a/b/customer/addinvitecode.dspy b/b/customer/addinvitecode.dspy index 909e802..854cef5 100644 --- a/b/customer/addinvitecode.dspy +++ b/b/customer/addinvitecode.dspy @@ -2,6 +2,12 @@ async def addinvitecode(ns): """ 生成邀请码 """ + import datetime + + now = datetime.datetime.now() + start_of_day = now.replace(hour=0, minute=0, second=0, microsecond=0) + end_of_day = now.replace(hour=23, minute=59, second=59, microsecond=999999) + db = DBPools() async with db.sqlorContext('kboss') as sor: if ns['promotingid'] and ns['iusserid']: diff --git a/b/customer/get_customer_mailcode.dspy b/b/customer/get_customer_mailcode.dspy index ea25b28..f57534a 100644 --- a/b/customer/get_customer_mailcode.dspy +++ b/b/customer/get_customer_mailcode.dspy @@ -1,4 +1,11 @@ async def get_customer_mailcode(ns): + + import datetime + now = datetime.datetime.now() + + if now.hour < 10: + print('now.hour < 10') + db = DBPools() async with db.sqlorContext('kboss') as sor: user = await sor.R('users', {'id': ns.get('user_id')})