From 3a33cca3c8c69427f185d58f65b21920e9e0391a Mon Sep 17 00:00:00 2001 From: yujj128 Date: Mon, 9 Jun 2025 18:33:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=A7=84=E8=8C=83=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E7=A7=9F=E6=88=B7id=E5=AD=97=E6=AE=B5=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=B8=BAtenantId+=E6=96=B0=E5=A2=9E=E7=AC=AC=E4=BA=8C=E4=B8=AA?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BC=9A=E8=AE=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + yj_room_agent/LLM/ai_service.py | 22 ++++++++++++++++++++++ yj_room_agent/tools/getinfo.py | 3 ++- yj_room_agent/urls.py | 1 + yj_room_agent/views.py | 25 +++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/.env b/.env index cb71cb6..8d6d794 100644 --- a/.env +++ b/.env @@ -25,5 +25,6 @@ QUERY_MEETING_ROOM = '/yonbip/uspace/external/access/getMeetingRoom' QUERY_MEETINGBOOKING_INFO = '/yonbip/uspace/external/access/getDestineInformation' BOOK_MEETING_ROOM = '/yonbip/uspace/destine/Meeting' CANCEL_MEETING = '/yonbip/uspace/cancel/Meeting' +CANCEL_MEETING2 = '/yonbip/uspace/external/access/cancel' BOOKMEETING = '/yonbip/uspace/external/access/book' EDIT_MEETING = '/yonbip/uspace/external/access/edit' diff --git a/yj_room_agent/LLM/ai_service.py b/yj_room_agent/LLM/ai_service.py index 1f46ef4..782cf70 100644 --- a/yj_room_agent/LLM/ai_service.py +++ b/yj_room_agent/LLM/ai_service.py @@ -216,6 +216,28 @@ def edit_meeting(params: dict, data: dict): print("content is :", content) return str(content) +''' +第二个会议取消接口 +''' +def cancel_meeting2(params: dict)->str: + """ + params{ + ytenantId + meetingId + } + :return: + """ + print("当前params : {0}".format(params)) + tenant_id = params.get('tenantId', None) + if not tenant_id: + raise Exception("tenantId 不能为空") + access_token = getinfo.get_access_token(tenant_id) + params['access_token'] = access_token + book_meeting = getinfo.cancel_meeting(params) + content = json.loads(json.dumps(book_meeting)) + print("content is :", content) + return str(content) + def check_and_process_think(content: str) -> str: filtered_text = re.sub(r"]*>.*?", '', content, flags=re.DOTALL) return filtered_text diff --git a/yj_room_agent/tools/getinfo.py b/yj_room_agent/tools/getinfo.py index 72c639d..2fe77e0 100644 --- a/yj_room_agent/tools/getinfo.py +++ b/yj_room_agent/tools/getinfo.py @@ -20,6 +20,7 @@ QUERY_MEETINGBOOKING_INFO = config('QUERY_MEETINGBOOKING_INFO', default="") BOOK_MEETING_ROOM = config('BOOK_MEETING_ROOM', default="") BOOKMEETING = config('BOOKMEETING', default="") CANCEL_MEETING = config('CANCEL_MEETING', default="") +CANCEL_MEETING2 = config('CANCEL_MEETING2', default="") EDIT_MEETING = config('EDIT_MEETING', default="") DEFAULT_HEADER = {'Content-Type': 'application/json'} @@ -236,7 +237,7 @@ def cancel_meeting(params:dict): print("now params ", params) print("tenant_id : ", tenant_id) gateway_url, token_url = get_domain({"tenantId": tenant_id}) - request_url = gateway_url + CANCEL_MEETING + request_url = gateway_url + CANCEL_MEETING2 print("request url ", request_url) print("paramas ", params) respones = requests.get(url=request_url, params=params, diff --git a/yj_room_agent/urls.py b/yj_room_agent/urls.py index 72eb14a..adb86d9 100644 --- a/yj_room_agent/urls.py +++ b/yj_room_agent/urls.py @@ -28,6 +28,7 @@ urlpatterns = [ path('bookMeetingRoom/', views.book_meeting_room), path('bookMeeting/', views.book_meeting), path('cancelMeeting/', views.cancel_meeting), + path('cancelMeeting2/', views.cancel_meeting), path('editMeeting/',views.edit_meeting) ] diff --git a/yj_room_agent/views.py b/yj_room_agent/views.py index bd030f5..7eb0ebc 100644 --- a/yj_room_agent/views.py +++ b/yj_room_agent/views.py @@ -218,6 +218,31 @@ def cancel_meeting(request): except Exception as ex: return JsonResponse(str(ex)) +def cancel_meeting2(request): + """ + params{ + tenantId + meetingId + } + :return: + """ + if request.method == 'GET': + params = request.GET.dict() + print("当前params : {0}".format(params)) + tenant_id = params.get('tenantId', None) + if not tenant_id: + raise Exception("tenantId 不能为空") + try: + access_token = getinfo.get_access_token(tenant_id) + params['access_token'] = access_token + + result = getinfo.cancel_meeting(params) + content = json.loads(json.dumps(result)) + print("content :", content) + return JsonResponse(content) + except Exception as ex: + return JsonResponse(str(ex)) + @require_POST def room_chat(request):