From 00042b30e986125c6509ea6bc4f793664abce7c2 Mon Sep 17 00:00:00 2001 From: Seokyoung_Hong <88967942+Seokyoung-Hong@users.noreply.github.com> Date: Fri, 4 Oct 2024 02:42:35 +0900 Subject: [PATCH] Deploy hotfix (#31) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * hotfix: bucket/commcon.py에 logger import문 추가 (#25) * hotfix: add kakao-chatbot package to sandol/requirements.txt sandol 폴더 안에있는 requirements.txt 파일에 kakao-chatbot 패키지가 없어 발생하는 서버 오류를 해결합니다. * hotfix: 산돌식당 데이터를 설정 파일에서 제거 (#29) * delete: 산돌식당 데이터 from test.json * delete: 산돌식당 URL from NAVER_MAP_URL_DICT in settings.py * delete: 산돌식당의 가격 정보를 settings.py에서 주석 처리 * hotfix: kakao-chatbot의 is_empty 논리 문제 대응 (#30) `kakao-chatbot.response.KakaoResponse` 클래스의 `is_empty` 논리가 반대로 되어있어 발생하는 문제에 대응합니다. `is_empty` 메서드 대신, 직접 `component_list` 인스턴스에 접속하여 비어있는지 유무를 판단합니다. --- sandol/api_server/meal.py | 2 +- sandol/api_server/settings.py | 2 +- sandol/crawler/settings.py | 84 +++++++++++++++++------------------ sandol/crawler/test.json | 18 -------- 4 files changed, 44 insertions(+), 62 deletions(-) diff --git a/sandol/api_server/meal.py b/sandol/api_server/meal.py index 7c74a19a..1c7e81ab 100644 --- a/sandol/api_server/meal.py +++ b/sandol/api_server/meal.py @@ -247,7 +247,7 @@ async def meal_view(payload: Payload = Depends(parse_payload)): response.add_component(lunch_carousel) if not dinner_carousel.is_empty: response.add_component(dinner_carousel) - if response.is_empty: + if not response.component_list: response.add_component( SimpleTextComponent("식단 정보가 없습니다.") ) diff --git a/sandol/api_server/settings.py b/sandol/api_server/settings.py index 6ec0f91b..a0eb38f9 100644 --- a/sandol/api_server/settings.py +++ b/sandol/api_server/settings.py @@ -32,7 +32,7 @@ NAVER_MAP_URL_DICT = { "미가식당": "https://naver.me/xEMZ6QdE", "세미콘식당": "https://naver.me/xQ8Khcho", - "산돌식당": "https://naver.me/xEMZ6QdE", + # "산돌식당": "https://naver.me/xEMZ6QdE", "TIP 가가식당": "https://naver.me/GCaFzr8k", "E동 레스토랑": "https://naver.me/GRO427Hk", "수호식당": "https://naver.me/Gz18OrEt", diff --git a/sandol/crawler/settings.py b/sandol/crawler/settings.py index b2292523..89fd4d77 100644 --- a/sandol/crawler/settings.py +++ b/sandol/crawler/settings.py @@ -1,42 +1,42 @@ - -import os - -import pytz - -# Settings -_PATH = os.path.abspath(os.path.dirname(__file__)) # 프로젝트 절대경로 -DEBUG = False # True 일때 디버그 모드 작동 - -KST = pytz.timezone('Asia/Seoul') - -# BUCKET -BUCKET_NAME: str = 'aws-sandol-bucket' - -# Access Token -SANDOL_ACCESS_ID: dict = { - 'MANAGER': "d367f2ec55f41b4207156f4b8fce5ce885b05d8c3b238cf8861c55a9012f6f5895", - 'CONT1': "339b0444bfabbffa0f13508ea7c45b61675b5720234cca8f73cd7421c22de9e546", - 'CONT2': "04eabc8b965bf5ae6cccb122a18521969cc391162e3fd5f61b85efe8bb12e5e98a", - 'CONT3': "def99464e022b38389697fe68d54bbba723d1da291094c19bbf5eaace7b059a997", - 'MINJU': "1ddffbb02b29a6beb212d2f6fe2469523b9a90f260344b9d30677abcd977e1b56c", - 'YURIM': "16b3777b75026553a1807d1f361773e080e6441d30c65ea6e89dd0b84c9b58f071", - 'HAMIN': "c0657ad2b0ade045e546d8abb33f45d85f3c826ce797800e0bf25aac0652bf175c", - 'JDONG': "cbdb6ec7c1427fd603a9c87ee5a1f7d1cc948ca896a2d65f88c770aa742218cef0" -} -# 산돌팀만 접근할 수 있는 컨텐츠에 인증 수단으로 사용 (현재 아이디의 정확한 위치가 기억이 나지 않아.. KEY를 메니저와, CONTRIBUTOR로 명명함.) - -RESTAURANT_ACCESS_ID: dict = { - "32d8a05a91242ffb4c64b5630ec55953121dffd83a121d985e26e06e2c457197e6": "미가식당", - "380da59920b84d81eb8c444e684a53290021b38f544fe0029f4b38ab347bc44e08": "세미콘식당", - "00752cd364a4d1c910df203fd4ed424e07e6981d3f958f953c6c5ef3b879032743": "산돌식당", - "001": "TIP 가가식당", - "002": "E동 레스토랑" -} - -RESTAURANT_OPEN_PRICE: dict = { - "미가식당": ["오전 11:00-1:00 / 오후 5:00-6:30", 6000], - "세미콘식당": ["오전 11:30-1:30 / 오후 5:00-6:00", 6000], - "산돌식당": ["오후 12:00-1:00 / 오후 5:30-6:30", 6500], - "TIP 가가식당": ["오전 11:00-2:00 / 오후 5:00-6:50", 6000], - "E동 레스토랑": ["오전 11:30-1:50 / 오후 4:50-6:40", 6500] -} + +import os + +import pytz + +# Settings +_PATH = os.path.abspath(os.path.dirname(__file__)) # 프로젝트 절대경로 +DEBUG = False # True 일때 디버그 모드 작동 + +KST = pytz.timezone('Asia/Seoul') + +# BUCKET +BUCKET_NAME: str = 'aws-sandol-bucket' + +# Access Token +SANDOL_ACCESS_ID: dict = { + 'MANAGER': "d367f2ec55f41b4207156f4b8fce5ce885b05d8c3b238cf8861c55a9012f6f5895", + 'CONT1': "339b0444bfabbffa0f13508ea7c45b61675b5720234cca8f73cd7421c22de9e546", + 'CONT2': "04eabc8b965bf5ae6cccb122a18521969cc391162e3fd5f61b85efe8bb12e5e98a", + 'CONT3': "def99464e022b38389697fe68d54bbba723d1da291094c19bbf5eaace7b059a997", + 'MINJU': "1ddffbb02b29a6beb212d2f6fe2469523b9a90f260344b9d30677abcd977e1b56c", + 'YURIM': "16b3777b75026553a1807d1f361773e080e6441d30c65ea6e89dd0b84c9b58f071", + 'HAMIN': "c0657ad2b0ade045e546d8abb33f45d85f3c826ce797800e0bf25aac0652bf175c", + 'JDONG': "cbdb6ec7c1427fd603a9c87ee5a1f7d1cc948ca896a2d65f88c770aa742218cef0" +} +# 산돌팀만 접근할 수 있는 컨텐츠에 인증 수단으로 사용 (현재 아이디의 정확한 위치가 기억이 나지 않아.. KEY를 메니저와, CONTRIBUTOR로 명명함.) + +RESTAURANT_ACCESS_ID: dict = { + "32d8a05a91242ffb4c64b5630ec55953121dffd83a121d985e26e06e2c457197e6": "미가식당", + "380da59920b84d81eb8c444e684a53290021b38f544fe0029f4b38ab347bc44e08": "세미콘식당", + # "00752cd364a4d1c910df203fd4ed424e07e6981d3f958f953c6c5ef3b879032743": "산돌식당", + "001": "TIP 가가식당", + "002": "E동 레스토랑" +} + +RESTAURANT_OPEN_PRICE: dict = { + "미가식당": ["오전 11:00-1:00 / 오후 5:00-6:30", 6000], + "세미콘식당": ["오전 11:30-1:30 / 오후 5:00-6:00", 6000], + # "산돌식당": ["오후 12:00-1:00 / 오후 5:30-6:30", 6500], + "TIP 가가식당": ["오전 11:00-2:00 / 오후 5:00-6:50", 6000], + "E동 레스토랑": ["오전 11:30-1:50 / 오후 4:50-6:40", 6500] +} diff --git a/sandol/crawler/test.json b/sandol/crawler/test.json index 0115042b..2826c3cb 100644 --- a/sandol/crawler/test.json +++ b/sandol/crawler/test.json @@ -45,24 +45,6 @@ "location": "교외", "price_per_person": 6000 }, - { - "identification": "00752cd364a4d1c910df203fd4ed424e07e6981d3f958f953c6c5ef3b879032743", - "name": "산돌식당", - "registration_time": "2024-03-27T08:00:00", - "opening_time": "2024-03-27T10:30:00", - "lunch_menu": [ - "불고기", - "김치찌개", - "제육덮밥" - ], - "dinner_menu": [ - "해물찜", - "양념치킨", - "매운탕" - ], - "location": "교내", - "price_per_person": 7500 - }, { "identification": "001", "name": "TIP 가가식당",