diff --git a/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes$OAuthAttributesBuilder.class b/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes$OAuthAttributesBuilder.class index 4e405a9..11f6ba4 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes$OAuthAttributesBuilder.class and b/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes$OAuthAttributesBuilder.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes.class b/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes.class index d82ef63..eaa6775 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes.class and b/build/classes/java/main/com/mAInd/springboot/config/auth/dto/OAuthAttributes.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/Surveys/ApplyStatus.class b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/ApplyStatus.class new file mode 100644 index 0000000..0ddca86 Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/ApplyStatus.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys$SurveysBuilder.class b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys$SurveysBuilder.class index d9d58fe..5a25b12 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys$SurveysBuilder.class and b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys$SurveysBuilder.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys.class b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys.class index 059f5f5..29be9ce 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys.class and b/build/classes/java/main/com/mAInd/springboot/domain/Surveys/Surveys.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageController.class b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageController.class new file mode 100644 index 0000000..b63422a Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageController.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageRepository.class b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageRepository.class new file mode 100644 index 0000000..8b813a4 Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageRepository.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageResponseDto.class b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageResponseDto.class new file mode 100644 index 0000000..2e3d033 Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageResponseDto.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageService.class b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageService.class new file mode 100644 index 0000000..e8d05f5 Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/mypage/MyPageService.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/user/UserStatus.class b/build/classes/java/main/com/mAInd/springboot/domain/user/UserStatus.class new file mode 100644 index 0000000..0fd9664 Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/domain/user/UserStatus.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/user/Users$UsersBuilder.class b/build/classes/java/main/com/mAInd/springboot/domain/user/Users$UsersBuilder.class index a328f4c..b1f63f7 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/domain/user/Users$UsersBuilder.class and b/build/classes/java/main/com/mAInd/springboot/domain/user/Users$UsersBuilder.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/domain/user/Users.class b/build/classes/java/main/com/mAInd/springboot/domain/user/Users.class index e52b451..79ee570 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/domain/user/Users.class and b/build/classes/java/main/com/mAInd/springboot/domain/user/Users.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/service/surveys/SurveysService.class b/build/classes/java/main/com/mAInd/springboot/service/surveys/SurveysService.class index 130d125..a5129a6 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/service/surveys/SurveysService.class and b/build/classes/java/main/com/mAInd/springboot/service/surveys/SurveysService.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/SurveysApiController.class b/build/classes/java/main/com/mAInd/springboot/web/SurveysApiController.class index ae2d8af..eb34c38 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/SurveysApiController.class and b/build/classes/java/main/com/mAInd/springboot/web/SurveysApiController.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysListResponseDto.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysListResponseDto.class index 962a5b8..3f91e36 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysListResponseDto.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysListResponseDto.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysResponseDto.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysResponseDto.class index 47f211d..74bdf15 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysResponseDto.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysResponseDto.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto$SurveysSaveRequestDtoBuilder.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto$SurveysSaveRequestDtoBuilder.class index 5dfbcf8..3456a7c 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto$SurveysSaveRequestDtoBuilder.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto$SurveysSaveRequestDtoBuilder.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.class index e478949..0579493 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.class new file mode 100644 index 0000000..5489d5e Binary files /dev/null and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto$SurveysUpdateRequestDtoBuilder.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto$SurveysUpdateRequestDtoBuilder.class index d47461d..2033133 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto$SurveysUpdateRequestDtoBuilder.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto$SurveysUpdateRequestDtoBuilder.class differ diff --git a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.class b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.class index 5d97b5d..50c8f67 100644 Binary files a/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.class and b/build/classes/java/main/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.class differ diff --git a/src/main/java/com/mAInd/springboot/config/auth/dto/OAuthAttributes.java b/src/main/java/com/mAInd/springboot/config/auth/dto/OAuthAttributes.java index 2dc5ee1..36be4f3 100644 --- a/src/main/java/com/mAInd/springboot/config/auth/dto/OAuthAttributes.java +++ b/src/main/java/com/mAInd/springboot/config/auth/dto/OAuthAttributes.java @@ -1,6 +1,7 @@ package com.mAInd.springboot.config.auth.dto; import com.mAInd.springboot.domain.user.Role; +import com.mAInd.springboot.domain.user.UserStatus; import com.mAInd.springboot.domain.user.Users; import lombok.Builder; import lombok.Getter; @@ -52,6 +53,7 @@ public Users toEntity() { .email(email) .picture(picture) .role(Role.CLIENT) + .userStatus(UserStatus.BEFORE_SURVEY) .build(); } } diff --git a/src/main/java/com/mAInd/springboot/domain/mypage/MyPageController.java b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageController.java new file mode 100644 index 0000000..a54af83 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageController.java @@ -0,0 +1,4 @@ +package com.mAInd.springboot.domain.mypage; + +public class MyPageController { +} diff --git a/src/main/java/com/mAInd/springboot/domain/mypage/MyPageRepository.java b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageRepository.java new file mode 100644 index 0000000..e8b735d --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageRepository.java @@ -0,0 +1,10 @@ +package com.mAInd.springboot.domain.mypage; + +import com.mAInd.springboot.domain.user.Users; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +public interface MyPageRepository extends JpaRepository { + + +} diff --git a/src/main/java/com/mAInd/springboot/domain/mypage/MyPageResponseDto.java b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageResponseDto.java new file mode 100644 index 0000000..c8bcd26 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageResponseDto.java @@ -0,0 +1,23 @@ +package com.mAInd.springboot.domain.mypage; + +import com.mAInd.springboot.domain.user.Users; +import lombok.Getter; + +import java.time.LocalDateTime; +import java.util.Date; + +@Getter +public class MyPageResponseDto { + + private String name; + private String email; + private LocalDateTime createdDate; + + public MyPageResponseDto(Users entity){ + this.name = entity.getName(); + this.email = entity.getEmail(); + this.createdDate = entity.getCreatedDate(); + } + + +} diff --git a/src/main/java/com/mAInd/springboot/domain/mypage/MyPageService.java b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageService.java new file mode 100644 index 0000000..cc57611 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/mypage/MyPageService.java @@ -0,0 +1,16 @@ +package com.mAInd.springboot.domain.mypage; + +import com.mAInd.springboot.domain.user.UserRepository; +import com.mAInd.springboot.domain.user.Users; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@RequiredArgsConstructor +@Service +public class MyPageService { + + private final UserRepository userRepository; + + +} + diff --git a/src/main/java/com/mAInd/springboot/domain/surveys/ApplyStatus.java b/src/main/java/com/mAInd/springboot/domain/surveys/ApplyStatus.java new file mode 100644 index 0000000..1d1e693 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/surveys/ApplyStatus.java @@ -0,0 +1,17 @@ +package com.mAInd.springboot.domain.surveys; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum ApplyStatus { + BEFORE("BEFORE", "상담사 확인 전"), + ACCEPT("ACCEPT", "상담 승인"), + HOLD("HOLD", "상담 보류"), + REJECT("REJECT", "상담 반려"); + + private final String key; + private final String title; +} diff --git a/src/main/java/com/mAInd/springboot/domain/surveys/Surveys.java b/src/main/java/com/mAInd/springboot/domain/surveys/Surveys.java index a178f8f..330c757 100644 --- a/src/main/java/com/mAInd/springboot/domain/surveys/Surveys.java +++ b/src/main/java/com/mAInd/springboot/domain/surveys/Surveys.java @@ -2,14 +2,20 @@ import com.mAInd.springboot.domain.BaseTimeEntity; import com.mAInd.springboot.domain.surveys.Gender; +import com.mAInd.springboot.domain.user.Users; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import net.minidev.json.annotate.JsonIgnore; +import org.apache.tomcat.jni.Local; import javax.persistence.*; +import java.time.LocalDateTime; import java.util.Date; import java.util.List; +import static javax.persistence.FetchType.LAZY; + @Getter @NoArgsConstructor @Entity @@ -51,22 +57,32 @@ public class Surveys extends BaseTimeEntity { private String q_6; private String q_7; private String q_8; - private String q_9; - private String q_10; - private String q_11; - @Column(nullable = true) - private Long client_id; +// @Column(nullable = true) +// private Long client_id; + + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "client_id", nullable = true) + @JsonIgnore + private Users client_id; @Column(nullable = true) private Long counselor_id; + @Enumerated(EnumType.STRING) + @Column + private ApplyStatus applyStatus; + + @Column + private LocalDateTime statusDate; + @Builder public Surveys(String name, Gender gender, String email, Date birth, String phone, String education, List symptoms, - String q_1, String q_2, String q_3, String q_4, String q_5, String q_6, - String q_7, String q_8, String q_9, String q_10, String q_11, Long client_id, Long counselor_id) { + String q_1, String q_2, String q_3, String q_4, String q_5, String q_6, + String q_7, String q_8, Users client_id, Long counselor_id, + ApplyStatus applyStatus, LocalDateTime statusDate) { this.name = name; this.gender = gender; this.email = email; @@ -82,17 +98,15 @@ public Surveys(String name, Gender gender, String email, Date birth, this.q_6 = q_6; this.q_7 = q_7; this.q_8 = q_8; - this.q_9 = q_9; - this.q_10 = q_10; - this.q_11 = q_11; this.client_id = client_id; this.counselor_id = counselor_id; + this.applyStatus = applyStatus; + this.statusDate = statusDate; } public void update(String name, Gender gender, String email, Date birth, String phone, String education, List symptoms, String q_1, String q_2, - String q_3, String q_4, String q_5, String q_6, String q_7, - String q_8, String q_9, String q_10, String q_11){ + String q_3, String q_4, String q_5, String q_6, String q_7, String q_8){ this.name = name; this.gender = gender; this.email = email; @@ -108,9 +122,6 @@ public void update(String name, Gender gender, String email, Date birth, this.q_6 = q_6; this.q_7 = q_7; this.q_8 = q_8; - this.q_9 = q_9; - this.q_10 = q_10; - this.q_11 = q_11; } } diff --git a/src/main/java/com/mAInd/springboot/domain/surveys/SurveysRepository.java b/src/main/java/com/mAInd/springboot/domain/surveys/SurveysRepository.java index d7030d0..a845f24 100644 --- a/src/main/java/com/mAInd/springboot/domain/surveys/SurveysRepository.java +++ b/src/main/java/com/mAInd/springboot/domain/surveys/SurveysRepository.java @@ -1,11 +1,16 @@ package com.mAInd.springboot.domain.surveys; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import javax.transaction.Transactional; import java.util.List; public interface SurveysRepository extends JpaRepository { @Query("SELECT s FROM Surveys s ORDER BY s.id DESC") List findAllDesc(); + + } diff --git a/src/main/java/com/mAInd/springboot/domain/user/UserStatus.java b/src/main/java/com/mAInd/springboot/domain/user/UserStatus.java new file mode 100644 index 0000000..15c7111 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/domain/user/UserStatus.java @@ -0,0 +1,15 @@ +package com.mAInd.springboot.domain.user; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum UserStatus { + BEFORE_SURVEY("BEFORE_SURVEY", "설문지 작성 전"), + ON_MATCHING("ON_MATCHING", "매칭 중"), + AFTER_MATCHING("AFTER_MATCHING", "매칭 완료"); + + private final String key; + private final String title; +} \ No newline at end of file diff --git a/src/main/java/com/mAInd/springboot/domain/user/Users.java b/src/main/java/com/mAInd/springboot/domain/user/Users.java index e2aa943..8f1d85e 100644 --- a/src/main/java/com/mAInd/springboot/domain/user/Users.java +++ b/src/main/java/com/mAInd/springboot/domain/user/Users.java @@ -29,6 +29,10 @@ public class Users extends BaseTimeEntity { @Column(nullable = false) private Role role; + @Enumerated(EnumType.STRING) + @Column + private UserStatus userStatus; + // private String refreshToken; // @OneToOne(fetch = FetchType.LAZY) @@ -36,11 +40,12 @@ public class Users extends BaseTimeEntity { // private Profiles profile_id; @Builder - public Users(String name, String email, String picture, Role role){ + public Users(String name, String email, String picture, Role role, UserStatus userStatus){ this.name = name; this.email = email; this.picture = picture; this.role = role; + this.userStatus = userStatus; } public Users update(String name, String picture){ diff --git a/src/main/java/com/mAInd/springboot/service/surveys/SurveysService.java b/src/main/java/com/mAInd/springboot/service/surveys/SurveysService.java index ecf0730..ad8afcc 100644 --- a/src/main/java/com/mAInd/springboot/service/surveys/SurveysService.java +++ b/src/main/java/com/mAInd/springboot/service/surveys/SurveysService.java @@ -30,8 +30,7 @@ public Long update(Long survey_id, SurveysUpdateRequestDto requestDto){ requestDto.getBirth(), requestDto.getPhone(), requestDto.getEducation(), requestDto.getSymptoms(), requestDto.getQ_1(), requestDto.getQ_2(), requestDto.getQ_3(), requestDto.getQ_4(), requestDto.getQ_5(), requestDto.getQ_6(), - requestDto.getQ_7(), requestDto.getQ_8(), requestDto.getQ_9(), - requestDto.getQ_10(), requestDto.getQ_11()); + requestDto.getQ_7(), requestDto.getQ_8()); return survey_id; } @@ -51,6 +50,15 @@ public SurveysResponseDto findById(Long survey_id){ return new SurveysResponseDto(entity); } + + @Transactional + public SurveysStatusResponseDto findById2(Long survey_id){ + Surveys entity = surveysRepository.findById(survey_id) + .orElseThrow(()-> new + IllegalArgumentException("해당 설문지가 없습니다. survey_id=" + survey_id)); + return new SurveysStatusResponseDto(entity); + } + @Transactional(readOnly = true) public List findAllDesc(){ return surveysRepository.findAllDesc().stream() diff --git a/src/main/java/com/mAInd/springboot/web/SurveysApiController.java b/src/main/java/com/mAInd/springboot/web/SurveysApiController.java index be9964c..32ae1cf 100644 --- a/src/main/java/com/mAInd/springboot/web/SurveysApiController.java +++ b/src/main/java/com/mAInd/springboot/web/SurveysApiController.java @@ -1,10 +1,7 @@ package com.mAInd.springboot.web; import com.mAInd.springboot.service.surveys.SurveysService; -import com.mAInd.springboot.web.dto.SurveysListResponseDto; -import com.mAInd.springboot.web.dto.SurveysResponseDto; -import com.mAInd.springboot.web.dto.SurveysSaveRequestDto; -import com.mAInd.springboot.web.dto.SurveysUpdateRequestDto; +import com.mAInd.springboot.web.dto.*; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -41,4 +38,9 @@ public SurveysResponseDto findById(@PathVariable Long survey_id){ public List findAll(){ return surveysService.findAllDesc(); } + + @GetMapping("/mypage/surveys/{survey_id}/status") + public SurveysStatusResponseDto findById2(@PathVariable Long survey_id){ + return surveysService.findById2(survey_id); + } } diff --git a/src/main/java/com/mAInd/springboot/web/dto/SurveysListResponseDto.java b/src/main/java/com/mAInd/springboot/web/dto/SurveysListResponseDto.java index 798d862..697ddd1 100644 --- a/src/main/java/com/mAInd/springboot/web/dto/SurveysListResponseDto.java +++ b/src/main/java/com/mAInd/springboot/web/dto/SurveysListResponseDto.java @@ -2,6 +2,7 @@ import com.mAInd.springboot.domain.surveys.Gender; import com.mAInd.springboot.domain.surveys.Surveys; +import com.mAInd.springboot.domain.user.Users; import java.time.LocalDate; import java.time.LocalDateTime; @@ -24,11 +25,8 @@ public class SurveysListResponseDto { private String q_6; private String q_7; private String q_8; - private String q_9; - private String q_10; - private String q_11; - private Long client_id; - private Long counselor_id; +// private Users client_id; +// private Long counselor_id; private List symptoms; private LocalDateTime modifiedDate; @@ -50,11 +48,8 @@ public SurveysListResponseDto(Surveys entity){ this.q_6 = entity.getQ_6(); this.q_7 = entity.getQ_7(); this.q_8 = entity.getQ_8(); - this.q_9 = entity.getQ_9(); - this.q_10 = entity.getQ_10(); - this.q_11 = entity.getQ_11(); - this.client_id = entity.getClient_id(); - this.counselor_id = entity.getCounselor_id(); +// this.client_id = entity.getClient_id(); +// this.counselor_id = entity.getCounselor_id(); this.modifiedDate = entity.getModifiedDate(); } } diff --git a/src/main/java/com/mAInd/springboot/web/dto/SurveysResponseDto.java b/src/main/java/com/mAInd/springboot/web/dto/SurveysResponseDto.java index af18d76..e04d8fe 100644 --- a/src/main/java/com/mAInd/springboot/web/dto/SurveysResponseDto.java +++ b/src/main/java/com/mAInd/springboot/web/dto/SurveysResponseDto.java @@ -1,7 +1,9 @@ package com.mAInd.springboot.web.dto; +import com.mAInd.springboot.domain.surveys.ApplyStatus; import com.mAInd.springboot.domain.surveys.Gender; import com.mAInd.springboot.domain.surveys.Surveys; +import com.mAInd.springboot.domain.user.Users; import lombok.Getter; import java.util.Date; @@ -25,11 +27,10 @@ public class SurveysResponseDto { private String q_6; private String q_7; private String q_8; - private String q_9; - private String q_10; - private String q_11; - private Long client_id; - private Long counselor_id; +// private Users client_id; +// private Long counselor_id; + + private ApplyStatus applyStatus; public SurveysResponseDto(Surveys entity){ @@ -49,10 +50,8 @@ public SurveysResponseDto(Surveys entity){ this.q_6 = entity.getQ_6(); this.q_7 = entity.getQ_7(); this.q_8 = entity.getQ_8(); - this.q_9 = entity.getQ_9(); - this.q_10 = entity.getQ_10(); - this.q_11 = entity.getQ_11(); - this.client_id = entity.getClient_id(); - this.counselor_id = entity.getCounselor_id(); +// this.client_id = entity.getClient_id(); +// this.counselor_id = entity.getCounselor_id(); + this.applyStatus = entity.getApplyStatus(); } } diff --git a/src/main/java/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.java b/src/main/java/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.java index b653804..372f254 100644 --- a/src/main/java/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.java +++ b/src/main/java/com/mAInd/springboot/web/dto/SurveysSaveRequestDto.java @@ -1,5 +1,6 @@ package com.mAInd.springboot.web.dto; +import com.mAInd.springboot.domain.surveys.ApplyStatus; import com.mAInd.springboot.domain.surveys.Gender; import com.mAInd.springboot.domain.surveys.Surveys; import lombok.Builder; @@ -32,12 +33,13 @@ public class SurveysSaveRequestDto { private String q_10; private String q_11; + @Builder public SurveysSaveRequestDto(String name, Gender gender, String email, Date birth, String phone, String education, List symptoms, String q_1, String q_2, String q_3, String q_4, String q_5, String q_6, String q_7, - String q_8, String q_9, String q_10, String q_11){ + String q_8){ this.name = name; this.gender = gender; this.email = email; @@ -53,9 +55,6 @@ public SurveysSaveRequestDto(String name, Gender gender, String email, Date birt this.q_6 = q_6; this.q_7 = q_7; this.q_8 = q_8; - this.q_9 = q_9; - this.q_10 = q_10; - this.q_11 = q_11; } public Surveys toEntity(){ @@ -75,9 +74,7 @@ public Surveys toEntity(){ .q_6(q_6) .q_7(q_7) .q_8(q_8) - .q_9(q_9) - .q_10(q_10) - .q_11(q_11) + .applyStatus(ApplyStatus.BEFORE) .build(); } } diff --git a/src/main/java/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.java b/src/main/java/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.java new file mode 100644 index 0000000..4d3f512 --- /dev/null +++ b/src/main/java/com/mAInd/springboot/web/dto/SurveysStatusResponseDto.java @@ -0,0 +1,24 @@ +package com.mAInd.springboot.web.dto; + +import com.google.type.DateTime; +import com.mAInd.springboot.domain.surveys.ApplyStatus; +import com.mAInd.springboot.domain.surveys.Surveys; +import lombok.Getter; + +import java.time.LocalDateTime; + +@Getter +public class SurveysStatusResponseDto { + private LocalDateTime createdDate; + private LocalDateTime modifiedDate; + private LocalDateTime statusDate; + private ApplyStatus applyStatus; + + public SurveysStatusResponseDto(Surveys entity){ + this.createdDate = entity.getCreatedDate(); + this.modifiedDate = entity.getModifiedDate(); + this.statusDate = entity.getStatusDate(); + this.applyStatus = entity.getApplyStatus(); + } + +} diff --git a/src/main/java/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.java b/src/main/java/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.java index 3220f1f..4eaabc3 100644 --- a/src/main/java/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.java +++ b/src/main/java/com/mAInd/springboot/web/dto/SurveysUpdateRequestDto.java @@ -26,15 +26,12 @@ public class SurveysUpdateRequestDto { private String q_6; private String q_7; private String q_8; - private String q_9; - private String q_10; - private String q_11; @Builder public SurveysUpdateRequestDto(String name, Gender gender, String email, Date birth, String phone, String education, List symptoms, String q_1, String q_2, String q_3, String q_4, String q_5, String q_6, String q_7, - String q_8, String q_9, String q_10, String q_11){ + String q_8){ this.name = name; this.gender = gender; this.email = email; @@ -50,8 +47,5 @@ public SurveysUpdateRequestDto(String name, Gender gender, String email, Date bi this.q_6 = q_6; this.q_7 = q_7; this.q_8 = q_8; - this.q_9 = q_9; - this.q_10 = q_10; - this.q_11 = q_11; } }