Skip to content

Commit

Permalink
fix : 크루 조회 dto수정에따른 서비스, 컨트롤러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hd0rable committed Aug 5, 2024
1 parent 653242b commit 91aacad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.likelion12.controller;

import com.example.likelion12.common.response.BaseResponse;
import com.example.likelion12.dto.SearchRequest;
import com.example.likelion12.dto.crew.*;
import com.example.likelion12.dto.crew.GetCrewDetailResponse;
import com.example.likelion12.dto.crew.GetCrewInquiryResponse;
Expand Down Expand Up @@ -39,10 +38,10 @@ public BaseResponse<PostCrewResponse> createCrew(@RequestHeader("Authorization")
*/
@GetMapping("/inquiry")
public BaseResponse<List<GetCrewInquiryResponse>> getCrewInquiries(@RequestHeader("Authorization") String authorization,
@RequestBody SearchRequest searchRequest){
@RequestParam int page){
log.info("[CrewController.getCrewInquiries]");
Long memberId = jwtProvider.extractIdFromHeader(authorization);
return new BaseResponse<>(crewService.getCrewInquiries(memberId,searchRequest));
return new BaseResponse<>(crewService.getCrewInquiries(memberId,page));
}


Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/example/likelion12/dto/SearchRequest.java

This file was deleted.

5 changes: 2 additions & 3 deletions src/main/java/com/example/likelion12/service/CrewService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.example.likelion12.domain.base.BaseGender;
import com.example.likelion12.domain.base.BaseLevel;
import com.example.likelion12.domain.base.BaseStatus;
import com.example.likelion12.dto.SearchRequest;
import com.example.likelion12.dto.crew.*;
import com.example.likelion12.repository.*;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -77,14 +76,14 @@ public PostCrewResponse createCrew(Long memberId, PostCrewRequest postCrewReques
/**
* 크루 조회
*/
public List<GetCrewInquiryResponse> getCrewInquiries(Long memberId, SearchRequest searchRequest) {
public List<GetCrewInquiryResponse> getCrewInquiries(Long memberId, int page) {
log.info("[CrewService.getCrewInquiries]");

List<Crew> allCrews = crewRepository.findAllByStatus(BaseStatus.ACTIVE);
List<GetCrewInquiryResponse> getCrewInquiryResponses = new ArrayList<>();

// offset과 limit 계산
int offset = searchRequest.getOffset();
int offset = (page - 1) * 9;
int recordSize = 9 ;

// 페이징 처리된 크루 목록 생성
Expand Down

0 comments on commit 91aacad

Please sign in to comment.