Skip to content

Commit 9729075

Browse files
authored
Merge pull request #198 from prgrms-web-devcourse-final-project/feature/EA3-161-study-image
[EA3-161] refactor: 스터디 생성, 수정 request imageUrl 필드 삭제
2 parents 07a6197 + 4f0cdb8 commit 9729075

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

src/main/java/grep/neogulcoder/domain/study/controller/StudyController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public ApiResponse<Long> createStudy(@RequestPart("request") @Valid StudyCreateR
7777
return ApiResponse.success(id);
7878
}
7979

80-
@PutMapping("/{studyId}")
80+
@PutMapping(value = "/{studyId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
8181
public ApiResponse<Void> updateStudy(@PathVariable("studyId") Long studyId,
8282
@RequestPart @Valid StudyUpdateRequest request,
8383
@RequestPart(value = "image", required = false) MultipartFile image,

src/main/java/grep/neogulcoder/domain/study/controller/dto/request/StudyCreateRequest.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class StudyCreateRequest {
3535
private String location;
3636

3737
@NotNull
38-
@Schema(description = "시작일", example = "2025-07-15")
38+
@Schema(description = "시작일", example = "2025-07-25T10:00:00")
3939
private LocalDateTime startDate;
4040

4141
@NotNull
@@ -45,14 +45,11 @@ public class StudyCreateRequest {
4545
@Schema(description = "스터디 소개", example = "자바 스터디입니다.")
4646
private String introduction;
4747

48-
@Schema(description = "대표 이미지", example = "http://localhost:8083/image.jpg")
49-
private String imageUrl;
50-
5148
private StudyCreateRequest() {}
5249

5350
@Builder
5451
private StudyCreateRequest(String name, Category category, int capacity, StudyType studyType, String location,
55-
LocalDateTime startDate, LocalDateTime endDate, String introduction, String imageUrl) {
52+
LocalDateTime startDate, LocalDateTime endDate, String introduction) {
5653
this.name = name;
5754
this.category = category;
5855
this.capacity = capacity;
@@ -61,20 +58,19 @@ private StudyCreateRequest(String name, Category category, int capacity, StudyTy
6158
this.startDate = startDate;
6259
this.endDate = endDate;
6360
this.introduction = introduction;
64-
this.imageUrl = imageUrl;
6561
}
6662

6763
public Study toEntity(String imageUrl) {
6864
return Study.builder()
69-
.name(this.name)
70-
.category(this.category)
71-
.capacity(this.capacity)
72-
.studyType(this.studyType)
73-
.location(this.location)
74-
.startDate(this.startDate)
75-
.endDate(this.endDate)
76-
.introduction(this.introduction)
77-
.imageUrl(imageUrl)
78-
.build();
65+
.name(this.name)
66+
.category(this.category)
67+
.capacity(this.capacity)
68+
.studyType(this.studyType)
69+
.location(this.location)
70+
.startDate(this.startDate)
71+
.endDate(this.endDate)
72+
.introduction(this.introduction)
73+
.imageUrl(imageUrl)
74+
.build();
7975
}
8076
}

src/main/java/grep/neogulcoder/domain/study/controller/dto/request/StudyUpdateRequest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,18 @@ public class StudyUpdateRequest {
3838
@Schema(description = "스터디 소개", example = "자바 스터디입니다.")
3939
private String introduction;
4040

41-
@Schema(description = "대표 이미지", example = "http://localhost:8083/image.jpg")
42-
private String imageUrl;
43-
4441
private StudyUpdateRequest() {}
4542

4643
@Builder
47-
private StudyUpdateRequest(String name, Category category, int capacity, StudyType studyType, String location,
48-
LocalDateTime startDate, String introduction, String imageUrl) {
44+
private StudyUpdateRequest(String name, Category category, int capacity, StudyType studyType,
45+
String location, LocalDateTime startDate, String introduction) {
4946
this.name = name;
5047
this.category = category;
5148
this.capacity = capacity;
5249
this.studyType = studyType;
5350
this.location = location;
5451
this.startDate = startDate;
5552
this.introduction = introduction;
56-
this.imageUrl = imageUrl;
5753
}
5854

5955
public Study toEntity(String imageUrl) {

0 commit comments

Comments
 (0)