Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OING-317] refactor: 뷰 기반 API에 대한 교통정리 1 #238

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

Kwon770
Copy link
Collaborator

@Kwon770 Kwon770 commented Apr 21, 2024

❓ 기능 추가 배경


�BFF 임시 대체제로서 의결된 뷰 기반 컨트롤러에 대해서 팀원끼리 다르게 이해한 부분으로 인해 작성된 코드들을 수정하기 위해, 새벽에 긴히 회의를 진행하였습니다. 서로 다르게 이해하던 부분들을 명확히하고 뷰 기반 컨트롤러 구현 방안을 결정하였습니다. 프론트분들이 이미 작업하고 있기 때문에 작업 지연을 최소화하기 위해, 프론트에 노출되는 부분**"만"** 우선적으로 작업한 PR입니다. 후속 PR로 서버 코드를 리팩토링한 내용을 리뷰 요청하겠습니다!

➕ 추가/변경된 기능


  • ViewBasedController > MainPageController 로 리팩토링
  • getPage를 getDaytimePage와 getNighttimePage로 세분화하여 구현
  • 누락되어 있던 getFamilyMemberMonthlyRanking의 GetMapping 어노테이션을 추가하고 MainPageController로 통합
  • 모킹된 내용에 대한 Schema description 보충

🥺 리뷰어에게 하고싶은 말


긴급히 긴히 요청드려요!! 🥲

🔗 참조 or 관련된 이슈


https://no5ing.atlassian.net/browse/OING-317

@Kwon770 Kwon770 requested a review from Ji-soo708 April 21, 2024 16:19
@Kwon770 Kwon770 self-assigned this Apr 21, 2024
@github-actions github-actions bot changed the title refactor: 뷰 기반 API를 둘러싼 교통정리 1 [OING-317] refactor: 뷰 기반 API를 둘러싼 교통정리 1 Apr 21, 2024
Copy link

github-actions bot commented Apr 21, 2024

Test Results

 40 files   40 suites   11s ⏱️
107 tests 107 ✅ 0 💤 0 ❌
108 runs  108 ✅ 0 💤 0 ❌

Results for commit 2cce08e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 21, 2024

Code Coverage

File Coverage [3.26%]
MainViewController.java 4.35%
MainPageTopBarResponse.java 0%
FamilyMemberMonthlyRankingResponse.java 0%
NighttimePageResponse.java 0%
DaytimePageResponse.java 0%
Total Project Coverage 46.35% 🍏

Copy link

sonarcloud bot commented Apr 21, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@Ji-soo708 Ji-soo708 left a comment

Choose a reason for hiding this comment

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

LGTM! 새벽에 수고하셨습니다~

@Ji-soo708 Ji-soo708 merged commit d37bedd into dev Apr 21, 2024
4 checks passed
@Ji-soo708 Ji-soo708 deleted the feature/OING-317 branch April 21, 2024 16:36
@Kwon770 Kwon770 changed the title [OING-317] refactor: 뷰 기반 API를 둘러싼 교통정리 1 [OING-317] refactor: 뷰 기반 API에 대한 교통정리 1 Apr 21, 2024
Ji-soo708 pushed a commit that referenced this pull request May 9, 2024
* feat: Add leftUploadCountUntilMissionUnlock, dailyMissionConten and Add debug parameter to control boolean flag

* refactor: Integrate HomeAPI to MainViewController and Add getNighttimePage API

* fix: Fix wrongly written get mapping url of getNighttimePage

* fix: Add the missing GetMapping annotation and fix wrongly written swagger summary
Kwon770 added a commit that referenced this pull request May 9, 2024
* chore: update ECS Service name

* chore: update production ecs

