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

feat : 호스트, 이벤트 조회 페이징 적용 #212

Merged
merged 6 commits into from
Jan 28, 2023

Conversation

gengminy
Copy link
Member

개요

작업사항

  • 내가 속한 호스트 응답값에 해당 유저가 마스터인지 표시하는 isMaster 필드 추가
  • 호스트 리스트 응답에 페이징 적용
  • 이벤트 리스트 응답에 페이징 적용
  • EventProfileVo 클래스 추가
  • PageResonse 클래스 추가
  • EventDetail 에서 이미지 관련 Lazy 로딩 오류 수정
  • 쓸모없는 정보 빼고 필요한 정보만 담았습니다. 제네릭으로 사용하면 됩니다
  • 페이징 응답값 예시
{
  "success": true,
  "status": 200,
  "data": {
    "content": [
      {
        "eventId": 1,
        "posterImage": "https://s3.dudoong.com/image",
        "name": "고스락 제 22회 정기공연",
        "startAt": "2023-03-20T12:00:00",
        "placeName": "롤링홀",
        "status": "PREPARING"
      },
      {
        "eventId": 2,
        "posterImage": null,
        "name": "고스락 제 22회 정기공연",
        "startAt": "2023-03-20T12:00:00",
        "placeName": "롤링홀",
        "status": "PREPARING"
      },
      {
        "eventId": 3,
        "posterImage": null,
        "name": "고스락 제 22회 정기공연",
        "startAt": "2023-03-20T12:00:00",
        "placeName": "롤링홀",
        "status": "PREPARING"
      },
      {
        "eventId": 4,
        "posterImage": "https://s3.dudoong.com/image",
        "name": "고스락 제 22회 정기공연",
        "startAt": "2023-03-20T12:00:00",
        "placeName": "롤링홀",
        "status": "PREPARING"
      }
    ],
    "page": 0,
    "size": 4,
    "totalElements": 4,
    "totalPages": 1,
    "hasNextPage": false
  },
  "timeStamp": "2023-01-28T18:08:21.086877"
}

image

  • OpenAPI 3.0 은 첨이라 잘 모르겠는데 컨트롤러에서 Pageable 사용할 때 @ParameterObject 안붙여주면
    스웨거에서 쿼리 마라미터로 제대로 인식 못하는 듯 합니다

변경로직

  • 내용을 적어주세요.

@gengminy gengminy added For: API [이슈 대상] 외부 API Type: Errors/Bugs [이슈 목적] 버그, 애러 수정 Type: Feature [이슈 목적] 새로운 기능 추가 Type: Refactor [이슈 목적] 프로덕션 코드 리팩토링 labels Jan 28, 2023
@gengminy gengminy self-assigned this Jan 28, 2023
Copy link
Member

@ImNM ImNM left a comment

Choose a reason for hiding this comment

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

굿굿~

@@ -13,6 +13,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.12'
implementation 'org.springdoc:springdoc-openapi-data-rest:1.5.2'
Copy link
Member

Choose a reason for hiding this comment

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

요건 뭔가유?

Copy link
Member Author

Choose a reason for hiding this comment

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

저거 넣어야 pageable 인식이 된다고 해서 넣었는데
지워도 될거 같아요 소용 없음

public List<HostResponse> getAllHosts() {
return readHostListUseCase.execute();
public PageResponse<HostProfileResponse> getAllHosts(
@ParameterObject @PageableDefault(size = 10) Pageable pageable) {
Copy link
Member

Choose a reason for hiding this comment

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

Pageable 요청받는 객체
새로만들어주시는줄 알았는데 ㅠ

Copy link
Member Author

Choose a reason for hiding this comment

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

이걸로도 충분하지 않나요?

Copy link
Member

@cofls6581 cofls6581 Jan 28, 2023

Choose a reason for hiding this comment

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

openapi 3.0 @ParameterObject 붙여 사용하는걸루 알고있어요. 관련 자료 공유합니다!
공식 문서
관련된 질문 글

@@ -27,7 +28,7 @@ public class Host extends BaseTimeEntity {

// 파트너 여부
// 정책상 초기값 false 로 고정입니다
private Boolean partner = false;
private final Boolean partner = false;
Copy link
Member

Choose a reason for hiding this comment

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

final 넣어도 될려나유?

Copy link
Member Author

Choose a reason for hiding this comment

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

DB에서 값 바꾸는거에는 영향이 없어서 상관 없을 거 같아요

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 253 Code Smells

12.6% 12.6% Coverage
1.1% 1.1% Duplication

Copy link
Member

@cofls6581 cofls6581 left a comment

Choose a reason for hiding this comment

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

LGTM

@gengminy gengminy merged commit bad220c into dev Jan 28, 2023
@gengminy gengminy deleted the feature/210-host-with-event branch January 28, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For: API [이슈 대상] 외부 API Type: Errors/Bugs [이슈 목적] 버그, 애러 수정 Type: Feature [이슈 목적] 새로운 기능 추가 Type: Refactor [이슈 목적] 프로덕션 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 [feature] 호스트 조회 시 이벤트 정보 포함
3 participants