Skip to content

Commit

Permalink
Merge pull request #395 from tukcomCD2024/fix/branch_merge_error-B-co…
Browse files Browse the repository at this point in the history
…re-#394

fix : 브랜치 병합 오류 수정 #394
  • Loading branch information
GaBaljaintheroom authored May 6, 2024
2 parents 13ebd94 + a56825e commit 385fa33
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.hibernate.validator.constraints.Range;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.CapsuleOpenedResponse;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.ImagesPageResponse;
Expand All @@ -17,6 +19,7 @@
import site.timecapsulearchive.core.global.common.response.ApiSpec;
import site.timecapsulearchive.core.global.error.ErrorResponse;

@Validated
public interface CapsuleApi {

@Operation(
Expand Down Expand Up @@ -55,14 +58,16 @@ ResponseEntity<ImagesPageResponse> getImages(
description = "잘못된 요청 파라미터에 의해 발생"
)
})
ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getNearbyARCapsules(
ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getARNearbyMyCapsules(
Long memberId,

@Parameter(in = ParameterIn.QUERY, description = "위도(wsg84)", required = true)
double longitude,
@Range(min = -90, max = 90, message = "위도는 -90과 90 사이여야 합니다.")
double latitude,

@Parameter(in = ParameterIn.QUERY, description = "경도(wsg84)", required = true)
double latitude,
@Range(min = -180, max = 180, message = "경도는 -180과 180 사이여야 합니다.")
double longitude,

@Parameter(in = ParameterIn.QUERY, description = "조회 거리(km)", required = true)
double distance,
Expand All @@ -87,14 +92,16 @@ ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getNearbyARCapsules(
description = "잘못된 요청 파라미터에 의해 발생"
)
})
ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getNearbyCapsules(
ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getMapNearbyMyCapsules(
Long memberId,

@Parameter(in = ParameterIn.QUERY, description = "위도(wsg84)", required = true)
double longitude,
@Range(min = -90, max = 90, message = "위도는 -90과 90 사이여야 합니다.")
double latitude,

@Parameter(in = ParameterIn.QUERY, description = "경도(wsg84)", required = true)
double latitude,
@Range(min = -180, max = 180, message = "경도는 -180과 180 사이여야 합니다.")
double longitude,

@Parameter(in = ParameterIn.QUERY, description = "조회 거리(km)", required = true)
double distance,
Expand All @@ -103,6 +110,68 @@ ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getNearbyCapsules(
CapsuleType capsuleType
);

@Operation(
summary = "현재 사용자 위치 기준으로 사용자의 친구들의 지도용 캡슐 목록 조회",
description = "지도에서 캡슐을 보기 위해 현재 사용자 위치를 바탕으로 반경 distance km만큼 친구들의 캡슐을 조회한다.",
security = {@SecurityRequirement(name = "user_token")},
tags = {"capsule"}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "200",
description = "처리 완료"
),
@ApiResponse(
responseCode = "400",
description = "잘못된 요청 파라미터에 의해 발생"
)
})
ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getMapNearbyFriendsCapsules(
Long memberId,

@Parameter(in = ParameterIn.QUERY, description = "위도(wsg84)", required = true)
@Range(min = -90, max = 90, message = "위도는 -90과 90 사이여야 합니다.")
double latitude,

@Parameter(in = ParameterIn.QUERY, description = "경도(wsg84)", required = true)
@Range(min = -180, max = 180, message = "경도는 -180과 180 사이여야 합니다.")
double longitude,

@Parameter(in = ParameterIn.QUERY, description = "조회 거리(km)", required = true)
double distance
);

@Operation(
summary = "현재 사용자 위치 기준으로 사용자의 친구들의 AR용 캡슐 목록 조회",
description = "AR 카메라로 캡슐을 보기 위해 현재 사용자 위치를 바탕으로 반경 distance km만큼 친구들의 캡슐을 조회한다.",
security = {@SecurityRequirement(name = "user_token")},
tags = {"capsule"}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "200",
description = "처리 완료"
),
@ApiResponse(
responseCode = "400",
description = "잘못된 요청 파라미터에 의해 발생"
)
})
ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getARNearbyFriendsCapsules(
Long memberId,

@Parameter(in = ParameterIn.QUERY, description = "위도(wsg84)", required = true)
@Range(min = -90, max = 90, message = "위도는 -90과 90 사이여야 합니다.")
double latitude,

@Parameter(in = ParameterIn.QUERY, description = "경도(wsg84)", required = true)
@Range(min = -180, max = 180, message = "경도는 -180과 180 사이여야 합니다.")
double longitude,

@Parameter(in = ParameterIn.QUERY, description = "조회 거리(km)", required = true)
double distance
);

