Feat/analytics and post observer server#20
Open
kwang-i-coder wants to merge 3 commits into
Open
Conversation
- /analytics/summary, /category-ratios, /keyword-rankings 추가 - /analytics/global/category-ratios, /global/keyword-rankings 추가 - AnalyticsRepository, AnalyticsService, AnalyticsRouter 구현 - main.py에 analytics 전용 예외 핸들러 추가 - get_user_ranking 분모를 기간 내 활동 유저 수 기준으로 수정
- FastAPI 서버(server.py) 및 observer 라우터 추가 - RSS 파싱, 본문 크롤링, 플랫폼 등록, 새글 확인 엔드포인트 추가 - 티스토리 sitemap 기반 전체 글 수집 파서 추가 - 내부 인증 토큰(X-Internal-Token) 검증 미들웨어 추가 - check_inactive_users에서 RabbitMQ 발행 후 DB 업데이트하도록 수정 - 플랫폼 등록 시 post_observer에 HTTP로 수집 요청하도록 변경 - Dockerfile 및 docker-compose uvicorn 서버 실행으로 업데이트
jdk829355
reviewed
Apr 7, 2026
| app.include_router(router=trend_router) | ||
| app.include_router(router=analytics_router) | ||
|
|
||
| def _is_analytics_path(request: Request) -> bool: |
| ] | ||
|
|
||
|
|
||
| def register_platform(user_id: str, platform_name: str, account_id: str) -> int: |
Contributor
There was a problem hiding this comment.
그럼 메인서버에서 platform_register 큐에 메시지를 발행하는 것 대신에 여기에 요청을 날리고, 여기서 글 url 목록을 뽑은 후에 new_posts 큐로 메시지를 발행하는 건가요?
jdk829355
requested changes
Apr 8, 2026
| for post in posts: | ||
| published_at = post.get("published_at") | ||
| messages.append( | ||
| { |
Contributor
There was a problem hiding this comment.
아키텍처에 요 스키마도 같이 추가해주세요 그래야 다른 부분 개발하기 편합니다..
| ) | ||
|
|
||
| return | ||
| return UserPlatformResponse( |
| ) | ||
| platform_service.delete_user_platform_mapping(db, user_id, platform_info.platform_id, req.platform_name) | ||
|
|
||
| return {"message": "삭제 완료"} |
Contributor
Contributor
There was a problem hiding this comment.
mail_reminders, new_posts에 대한 스키마를 아키텍처에 적어주시길 부탁드립니다.
메일은 일단 어디서 소비할 지 봐야겠는데 new_posts는 ai서버에서 키워드랑 카테고리 추출하고 db에 insert하면 될 것 같네요
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
analytics API 엔드포인트 추가 및 post_observer 서버화
변경 사항
feat(analytics): analytics API 엔드포인트 추가
feat(post-observer): post_observer HTTP 서버화