Skip to content

Commit

Permalink
chore: 머지 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed May 5, 2024
2 parents 87b2002 + 1e101f6 commit aa927ad
Show file tree
Hide file tree
Showing 34 changed files with 1,322 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.http.ResponseEntity;
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.request.CapsuleCreateRequest;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.CapsuleOpenedResponse;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.ImagesPageResponse;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.NearbyARCapsuleResponse;
Expand Down Expand Up @@ -127,59 +126,5 @@ ResponseEntity<ApiSpec<CapsuleOpenedResponse>> updateCapsuleOpened(
@Parameter(in = ParameterIn.PATH, description = "캡슐 아이디", required = true)
Long capsuleId
);

@Operation(
summary = "비밀 캡슐 생성",
description = "사용자만 볼 수 있는 비밀 캡슐을 생성한다.",
security = {@SecurityRequirement(name = "user_token")},
tags = {"secret capsule"}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "202",
description = "처리 시작"
),
@ApiResponse(
responseCode = "400",
description = "좌표변환을 할 수 없을 때 발생하는 예외, 입력좌표 확인 요망",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "404",
description = "캡슐 스킨을 찾을 수 없을 경우 발생하는 예외",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
ResponseEntity<ApiSpec<String>> createSecretCapsule(
Long memberId,
CapsuleCreateRequest request
);

@Operation(
summary = "공개 캡슐 생성",
description = "사용자의 친구들만 볼 수 있는 공개 캡슐을 생성한다.",
security = {@SecurityRequirement(name = "user_token")},
tags = {"public capsule"}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "202",
description = "처리 시작"
),
@ApiResponse(
responseCode = "400",
description = "좌표변환을 할 수 없을 때 발생하는 예외, 입력좌표 확인 요망",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "404",
description = "캡슐 스킨을 찾을 수 없을 경우 발생하는 예외",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
ResponseEntity<ApiSpec<String>> createPublicCapsule(
Long memberId,
CapsuleCreateRequest request
);
}

Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package site.timecapsulearchive.core.domain.capsule.generic_capsule.api;

import jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.dto.CoordinateRangeDto;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.dto.NearbyARCapsuleSummaryDto;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.dto.NearbyCapsuleSummaryDto;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.request.CapsuleCreateRequest;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.CapsuleOpenedResponse;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.ImagesPageResponse;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.NearbyARCapsuleResponse;
Expand Down Expand Up @@ -109,32 +105,4 @@ public ResponseEntity<ApiSpec<CapsuleOpenedResponse>> updateCapsuleOpened(
);
}

@PostMapping(value = "/secret", consumes = {"application/json"})
@Override
public ResponseEntity<ApiSpec<String>> createSecretCapsule(
@AuthenticationPrincipal final Long memberId,
@Valid @RequestBody final CapsuleCreateRequest request
) {
capsuleFacade.saveCapsule(memberId, request.toDto(), CapsuleType.SECRET);

return ResponseEntity.ok(
ApiSpec.empty(
SuccessCode.SUCCESS
)
);
}

@PostMapping(value = "/public", consumes = {"application/json"})
@Override
public ResponseEntity<ApiSpec<String>> createPublicCapsule(
@AuthenticationPrincipal final Long memberId,
@Valid @RequestBody final CapsuleCreateRequest request) {
capsuleFacade.saveCapsule(memberId, request.toDto(), CapsuleType.PUBLIC);

return ResponseEntity.ok(
ApiSpec.empty(
SuccessCode.SUCCESS
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.locationtech.jts.geom.Point;
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType;
import site.timecapsulearchive.core.domain.capsule.generic_capsule.data.response.NearbyARCapsuleSummaryResponse;
import site.timecapsulearchive.core.global.common.response.ResponseMappingConstant;

public record NearbyARCapsuleSummaryDto(
Long id,
Expand All @@ -18,12 +17,6 @@ public record NearbyARCapsuleSummaryDto(
CapsuleType capsuleType
) {

public NearbyARCapsuleSummaryDto {
if (dueDate != null) {
dueDate = dueDate.withZoneSameInstant(ResponseMappingConstant.ZONE_ID);
}
}

public NearbyARCapsuleSummaryResponse toResponse(
final Function<Point, Point> geoTransformFunction,
final Function<String, String> preSignUrlFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.time.ZonedDateTime;
import lombok.Builder;
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType;
import site.timecapsulearchive.core.global.common.response.ResponseMappingConstant;

@Schema(description = "AR 캡슐 요약 정보")
@Builder
Expand All @@ -12,12 +13,12 @@ public record NearbyARCapsuleSummaryResponse(
@Schema(description = "캡슐 아이디")
Long id,

@Schema(description = "캡슐 경도 좌표")
Double longitude,

@Schema(description = "캡슐 위도 좌표")
Double latitude,

@Schema(description = "캡슐 경도 좌표")
Double longitude,

@Schema(description = "생성자 닉네임")
String nickname,

Expand All @@ -34,4 +35,9 @@ public record NearbyARCapsuleSummaryResponse(
CapsuleType capsuleType
) {

public NearbyARCapsuleSummaryResponse {
if (dueDate != null) {
dueDate = dueDate.withZoneSameInstant(ResponseMappingConstant.ZONE_ID);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public record NearbyCapsuleSummaryResponse(
@Schema(description = "캡슐 아이디")
Long id,

@Schema(description = "캡슐 경도 좌표")
Double longitude,

@Schema(description = "캡슐 위도 좌표")
Double latitude,

@Schema(description = "캡슐 경도 좌표")
Double longitude,

@Schema(description = "캡슐 타입")
CapsuleType capsuleType
) {
Expand Down
Loading

0 comments on commit aa927ad

Please sign in to comment.