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

[BE] fix: Swagger 문서에 잘못된 Parameter 수정 및 형식 통일 (#959) #961

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.festago.artist.application;

import com.festago.artist.dto.ArtistDetailV1Response;
import com.festago.artist.dto.ArtistFestivalDetailV1Response;
import com.festago.artist.dto.ArtistFestivalV1Response;
import com.festago.artist.repository.ArtistDetailV1QueryDslRepository;
import com.festago.artist.repository.ArtistFestivalSearchCondition;
import com.festago.common.exception.ErrorCode;
Expand All @@ -27,9 +27,9 @@ public ArtistDetailV1Response findArtistDetail(Long artistId) {
.orElseThrow(() -> new NotFoundException(ErrorCode.ARTIST_NOT_FOUND));
}

public Slice<ArtistFestivalDetailV1Response> findArtistFestivals(Long artistId, Long lastFestivalId,
LocalDate lastStartDate, boolean isPast,
Pageable pageable) {
public Slice<ArtistFestivalV1Response> findArtistFestivals(Long artistId, Long lastFestivalId,
LocalDate lastStartDate, boolean isPast,
Pageable pageable) {
return artistDetailV1QueryDslRepository.findArtistFestivals(new ArtistFestivalSearchCondition(
artistId,
isPast,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDate;

public record ArtistFestivalDetailV1Response(
public record ArtistFestivalV1Response(
Long id,
String name,
LocalDate startDate,
Expand All @@ -19,7 +19,7 @@ public record ArtistFestivalDetailV1Response(
) {

@QueryProjection
public ArtistFestivalDetailV1Response {
public ArtistFestivalV1Response {

}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.festago.artist.dto;

import com.festago.socialmedia.domain.SocialMediaType;
import com.querydsl.core.annotations.QueryProjection;

public record ArtistMediaV1Response(
String type,
SocialMediaType type,
String name,
String logoUrl,
String url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

@RestController
@RequestMapping("/api/v1/search/artists")
@Tag(name = "아티스트 검색 V1")
@Tag(name = "아티스트 검색 요청 V1")
@RequiredArgsConstructor
public class ArtistSearchV1Controller {

private final ArtistTotalSearchV1Service artistTotalSearchV1Service;

@GetMapping
@Operation(description = "키워드로 아티스트 목록을 검색한다", summary = "아티스트 목록 검색 조회")
@Operation(description = "키워드로 아티스트 목록을 검색한다.", summary = "아티스트 검색")
public ResponseEntity<List<ArtistTotalSearchV1Response>> searchByKeyword(@RequestParam String keyword) {
Validator.notBlank(keyword, "keyword");
List<ArtistTotalSearchV1Response> response = artistTotalSearchV1Service.findAllByKeyword(keyword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import com.festago.artist.application.ArtistDetailV1QueryService;
import com.festago.artist.dto.ArtistDetailV1Response;
import com.festago.artist.dto.ArtistFestivalDetailV1Response;
import com.festago.artist.dto.ArtistFestivalV1Response;
import com.festago.common.aop.ValidPageable;
import com.festago.common.dto.SliceResponse;
import com.festago.common.exception.ValidException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.time.LocalDate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Slice;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -24,29 +24,29 @@
@RequestMapping("/api/v1/artists")
@Tag(name = "아티스트 정보 요청 V1")
@RequiredArgsConstructor
public class ArtistDetailV1Controller {
public class ArtistV1Controller {

private final ArtistDetailV1QueryService artistDetailV1QueryService;

@GetMapping("/{artistId}")
@Operation(description = "아티스트의 정보를 조회한다.")
public ResponseEntity<ArtistDetailV1Response> getArtistInfo(@PathVariable Long artistId) {
@Operation(description = "아티스트의 정보를 조회한다.", summary = "아티스트 정보 조회")
public ResponseEntity<ArtistDetailV1Response> findArtistDetail(@PathVariable Long artistId) {
return ResponseEntity.ok(artistDetailV1QueryService.findArtistDetail(artistId));
}

@GetMapping("/{artistId}/festivals")
@Operation(description = "아티스트가 참석한 축제를 조회한다. isPast 값으로 종료 축제 와 진행, 예정 축제를 구분 가능하다", summary = "아티스트 축제 조회")
@Operation(description = "아티스트가 참여한 축제 목록을 조회한다. isPast 값으로 종료 축제와 진행, 예정 축제를 구분 가능하다.", summary = "아티스트 참여 축제 목록 조회")
@ValidPageable(maxSize = 20)
public ResponseEntity<SliceResponse<ArtistFestivalDetailV1Response>> getArtistInfo(
public ResponseEntity<SliceResponse<ArtistFestivalV1Response>> findArtistFestivals(
@PathVariable Long artistId,
@RequestParam(required = false) Long lastFestivalId,
@RequestParam(required = false) LocalDate lastStartDate,
@RequestParam(required = false, defaultValue = "false") boolean isPast,
@PageableDefault(size = 10) Pageable pageable
@Parameter(description = "0 < size <= 20") @RequestParam(defaultValue = "10") int size
) {
validate(lastFestivalId, lastStartDate);
Slice<ArtistFestivalDetailV1Response> response = artistDetailV1QueryService.findArtistFestivals(artistId,
lastFestivalId, lastStartDate, isPast, pageable);
Slice<ArtistFestivalV1Response> response = artistDetailV1QueryService.findArtistFestivals(artistId,
lastFestivalId, lastStartDate, isPast, PageRequest.ofSize(size));
return ResponseEntity.ok(SliceResponse.from(response));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import com.festago.artist.domain.Artist;
import com.festago.artist.dto.ArtistDetailV1Response;
import com.festago.artist.dto.ArtistFestivalDetailV1Response;
import com.festago.artist.dto.ArtistFestivalV1Response;
import com.festago.artist.dto.QArtistDetailV1Response;
import com.festago.artist.dto.QArtistFestivalDetailV1Response;
import com.festago.artist.dto.QArtistFestivalV1Response;
import com.festago.artist.dto.QArtistMediaV1Response;
import com.festago.common.querydsl.QueryDslRepositorySupport;
import com.festago.socialmedia.domain.OwnerType;
Expand Down Expand Up @@ -46,7 +46,7 @@ public Optional<ArtistDetailV1Response> findArtistDetail(Long artistId) {
artist.backgroundImageUrl,
list(
new QArtistMediaV1Response(
socialMedia.mediaType.stringValue(),
socialMedia.mediaType,
socialMedia.name,
socialMedia.logoUrl,
socialMedia.url
Expand All @@ -63,12 +63,12 @@ public Optional<ArtistDetailV1Response> findArtistDetail(Long artistId) {
return Optional.of(response.get(0));
}

public Slice<ArtistFestivalDetailV1Response> findArtistFestivals(ArtistFestivalSearchCondition condition) {
public Slice<ArtistFestivalV1Response> findArtistFestivals(ArtistFestivalSearchCondition condition) {
Pageable pageable = condition.pageable();
Long artistId = condition.artistId();
return applySlice(
pageable,
query -> query.select(new QArtistFestivalDetailV1Response(
query -> query.select(new QArtistFestivalV1Response(
festival.id,
festival.name,
festival.festivalDuration.startDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/auth")
@Tag(name = "회원 인증 V1")
@Tag(name = "회원 인증 요청 V1")
public class MemberAuthV1Controller {

private final MemberAuthFacadeService memberAuthFacadeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/bookmarks/artists")
@Tag(name = "아티스트 북마크 V1")
@Tag(name = "아티스트 북마크 요청 V1")
public class ArtistBookmarkV1Controller {

private final ArtistBookmarkV1QueryService artistBookmarkV1QueryService;

@MemberAuth
@GetMapping
@Operation(description = "유저의 아티스트 북마크 목록을 조회한다.", summary = "아티스트 북마크 조회")
@Operation(description = "회원의 아티스트 북마크 목록을 조회한다.", summary = "아티스트 북마크 조회")
public ResponseEntity<List<ArtistBookmarkV1Response>> findArtistBookmarksByMemberId(
@Member Long memberId
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/bookmarks")
@Tag(name = "북마크 등록/삭제 V1")
@Tag(name = "북마크 등록/삭제 요청 V1")
public class BookmarkManagementV1Controller {

private final BookmarkFacadeService bookmarkFacadeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/bookmarks/festivals")
@Tag(name = "축제 북마크 V1")
@Tag(name = "축제 북마크 요청 V1")
public class FestivalBookmarkV1Controller {

private final FestivalBookmarkV1QueryService festivalBookmarkV1QueryService;

@MemberAuth
@GetMapping("/ids")
@Operation(description = "북마크 된 축제의 식별자 목록을 조회한다.", summary = "북마크 된 축제 식별자 목록 조회")
@Operation(description = "회원의 북마크 된 축제 식별자 목록을 조회한다.", summary = "북마크 된 축제 식별자 목록 조회")
public ResponseEntity<List<Long>> findBookmarkedFestivalIds(
@Member Long memberId
) {
Expand All @@ -35,7 +35,7 @@ public ResponseEntity<List<Long>> findBookmarkedFestivalIds(

@MemberAuth
@GetMapping
@Operation(description = "축제의 식별자 목록으로 북마크 된 축제의 목록을 조회한다.", summary = "축제의 식별자 목록으로 북마크 된 축제의 목록 조회")
@Operation(description = "축제 식별자 목록으로 회원의 북마크 된 축제의 목록을 조회한다.", summary = "축제 식별자 목록으로 북마크 된 축제의 목록 조회")
public ResponseEntity<List<FestivalBookmarkV1Response>> findBookmarkedFestivals(
@Member Long memberId,
@RequestParam List<Long> festivalIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/bookmarks/schools")
@Tag(name = "학교 북마크 V1")
@Tag(name = "학교 북마크 요청 V1")
public class SchoolBookmarkV1Controller {

private final SchoolBookmarkV1QueryService schoolBookmarkV1QueryService;

@MemberAuth
@GetMapping
@Operation(description = "특정한 회원의 학교 북마크 목록을 반환한다", summary = "회원 학교 북마크 목록 조회")
@Operation(description = "회원의 학교 북마크 목록을 조회한다", summary = "학교 북마크 조회")
public ResponseEntity<List<SchoolBookmarkV1Response>> findAllByMemberId(@Member Long memberId) {
return ResponseEntity.ok(schoolBookmarkV1QueryService.findAllByMemberId(memberId));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.festago.common.presentation;

import io.swagger.v3.oas.annotations.Hidden;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Hidden
@RestController
@RequestMapping("/ping")
public class PingController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import com.festago.auth.annotation.Member;
import com.festago.entry.application.EntryService;
import com.festago.entry.dto.EntryCodeResponse;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@Deprecated(forRemoval = true)
@Hidden
@RestController
@RequiredArgsConstructor
public class MemberEntranceController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.festago.entry.application.EntryService;
import com.festago.entry.dto.TicketValidationRequest;
import com.festago.entry.dto.TicketValidationResponse;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
Expand All @@ -14,6 +15,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Deprecated(forRemoval = true)
@Hidden
@RestController
@RequestMapping("/staff/member-tickets")
@Tag(name = "스태프 요청")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.festago.auth.annotation.Member;
import com.festago.fcm.application.MemberFCMService;
import com.festago.fcm.dto.MemberFcmCreateRequest;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand All @@ -13,6 +14,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Deprecated(forRemoval = true)
@Hidden
@RestController
@RequiredArgsConstructor
@Tag(name = "유저 FCM 정보 요청")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class FestivalSearchV1Controller {
private final FestivalSearchV1QueryService festivalSearchV1QueryService;

@GetMapping
@Operation(description = "축제를 검색한다. ~대 혹은 ~대학교로 끝날 시 대학교 축제 검색이며 그 외의 경우는 아티스트 기반 축제 검색입니다.", summary = "축제 검색")
public ResponseEntity<List<FestivalSearchV1Response>> getArtistInfo(@RequestParam String keyword) {
@Operation(description = "키워드로 축제를 검색한다. ~대, ~대학교로 끝날 시 대학교 축제 검색, 그 외의 경우 아티스트가 참여한 축제 검색.", summary = "축제 검색")
public ResponseEntity<List<FestivalSearchV1Response>> searchFestivals(@RequestParam String keyword) {
validate(keyword);
return ResponseEntity.ok(festivalSearchV1QueryService.search(keyword));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import com.festago.festival.repository.FestivalFilter;
import com.festago.school.domain.SchoolRegion;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.time.LocalDate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Slice;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -34,17 +34,17 @@ public class FestivalV1Controller {

@GetMapping
@ValidPageable(maxSize = 20)
@Operation(description = "축제 목록를 조건별로 조회한다. PROGRESS: 진행 중, PLANNED: 진행 예정, END: 종료, 기본값 -> 진행 중, limit의 크기는 0 < limit < 21 이며 기본 값 10이다.", summary = "축제 목록 조회")
@Operation(description = "축제 목록를 조건별로 조회한다.", summary = "축제 목록 조회")
public ResponseEntity<Slice<FestivalV1Response>> findFestivals(
@PageableDefault(size = 10) Pageable pageable,
@Parameter(description = "0 < size <= 20") @RequestParam(defaultValue = "10") int size,
@RequestParam(defaultValue = "ANY") SchoolRegion region,
@RequestParam(defaultValue = "PROGRESS") FestivalFilter filter,
@Parameter(description = "PROGRESS: 진행 중, PLANNED: 진행 예정, END: 종료") @RequestParam(defaultValue = "PROGRESS") FestivalFilter filter,
@RequestParam(required = false) Long lastFestivalId,
@RequestParam(required = false) LocalDate lastStartDate
) {
validateCursor(lastFestivalId, lastStartDate);
var request = new FestivalV1QueryRequest(region, filter, lastFestivalId, lastStartDate);
var response = festivalV1QueryService.findFestivals(pageable, request);
var response = festivalV1QueryService.findFestivals(PageRequest.ofSize(size), request);
return ResponseEntity.ok(response);
}

Expand All @@ -59,7 +59,7 @@ private void validateCursor(Long lastFestivalId, LocalDate lastStartDate) {
}

@GetMapping("/{festivalId}")
@Operation(description = "특정 축제의 상세 정보를 조회한다.", summary = "특정 축제 상세 조회")
@Operation(description = "축제의 정보를 조회한다.", summary = "축제 정보 조회")
public ResponseEntity<FestivalDetailV1Response> findFestivalDetail(
@PathVariable Long festivalId
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

@RestController
@RequestMapping("/api/v1/popular/festivals")
@Tag(name = "인기 축제 정보 요청 V1")
@Tag(name = "인기 축제 목록 요청 V1")
@RequiredArgsConstructor
public class PopularFestivalV1Controller {

private final PopularFestivalV1QueryService popularFestivalV1QueryService;

@GetMapping
@Operation(description = "인기 축제 목록을 7개 반환한다.", summary = "인기 축제 목록 조회")
public ResponseEntity<PopularFestivalsV1Response> popularFestivals() {
@Operation(description = "인기 축제 목록 7개를 반환한다.", summary = "인기 축제 목록 조회")
public ResponseEntity<PopularFestivalsV1Response> findPopularFestivals() {
return ResponseEntity.ok(popularFestivalV1QueryService.findPopularFestivals());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.festago.auth.annotation.Member;
import com.festago.member.application.MemberService;
import com.festago.member.dto.MemberProfileResponse;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand All @@ -12,6 +13,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Deprecated(forRemoval = true)
@Hidden
@RestController
@RequestMapping("/members")
@Tag(name = "유저 정보 요청")
Expand Down
Loading
Loading