Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
changed Writer Status : DEFAULT -> PERMITTED #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingadinga committed Aug 28, 2022
1 parent 7ee48bd commit ac1d053
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/java/com/team20/t4/plan/PlanService.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ public Long updateProgressState(Long planId, Progress newProgress) {
* RegisterHistory 관련 CRUD
* */

public void sendAppointmentRequestOfWriter(RegisterHistorySaveRequestDto dto) {
RegisterHistory historyEntity = RegisterHistory.builder()
.applicant(dto.getApplicant())
.state(State.PERMITTED)
.plan(dto.getPlan())
.build();
registerHistoryRepository.save(historyEntity);
}

// 밥약 신청(RegisterHistory 생성)
@Transactional
public Long sendAppointmentRequest(RegisterHistorySaveRequestDto dto) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/team20/t4/post/PostService.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class PostService {
public Long savePost(PostSaveRequestDto requestDto){
Member loginedMember = memberService.getLoginedMember();
Plan plan = planService.createPlan(requestDto.getPlan(), loginedMember);
planService.sendAppointmentRequest(new RegisterHistorySaveRequestDto(loginedMember, plan));
planService.sendAppointmentRequestOfWriter(new RegisterHistorySaveRequestDto(loginedMember, plan));

PostSaveRequestVo saveRequestVo = PostSaveRequestVo.of(requestDto);
saveRequestVo.updateWriter(loginedMember);
Expand Down

0 comments on commit ac1d053

Please sign in to comment.