Skip to content

Refactor: is_changed 추가 - #65

Merged
Choi-JJunho merged 4 commits into
developfrom
refactor/64-apply-menu-changes
Apr 1, 2024
Merged

Refactor: is_changed 추가#65
Choi-JJunho merged 4 commits into
developfrom
refactor/64-apply-menu-changes

Conversation

@ImTotem

@ImTotem ImTotem commented Mar 28, 2024

Copy link
Copy Markdown
Contributor

sql에 is_changed를 추가했습니다.

10초마다 크롤링 할때 메뉴가 변경되면 is_changedTrue로 업데이트됩니다.

@Choi-JJunho Choi-JJunho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이게 왜 추가되었나요?

+) target 브랜치 develop으로 바꿔주세용

Comment thread crawling/koreatech_dining.py Outdated
INSERT INTO koin.dining_menus(date, type, place, price_card, price_cash, kcal, menu)
VALUES ('%s', '%s', '%s', %s, %s, %s, '%s')
ON DUPLICATE KEY UPDATE price_card = %s, price_cash = %s, kcal = %s, menu = '%s'
INSERT INTO koin.dining_menus(date, type, place, price_card, price_cash, kcal, menu, is_changed)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R

DB에 is_changed라는 컬럼이 없는데요?
image

이거 추가하게된 이유가 뭔가요
영양사님은 메뉴를 여러번 수정하실 수도 있는데 이게 어떤면에서 효과를 볼 수 있는거죠?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KOIN_API_V2 Dining 엔티티에 레거시에 없던 soldOutimageUrl이 추가된것을 확인했습니다.
image
is_changed는 곧 코마 Dining에서 작성하여 PR할 예정입니다.

원래는 created_atupdated_at을 비교해서 다르면 메뉴가 변경되었다고 판단할 생각이었습니다.

이렇게 비교하면 식사시간 이전에 메뉴가 변경되면 품절로 인한 변경인지 알 수 없는 문제가 발생할 수 있었습니다.
그래서 '식사 시간에 메뉴가 변경되었는가?'를 판단하기 위해 추가했습니다.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

메뉴가 변경되었음을 판단해야할 상황이 있나용?

+) 코마 Dining PR이 Merge되고 컬럼 생성된거 확인하고 어프로브할게요

@ImTotem ImTotem Mar 28, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

메뉴가 변경되면 메뉴 사진위에 '품절됨'을 표시해주는 것처럼 '변경됨'을 표시해주기 위해 필요하다고 했습니다

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 그런 히스토리가 있었군요
좋습니다~👍
코마에 flyway 파일 머지되는거 확인하고 본 PR 다시 확인하겠습니다

@ImTotem
ImTotem changed the base branch from master to develop March 28, 2024 04:45
@ImTotem
ImTotem requested a review from Choi-JJunho March 31, 2024 08:20

@Choi-JJunho Choi-JJunho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Choi-JJunho
Choi-JJunho merged commit db98932 into develop Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

메뉴 변동 사항 인지 (cron으로)

2 participants