@Operation(
summary = "캡슐 열람 상태로 변경",
description = "캡슐을 열람 상태를 변경해준다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public ResponseEntity<ImagesPageResponse> getImages(final Long size, final Long
return null;
}

@GetMapping(value = "/nearby/ar", produces = {"application/json"})
@GetMapping(value = "/my/ar/nearby", produces = {"application/json"})
@Override
public ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getNearbyARCapsules(
public ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getARNearbyMyCapsules(
@AuthenticationPrincipal final Long memberId,
@RequestParam(value = "latitude") final double latitude,
@RequestParam(value = "longitude") final double longitude,
Expand All @@ -68,9 +68,9 @@ public ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getNearbyARCapsules(
);
}

@GetMapping(value = "/nearby", produces = {"application/json"})
@GetMapping(value = "/my/map/nearby", produces = {"application/json"})
@Override
public ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getNearbyCapsules(
public ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getMapNearbyMyCapsules(
@AuthenticationPrincipal final Long memberId,
@RequestParam(value = "latitude") final double latitude,
@RequestParam(value = "longitude") final double longitude,
Expand All @@ -91,6 +91,52 @@ public ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getNearbyCapsules(
);
}

@GetMapping(value = "/friends/map/nearby", produces = {"application/json"})
@Override
public ResponseEntity<ApiSpec<NearbyCapsuleResponse>> getMapNearbyFriendsCapsules(
@AuthenticationPrincipal final Long memberId,
@RequestParam(value = "latitude") final double latitude,
@RequestParam(value = "longitude") final double longitude,
@RequestParam(value = "distance") final double distance
) {
final List<NearbyCapsuleSummaryDto> capsules = capsuleService.findFriendsCapsulesByCurrentLocation(
memberId,
CoordinateRangeDto.from(latitude, longitude, distance)
);

return ResponseEntity.ok(
ApiSpec.success(
SuccessCode.SUCCESS,
NearbyCapsuleResponse.createOf(capsules, geoTransformManager::changePoint3857To4326)
)
);
}

@GetMapping(value = "/friends/ar/nearby", produces = {"application/json"})
@Override
public ResponseEntity<ApiSpec<NearbyARCapsuleResponse>> getARNearbyFriendsCapsules(
@AuthenticationPrincipal final Long memberId,
@RequestParam(value = "latitude") final double latitude,
@RequestParam(value = "longitude") final double longitude,
@RequestParam(value = "distance") final double distance
) {
final List<NearbyARCapsuleSummaryDto> capsules = capsuleService.findFriendsARCapsulesByCurrentLocation(
memberId,
CoordinateRangeDto.from(latitude, longitude, distance)
);

return ResponseEntity.ok(
ApiSpec.success(
SuccessCode.SUCCESS,
NearbyARCapsuleResponse.createOf(
capsules,
geoTransformManager::changePoint3857To4326,
s3PreSignedUrlManager::getS3PreSignedUrlForGet
)
)
);
}

@PatchMapping(value = "/{capsule_id}/opened", produces = {"application/json"})
@Override
public ResponseEntity<ApiSpec<CapsuleOpenedResponse>> updateCapsuleOpened(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package site.timecapsulearchive.core.common.fixture;
package site.timecapsulearchive.core.common.fixture.domain;

import site.timecapsulearchive.core.domain.group.entity.Group;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package site.timecapsulearchive.core.common.fixture;
package site.timecapsulearchive.core.common.fixture.domain;

import site.timecapsulearchive.core.domain.group.entity.Group;
import site.timecapsulearchive.core.domain.group.entity.MemberGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.springframework.test.context.TestConstructor.AutowireMode;
import org.springframework.transaction.annotation.Transactional;
import site.timecapsulearchive.core.common.RepositoryTest;
import site.timecapsulearchive.core.common.fixture.GroupFixture;
import site.timecapsulearchive.core.common.fixture.MemberGroupFixture;
import site.timecapsulearchive.core.common.fixture.domain.GroupFixture;
import site.timecapsulearchive.core.common.fixture.domain.MemberGroupFixture;
import site.timecapsulearchive.core.common.fixture.domain.CapsuleFixture;
import site.timecapsulearchive.core.common.fixture.domain.CapsuleSkinFixture;
import site.timecapsulearchive.core.common.fixture.domain.MemberFixture;
Expand Down

0 comments on commit 385fa33

Please sign in to comment.