-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [chore] : 질문글 추천 API SWAGGER 명세 * [feat] : 질문 수정 응답 dto 추가 * [rename] : 질문 수정 응답 dto 컨벤션에 맞게 네이밍 변경 * [refactor] : dto 팩토리 메서드 제거 * [feat] : 질문글 업데이트 dto 추가 * [fix] : dto mapper에 이미지, url null일 때 검증 로직 추가 * [feat] : 이미지 일괄 삭제를 위한 repository 추가 * [feat] : 업데이트 dto mapper 함수 추가 * [feat] : 엔티티 내 필드 업데이트 로직 추가 * [feat] : 질문글 업데이트 비즈니스 로직 작성 * [feat] : 질문글 업데이트 API 메서드 작성 * [test] : 요구사항 validation 맞게 fixture 수정 * [fix] : 이미지 삭제 시 질문글 내 이미지 리스트 비우는 로직 추가 * [fix] : 컨트롤러 누락된 어노테이션 추가 * [fix] : 리스트 데이터 변경 불가 예외 해결 * [test] : 질문글 업데이트 단위 테스트 작성 * [test] : 질문글 업데이트 통합 테스트 작성 * [style] : 코드 리포멧팅 * [feat] : null 대신 새 ArrayList 할당
- Loading branch information
Showing
11 changed files
with
322 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/dnd/gongmuin/question_post/dto/request/UpdateQuestionPostRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.dnd.gongmuin.question_post.dto.request; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Size; | ||
|
||
public record UpdateQuestionPostRequest( | ||
|
||
@Size(min = 2, max = 20, message = "제목은 2자 이상 20자 이하여야 합니다.") | ||
String title, | ||
|
||
@Size(min = 10, max = 200, message = "본문은 10자 이상 200자 이하여야 합니다.") | ||
String content, | ||
|
||
List<String> imageUrls, | ||
|
||
@Min(value = 2_000, message = "리워드는 2000 이상이어야 합니다.") | ||
@Max(value = 10_000, message = "리워드는 10000 이하여야 합니다.") | ||
int reward, | ||
|
||
@NotBlank(message = "직군을 입력해주세요.") | ||
String targetJobGroup | ||
) { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/dnd/gongmuin/question_post/dto/response/UpdateQuestionPostResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.dnd.gongmuin.question_post.dto.response; | ||
|
||
import java.util.List; | ||
|
||
public record UpdateQuestionPostResponse( | ||
Long questionPostId, | ||
String title, | ||
String content, | ||
List<String> imageUrls, | ||
int reward, | ||
String targetJobGroup | ||
) { | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/dnd/gongmuin/question_post/repository/QuestionPostImageRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.dnd.gongmuin.question_post.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.dnd.gongmuin.question_post.domain.QuestionPost; | ||
import com.dnd.gongmuin.question_post.domain.QuestionPostImage; | ||
|
||
public interface QuestionPostImageRepository extends JpaRepository<QuestionPostImage, Long> { | ||
void deleteByQuestionPost(QuestionPost questionPost); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.