Skip to content

Commit

Permalink
Merge pull request #36 from TUK-SPORTIFY/feat/#35-response-field-add
Browse files Browse the repository at this point in the history
Feat/#35 response field add
  • Loading branch information
froggy-hyun authored Nov 29, 2024
2 parents 548113c + 09ac4ee commit fb60f26
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CreateCrewResponse createCrew(
@Operation(summary = "크루 대표 이미지 설정", description = "Google Cloud Storage에 이미지를 업로드합니다.")
@PostMapping("/images")
@ResponseStatus(HttpStatus.CREATED)
public ImageUploadResponse saveThumbnail(@RequestParam @Parameter(description = "Image 파일") MultipartFile image) throws IOException {
public ImageUploadResponse saveThumbnail(@RequestParam @Parameter(description = "Image 파일") MultipartFile image) {
return imageService.upload(image);
}

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/tuk/sportify/crew/dto/CreateCrewRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

import io.swagger.v3.oas.annotations.media.Schema;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.util.List;

@Schema
public record CreateCrewRequest(
@Schema(description = "크루 이름") String crewName,
@Schema(description = "크루 이름") @NotNull(message = "크루 이름은 필수 입력입니다.") String crewName,
@Size(max = 3, message = "목표는 3개까지 지정 가능합니다.")
@Schema(
description = "목표",
Expand All @@ -23,6 +24,9 @@ public record CreateCrewRequest(
@Size(max = 3, message = "규칙은 3개까지 지정 가능합니다.")
@Schema(description = "규칙", example = "[\"지각하면 벌금\", \"지각 안해도 벌금\", \"그냥 벌금\"]")
List<String> rules,
@Schema(description = "난이도", example = "INTERMEDIATE") DifficultyLevel difficultyLevel,
@Schema(description = "수용 인원", example = "5") Integer capacity,
@Schema(description = "난이도", example = "INTERMEDIATE")
@NotNull(message = "난이도는 필수 입력입니다" + ".")
DifficultyLevel difficultyLevel,
@Schema(description = "수용 인원", example = "5") @NotNull(message = "수용인원은 필수 입력입니다.")
Integer capacity,
@Schema(description = "이미지 ID") Long imageId) {}
2 changes: 1 addition & 1 deletion src/main/java/com/tuk/sportify/member/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class Member {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "member_id", nullable = false)
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public record VoucherDetailResponse(
String subCategory,
String address,
String duration,
Integer price,
List<CrewResponse> crews) {}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ public record VoucherResponse(
@Schema(description = "이용권 세부 카테고리 ex: 태권도, 요가, 필라테스") String subCategory,
@Schema(description = "이용권 주소") String address,
@Schema(description = "이용권 기간") String duration,
@Schema(description = "신청 인원수") Integer requestNumberOfPerson) {}
@Schema(description = "신청 인원수") Integer requestNumberOfPerson,
@Schema(description = "가격") Integer price) {}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public VoucherResponse toVoucherResponse(final SportVoucher sportVoucher) {
.duration(course.getDuration())
.subCategory(sportVoucher.getMiddleCategory().getName())
.requestNumberOfPerson(sportVoucher.getCourse().getRequestNumberOfPerson())
.price(sportVoucher.getCourse().getPrice())
.build();
}

Expand All @@ -51,6 +52,7 @@ public VoucherDetailResponse toVoucherDetailResponse(
.address(facility.getBasicAddress())
.duration(course.getDuration())
.subCategory(sportVoucher.getMiddleCategory().getName())
.price(sportVoucher.getCourse().getPrice())
.build();
}

Expand Down

0 comments on commit fb60f26

Please sign in to comment.