Skip to content

Commit

Permalink
[REFACTOR] 게시글 작성 시 요청한 회원의 정보로 작성자 정보 저장 (#213)
Browse files Browse the repository at this point in the history
refactor: 게시글의 작성자 정보를 회원 정보에서 가져오도록 수정
  • Loading branch information
Profile-exe authored Nov 26, 2024
1 parent 395da7f commit 27117e7
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/main/java/econo/buddybridge/post/dto/PostReqDto.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package econo.buddybridge.post.dto;

import econo.buddybridge.member.entity.DisabilityType;
import econo.buddybridge.member.entity.Gender;
import econo.buddybridge.member.entity.Member;
import econo.buddybridge.post.entity.AssistanceTime;
import econo.buddybridge.post.entity.AssistanceType;
Expand Down Expand Up @@ -43,17 +41,9 @@ public record PostReqDto(
@NotBlank(message = "상세 내용을 입력해주세요.")
String content,

@NotNull(message = "게시글 종류를 선택해주세요. TAKER or GIVER")
PostType postType,

@NotNull(message = "장애 종류를 선택해주세요.")
DisabilityType disabilityType,

@NotNull(message = "성별을 선택해주세요.")
Gender gender,

@NotNull(message = "나이를 입력해주세요.")
Integer age,

@NotNull(message = "봉사 시작 시간을 입력해주세요.")
LocalTime assistanceStartTime,

Expand All @@ -79,9 +69,9 @@ public Post toEntity(Member author) {
.content(content)
.postType(postType)
.postStatus(PostStatus.RECRUITING)
.disabilityType(disabilityType)
.gender(gender)
.age(age)
.disabilityType(author.getDisabilityType())
.gender(author.getGender())
.age(author.getAge())
.assistanceTime(AssistanceTime.builder()
.assistanceStartTime(assistanceStartTime)
.assistanceEndTime(assistanceEndTime)
Expand Down

0 comments on commit 27117e7

Please sign in to comment.