* refactor: Translate english error message to Korean (#224)

* [OING-300] feat: 콕 찌르기 API 구현 (#222)

* feat: implementing pick..

* feat: implement pick feature

* feat: add picked members api

* feat: implement picked api

* feat: implement GET api

* feat: check member exists

* feat: update api specs

* feat: concat sql queries

* feat: seperate notification

* [OING-289] refactor: Member 모듈의 안티패턴과 짜잘한 부분 리팩토링 (#223)

* refactor: Remove unused api parameter got by parsing token and reformat parameter sequence from MemberController. MemberApi

* refactor: Rename and reformat the methods in MemberController

* refactor: Rename and reformat the methods in MemberSerivce

* refactor: Fix the anti-pattern of MemberController by moving transactional code to MemberService

* refactor: Refactor minor code dirty

* refactor: Refactor legacy MemberControllerTest by removing unnessary tests and spliting to MemberServiceTest due to anti-pattern refactoring

* refactor: Resolve code smell issue, distinguishing AuthenticationFailedException by ErrorCode

* feat: Add MemberServiceTests for projections methods

* [OING-305] feature: Mission 도입에 맞춰 Post 테이블 변경 (#225)

* feature: add type and mission_id column sql

* feature: add type and mission_id column to Post Entity

* test: fix test due to added column

* feat: change type field's type in Post

* hotfix: add Enumerated annotation (#226)

* hotfix: Type 필드 추가하면서 발생하는 에러 해결 (#227)

* hotfix: add Enumerated annotation

* hotfix: change char to varchar

* [OING-302] feature: 미션 포스트 작성/조회 모킹 API 추가 (#228)

* feat: add type field in constructor

* feat: add mission post create/read mocking api

* test: fix failed test due to added type field

* style: add comment

* refactor: change type's validate logic in create post

* refactor: change type enum value

* refactor: rename Enum Type

* refactor: change if to swith

* feature: change validateUploadTime's bound (#229)

* [OING-307] feat: Mission 모듈 추가 (#230)

* fix: Fix broken flyway db.migration V202404152221__create_Mission_modules_tables.sql (#233)

* [OING-309] feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking (#232)

* [OING-308] feat: 가족구성원 랭킹 API 모킹 (#231)

* feat: Add HomeApi and getFamilyMemberMonthlyRanking spec

* feat: Add getFamilyMemberMonthlyRanking api response mocking at HomeController

* feature: add set type column value sql (#234)

* [OING-314] feature: 회원 생존신고 게시글 업로드 여부 / 회원 미션 참여 가능 여부 확인 mock API 추가 (#235)

* feature: add getMissionEligibleStatus and getSurvivalUploadStatus mock api

* refactor: rename api name and dto field

* [OING-311] feat: 뷰 기반 API 중 메인 페이지 API 구현 (#237)

* feat: add view based api

* docs: update view based api docs

* feat: add isMeUploaded

* fix: update birthday evaluate logics

* [OING-315] feature: 미션 게시글 업로드/조회 API 구현 (검증 로직 제외) (#236)

* refactor: change exception name

* feature: add createMissionPost logic

* feature: add searchMissionPost

* refactor: add available parameter in createPost and fetchDailyFeeds

* refactor: seperate validate logic in mission post

* [OING-317] refactor: 뷰 기반 API를 둘러싼 교통정리 1 (#238)

* feat: Add leftUploadCountUntilMissionUnlock, dailyMissionConten and Add debug parameter to control boolean flag

* refactor: Integrate HomeAPI to MainViewController and Add getNighttimePage API

* fix: Fix wrongly written get mapping url of getNighttimePage

* fix: Add the missing GetMapping annotation and fix wrongly written swagger summary

* [OING-316] feature: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 구현 (#239)

* feature: add getRemainingSurvivalPostCount Api

* feature: add getRemainingSurvivalPostCount logic to getDaytimePage Api

* test: add getRemainingSurvivalPostCount Repository test

* test: add getRemainingSurvivalPostCount Api test

* [OING-304] feature: 회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 API 구현 (#240)

* feature: add getSurvivalUploadStatus API logic

* feature: add getMissionAvailableStatus API

* test: add getMissionAvailable Repository Test

* test: add getMissionAvailable and getSurvivalUploadStatus Api Test

* style: change response dto field name

* feature: add getMissionAvailableStatus and getSurvivalUploadStatus logic to getDaytimePage

* refactor: correct anti code

* refactor: add member.deletedAt.isNull condition to isCreatedSurvivalPostByMajority

* [OING-320] refactor: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 로직 리팩터링 (#242)

* refactor: refact calculateRemainingSurvivalPostCountUntilMissuonUnlocked logic

* feature: add isActiveMember method and refact code

* test: refact test code due to seperated logic

* test: add calculateRemainingSurvivalPostCountUntilMissionUnlocked test code

* [OING-319] feat: 메인 페이지에서 필요한 추가 요청받은 API 구현/모킹 (#241)

* feat: Add mostRecentSurvivalPostDate in FamilyMemberMonthlyRankingResponse according to requirement

* feat: Add isMeMissionUploadedToday field And Rename IsMeUploadedToday as isMeSurvivalUploadedToday from DaytimePageResponse

* fix: Fix broken PostApiTest and Add new test for added api

* refactor: add today date log to validateUserHasNotCreatedPost logic (#243)

* [OING-324] refactor: NighttimeMainPage의 displayRank 필드는 늘 NULL이 되도록 수정 (#245)

* [OING-323] feat: 일간 캘린더 API 추가 (#244)

* feat: Divide getCalendar API to getMonthlyCalendar and getDailyCalendar And Impl getDailyCalendar

* fix: Add CalendarAPI test code for getDailyCalendar and fix the bug found by test code

* refactor: Remove debug system print code

* refactor: Extract the code to map post to calendar response as the method

* refactor: Extract the code to calculate allFamilyMembersUploaded as the method

* fix: Fix the runtime exception during PostType enum mapping

* refactor: Refactoring getXXXCalendar mapping stragey from params to url parameter

* hotfix: Restore getMonthlyCalendar API as deprecated lagacy for compatibilityu

* [OING-328] feat: DailyCalendarResponse에 PostResponse 필드 추가 (프론트 요청) (#247)

* fix: Add the fields of PostResponse in DailyCalendarResponse

* fix: Fix broken CalendarApiTest

* fix: Fix broken CalendarApiTest2

* [OING-325] feat: 가족구성원 랭킹 API 기능 구현 (#246)

* feat: Add getFamilyMembersMonthlySurvivalRanking API in PostController

* feat: Add mvc test code for new API(getFamilyMembersMonthlySurvivalRanking) with nested test class

* feat: Impl getFamilyMemberMonthlyRanking API at MainViewController

* feat: Add mvc test code for new API(getFamilyMemberMonthlyRanking) at MainViewApiTest

* fix: Add stream filter to exclude familyMember who didnt upload post at that month from getFamilyMembersMonthlySurvivalRanking API of PostController and Add test code to validate it from PostApiTest and MainViewApiTest

* fix: Fix failed broken test code

* fix: Fix failed broken test code2

* refactor: Refactor compareTo method of PostRankerDTO for better readability

* refactor: Add blank line at that last of MainViewApiTest

* refactor: Extract duplicated mapping code from getFamilyMemberMonrhlyRanking method of MainViewController

* fix: Fix IndexOutOfBoundsException from getFamilyMemberMonthlyRanking API

* [OING-329] refactor: 미션 검증 로직 중에서 가족 구성원 수 계산할 때, 어제 날짜 기준으로 세도록 수정 (#248)

* refactor: count family members by family ID logic to count based on yesterday's date

* test: fix broken test due to changed logic

* style: change api summary

* refactor: delete unused method

* refactor: refactor isCreatedSurvivalPostByMajority code

* test: delete unused test

* [OING-326] feat: 일일 미션 배치 구현 및 테스트코드 추가 (#249)

* chore: Add mission module path in the targets of cicd modification checking

* feat: Add DailyMissionRegistrationJob in DailyMissionJob with Spring scheduler and table lock

* feat: Impl the methods of MissionService and DailyMissionHistyoryService those api responses was mocked

* feat: Add exceptions handling at DailyMissionRegistrationJob

* feat: Add DailyMissionHistoryRepositoryTest

* feat: Add MissionRepositoryTest for getRandomMissionExcludingIds

* feat: Add DailyMissionJobTest for registerDailyMission

* feat: Add error handling code for duplicated attempting to create daily mission history and catch exception code

* feat: Add tests for newly added error handling and exception catching code

* refactor: Refactor method and parameter name according to naming convention

* refactor: Delete unnecessary Repository annocation from DailyMissionHistoryRepositoryCustomImpl

* fix: Make Nested test class lower case

* fix: Add missing PathVariable at input paramter of getMissionByMissionId (#252)

* [OING-330] feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 (#250)

* feat: Add getLatestPost API to implement new policy of family member ranking

* fix: Add null handling in getLatestPostAPI

* feat: Make mostRecentSurvivalPostDate return most recent surcicial post date in this month else then return null

* refactor: Refactor nested test class in MianviewApiTest to follow naming convention

* feat: Add test code for findLatestPost in PostRepositoryCustomImpl

* refactor: Add PostType paramter at getRecentPost API

* feat: Add createdAt index at post table

* [OING-318] feature: 미션 게시글 등록 기능에 미션 등록 권한 검증 로직 추가 (#251)

* feature: add validateMissionPostCreateAccessMember logic

* feature: handle Mission Post Access Denied Exceptions

* test: add createMissionPost test

* style: change leftUploadCountUntilMissionUnlock field description

* test: change parameter value in createPost Api test

* test: delete createMissionPost test for normal case

* feature: change exception code

* feat: Restore mistakenly deleted method

* feat: Enable validation code for duplicated family disabled due to iOS buf from on-boarding

---------

Co-authored-by: Kwon770 <[email protected]>

---------

Co-authored-by: 송영민 (YeongMin Song) <[email protected]>
Co-authored-by: sckwon770 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants