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

[WALWAL-167] Mission Response 및 API PathVariable 수정 #91

Merged
merged 3 commits into from
Aug 6, 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
Expand Up @@ -27,9 +27,6 @@ public class Mission extends BaseTimeEntity {
@Column(name = "illustration_url")
private String illustrationUrl;

@Column(name = "hex_color")
private String hexColor;

@Builder
public Mission(String title) {
this.title = title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ public record MissionGetTodayResponse(
@Schema(description = "미션 제목", example = "산책하기")
@NotBlank(message = "Title cannot be blank")
String title,
@Schema(description = "일러스트 이미지 URL", example = "https://example.com/image.jpeg")
String illustrationUrl,
@Schema(description = "Hex 색상 값", example = "#FFFFFF") String hexColor) {
@Schema(description = "일러스트 이미지 URL", example = "https://image.walwal.life/image.jpeg")
String illustrationUrl) {

public static MissionGetTodayResponse from(Mission mission) {
return new MissionGetTodayResponse(
mission.getId(),
mission.getTitle(),
mission.getIllustrationUrl(),
mission.getHexColor());
mission.getId(), mission.getTitle(), mission.getIllustrationUrl());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ResponseEntity<Void> startMission(@PathVariable("missionId") Long mission
}

@Operation(summary = "미션 기록 저장", description = "미션 완료 후 기록을 저장한다.")
@PostMapping
@PostMapping("/{missionId}")
public ResponseEntity<Void> saveMission(@PathVariable("missionId") Long missionId) {
missionRecordService.saveMission(missionId);
return ResponseEntity.ok().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public void setUp() {
public void 오늘의_미션_조회_성공() throws Exception {
// Given
MissionGetTodayResponse missionGetTodayResponse =
new MissionGetTodayResponse(
1L, "Test Mission", "https://example.com/image.png", "#FFFFFF");
new MissionGetTodayResponse(1L, "Test Mission", "https://example.com/image.png");
when(missionService.getOrCreateTodayMission()).thenReturn(missionGetTodayResponse);

// When & Then
Expand Down
Loading