Skip to content

Commit

Permalink
feat: 랜드마크 최대점수 유저 찾기 API Swagger 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed Dec 20, 2023
1 parent f1053dc commit a16b5ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class LandmarkApi {

@GetMapping
@Operation(summary = "가장 가까운 랜드마크 찾기",
description = "인식 반경 내에 있는 랜드마크 중 가장 가까운 랜드마크를 반환합니다." +
description = "인식 반경 내에 있는 랜드마크 중 가장 가까운 랜드마크를 반환합니다. " +
"인식 반경에 랜드마크가 없을 경우 아무것도 반환하지 않습니다.")
public ApiResponse<NearestLandmarkResponse> LandmarkFindNear(@RequestParam @Latitude Double latitude,
@RequestParam @Longitude Double longitude) {
Expand All @@ -33,6 +33,9 @@ public ApiResponse<NearestLandmarkResponse> LandmarkFindNear(@RequestParam @Lati
}

@GetMapping("/{landmarkId}/highest")
@Operation(summary = "해당 랜드마크의 최고점 사용자 찾기",
description = "해당 랜드마크에서 가장 높은 점수를 획득한 사용자를 반환합니다. " +
"방문한 유저가 한명도 없으면 아무것도 반환하지 않습니다. 점수가 같은 유저가 있다면 먼저 해당 점수를 달성한 유저를 반환합니다.")
public ApiResponse<LandmarkHighestScoreUser> findHighestUserByLandmark(@PathVariable Long landmarkId) {
LandmarkHighestScoreUser response = landmarkScoreService.findHighestScoreUserByLandmark(landmarkId);
return ApiUtils.success(response);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package com.playkuround.playkuroundserver.domain.landmark.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
public class LandmarkHighestScoreUser {
@Schema(description = "사용자 닉네임", example = "내가제일이다")
private String nickname;
@Schema(description = "최고 점수", example = "294")
private Long score;

public static LandmarkHighestScoreUser createEmptyResponse() {
Expand Down

0 comments on commit a16b5ff

Please sign in to comment.