Skip to content

Commit

Permalink
[merge] GET API들의 ApiResponseDto 타입 지정
Browse files Browse the repository at this point in the history
[fix] GET API들의 ApiResponseDto 타입 지정
  • Loading branch information
lreowy authored Jul 15, 2024
2 parents 6b3ec87 + a6ecc7f commit cc0be92
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.pickple.server.api.host.controller;

import com.pickple.server.api.host.dto.response.HostByMoimResponse;
import com.pickple.server.api.host.dto.response.HostGetResponse;
import com.pickple.server.api.host.service.HostQueryService;
import com.pickple.server.global.common.annotation.HostId;
import com.pickple.server.global.response.ApiResponseDto;
Expand All @@ -18,12 +20,12 @@ public class HostController implements HostControllerDocs {
private final HostQueryService hostQueryService;

@GetMapping("/v1/host")
public ApiResponseDto getHost(@HostId Long hostId) {
public ApiResponseDto<HostGetResponse> getHost(@HostId Long hostId) {
return ApiResponseDto.success(SuccessCode.HOST_DETAIL_GET_SUCCESS, hostQueryService.getHost(hostId));
}

@GetMapping("/v1/host/{hostId}")
public ApiResponseDto getMoimHost(@PathVariable Long hostId) {
public ApiResponseDto<HostByMoimResponse> getMoimHost(@PathVariable Long hostId) {
return ApiResponseDto.success(SuccessCode.HOST_BY_MOIM_GET_SUCCESS, hostQueryService.getHostByMoim(hostId));
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package com.pickple.server.api.moim.controller;

import com.pickple.server.api.moim.domain.QuestionInfo;
import com.pickple.server.api.moim.domain.enums.Category;
import com.pickple.server.api.moim.dto.request.MoimCreateRequest;
import com.pickple.server.api.moim.dto.response.MoimByCategoryResponse;
import com.pickple.server.api.moim.dto.response.MoimDescriptionResponse;
import com.pickple.server.api.moim.dto.response.MoimDetailResponse;
import com.pickple.server.api.moim.dto.response.MoimListByHostGetResponse;
import com.pickple.server.api.moim.service.MoimCommandService;
import com.pickple.server.api.moim.service.MoimQueryService;
import com.pickple.server.api.moimsubmission.dto.response.MoimByGuestResponse;
Expand Down Expand Up @@ -50,31 +54,32 @@ public ApiResponseDto<MoimByGuestResponse> getSubmittedMoimDetail(@PathVariable
}

@GetMapping("/v1/moim-list")
public ApiResponseDto getMoimListByCategory(@RequestParam String category) {
public ApiResponseDto<List<MoimByCategoryResponse>> getMoimListByCategory(@RequestParam String category) {
return ApiResponseDto.success(SuccessCode.MOIM_LIST_BY_CATEGORY_GET_SUCCESS,
moimQueryService.getMoimListByCategory(category));
}

@GetMapping("/v1/moim/{moimId}/description")
public ApiResponseDto getMoimDescription(@PathVariable Long moimId) {
public ApiResponseDto<MoimDescriptionResponse> getMoimDescription(@PathVariable Long moimId) {
return ApiResponseDto.success(SuccessCode.MOIM_DESCRIPTION_GET_SUCCESS,
moimQueryService.getMoimDescription(moimId));
}

@GetMapping("/v1/moim/{moimId}/question-list")
public ApiResponseDto getMoimQuestionList(@PathVariable Long moimId) {
public ApiResponseDto<QuestionInfo> getMoimQuestionList(@PathVariable Long moimId) {
return ApiResponseDto.success(SuccessCode.MOIM_QUESTION_LIST_GET_SUCCESS,
moimQueryService.getMoimQuestionList(moimId));
}

@GetMapping("/v1/moim/banner")
public ApiResponseDto getMoimBanner() {
public ApiResponseDto<Long> getMoimBanner() {
return ApiResponseDto.success(SuccessCode.MOIM_BANNER_GET_SUCCESS,
moimQueryService.getMoimBanner());
}

@GetMapping("/v1/host/{hostId}/moim-list")
public ApiResponseDto getMoimListByHostId(@PathVariable Long hostId, @RequestParam String moimState) {
public ApiResponseDto<List<MoimListByHostGetResponse>> getMoimListByHostId(@PathVariable Long hostId,
@RequestParam String moimState) {
return ApiResponseDto.success(SuccessCode.MOIM_LIST_BY_HOST,
moimQueryService.getMoimListByHost(hostId, moimState));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.pickple.server.api.moimsubmission.controller;

import com.pickple.server.api.host.dto.response.SubmittionDetailResponse;
import com.pickple.server.api.moim.dto.response.SubmittedMoimByGuestResponse;
import com.pickple.server.api.moimsubmission.dto.request.MoimSubmitRequest;
import com.pickple.server.api.moimsubmission.dto.request.MoimSubmitterUpdateRequest;
import com.pickple.server.api.moimsubmission.dto.response.MoimSubmissionByMoimResponse;
import com.pickple.server.api.moimsubmission.service.MoimSubmissionCommandService;
import com.pickple.server.api.moimsubmission.service.MoimSubmissionQueryService;
import com.pickple.server.global.common.annotation.GuestId;
import com.pickple.server.global.response.ApiResponseDto;
import com.pickple.server.global.response.enums.SuccessCode;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
Expand Down Expand Up @@ -36,7 +40,7 @@ public ApiResponseDto createMoimSubmission(
}

@GetMapping("/v1/guest/{guestId}/submitted-moim-list")
public ApiResponseDto getSubmittedMoimListByGuest(
public ApiResponseDto<List<SubmittedMoimByGuestResponse>> getSubmittedMoimListByGuest(
@PathVariable Long guestId,
@RequestParam String moimSubmissionState
) {
Expand All @@ -45,23 +49,23 @@ public ApiResponseDto getSubmittedMoimListByGuest(
}

@GetMapping("/v1/moim/{moimId}/submitter/{submitterId}")
public ApiResponseDto getSubmissionDetail(
public ApiResponseDto<SubmittionDetailResponse> getSubmissionDetail(
@PathVariable Long moimId, @PathVariable Long submitterId
) {
return ApiResponseDto.success(SuccessCode.SUBMISSION_DETAIL_GET_SUCCESS,
moimSubmissionQueryService.getSubmittionDetail(moimId, submitterId));
}

@GetMapping("/v1/guest/{guestId}/completed-moim-list")
public ApiResponseDto getCompletedMoimListByGuest(
public ApiResponseDto<List<SubmittedMoimByGuestResponse>> getCompletedMoimListByGuest(
@PathVariable Long guestId
) {
return ApiResponseDto.success(SuccessCode.COMPLETED_MOIM_LIST_BY_GUEST_GET_SUCCESS,
moimSubmissionQueryService.getCompletedMoimListByGuest(guestId));
}

@GetMapping("/v1/moim/{moimId}/submitter-list")
public ApiResponseDto getSubmitterListByMoim(@PathVariable Long moimId) {
public ApiResponseDto<List<MoimSubmissionByMoimResponse>> getSubmitterListByMoim(@PathVariable Long moimId) {
return ApiResponseDto.success(SuccessCode.SUBMITTER_LIST_BY_MOIM_GET_SUCCESS,
moimSubmissionQueryService.getSubmitterListByMoim(moimId));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.pickple.server.api.notice.controller;

import com.pickple.server.api.notice.dto.request.NoticeCreateRequest;
import com.pickple.server.api.notice.dto.response.NoticeListGetByMoimResponse;
import com.pickple.server.api.notice.service.NoticeCommandService;
import com.pickple.server.api.notice.service.NoticeQueryService;
import com.pickple.server.global.response.ApiResponseDto;
import com.pickple.server.global.response.enums.SuccessCode;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -28,8 +30,8 @@ public ApiResponseDto createNotice(@PathVariable Long moimId,
return ApiResponseDto.success(SuccessCode.NOTICE_POST_SUCCESS);
}

@GetMapping("/v1/moim/{moimId}/noitce-list")
public ApiResponseDto getNoticeListByMoimId(@PathVariable Long moimId) {
@GetMapping("/v1/moim/{moimId}/notice-list")
public ApiResponseDto<List<NoticeListGetByMoimResponse>> getNoticeListByMoimId(@PathVariable Long moimId) {
return ApiResponseDto.success(SuccessCode.NOTICE_LIST_GET_SUCCESS,
noticeQueryService.getNoticeListByMoimId(moimId));
}
Expand Down

0 comments on commit cc0be92

Please sign in to comment.