-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] 게시글 업데이트 방식 변경(PUT->PATCH), 게시글 추가 필드 선언 (#176)
* feat: 게시글 Entity 성별, 나이, 봉사 시간 필드 추가 / postReqDto 필드 추가 / Controller @Valid 추가 * refactor: 필요없는 memberId 필드 제거 * refactor: NotBlank 적용 안되는 필드 NotNull로 변경 * refactor: startTime,endTime -> startDate,endDate로 변경 * refactor: assistanceTime, headcount 필드 추가 * feat: assistanceTime, headcount 필드 추가 * refactor: 게시글 조회시 PostResDto 생성 로직 변경 * feat: 업데이트 방식 PUT -> PATCH 변경, @DynamicUpdate 적용 * style: 가독성을 위한 개행 추가 * feat: assistanceStartTime, assistanceEndTime ValueObject 적용 * refactor: AssistanceTime 적용 * refactor: if 에서 삼항연산자로 변경, assistanceTime 업데이트 로직 변경
- Loading branch information
Showing
9 changed files
with
194 additions
and
63 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
29 changes: 29 additions & 0 deletions
29
src/main/java/econo/buddybridge/post/dto/PostUpdateReqDto.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,29 @@ | ||
package econo.buddybridge.post.dto; | ||
|
||
import econo.buddybridge.member.entity.DisabilityType; | ||
import econo.buddybridge.member.entity.Gender; | ||
import econo.buddybridge.post.entity.AssistanceType; | ||
import econo.buddybridge.post.entity.District; | ||
import econo.buddybridge.post.entity.ScheduleType; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Builder | ||
public record PostUpdateReqDto( | ||
String title, | ||
AssistanceType assistanceType, | ||
LocalDateTime startDate, | ||
LocalDateTime endDate, | ||
ScheduleType scheduleType, | ||
String scheduleDetails, | ||
District district, | ||
String content, | ||
DisabilityType disabilityType, | ||
Gender gender, | ||
Integer age, | ||
LocalDateTime assistanceStartTime, | ||
LocalDateTime assistanceEndTime, | ||
Integer headcount | ||
) { | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/econo/buddybridge/post/entity/AssistanceTime.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,23 @@ | ||
package econo.buddybridge.post.entity; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Embeddable | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Builder | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
public class AssistanceTime { | ||
|
||
LocalDateTime assistanceStartTime; | ||
LocalDateTime assistanceEndTime; | ||
} |
Oops, something went wrong.