-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into fix/develop
- Loading branch information
Showing
8 changed files
with
149 additions
and
8 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/ourMenu/backend/domain/onboarding/api/response/GetOnboardingState.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,24 @@ | ||
package com.ourMenu.backend.domain.onboarding.api.response; | ||
|
||
import com.ourMenu.backend.domain.onboarding.domain.AnswerType; | ||
import com.ourMenu.backend.domain.onboarding.domain.OnBoardingState; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Builder | ||
@Getter | ||
public class GetOnboardingState { | ||
|
||
private int questionId; | ||
|
||
private AnswerType answerType; | ||
|
||
public static GetOnboardingState toDto(OnBoardingState onBoardingState) { | ||
return GetOnboardingState.builder() | ||
.questionId(onBoardingState.getQuestionId()) | ||
.answerType(onBoardingState.getAnswerType()) | ||
.build(); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/ourMenu/backend/domain/onboarding/dao/OnBoardingStateRepository.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,14 @@ | ||
package com.ourMenu.backend.domain.onboarding.dao; | ||
|
||
import com.ourMenu.backend.domain.menu.domain.Tag; | ||
import com.ourMenu.backend.domain.onboarding.domain.OnBoardingState; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface OnBoardingStateRepository extends JpaRepository<OnBoardingState, Long> { | ||
|
||
Optional<OnBoardingState> findByUserId(Long userId); | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/ourMenu/backend/domain/onboarding/domain/OnBoardingState.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,36 @@ | ||
package com.ourMenu.backend.domain.onboarding.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Builder | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
public class OnBoardingState { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private Long userId; | ||
private int questionId; | ||
private AnswerType answerType; | ||
|
||
public static OnBoardingState toEntity(Long userId, int questionId, AnswerType answerType) { | ||
return OnBoardingState.builder() | ||
.userId(userId) | ||
.questionId(questionId) | ||
.answerType(answerType) | ||
.build(); | ||
} | ||
|
||
public void update(int questionId, AnswerType answerType) { | ||
this.questionId = questionId; | ||
this.answerType = answerType; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...n/java/com/ourMenu/backend/domain/onboarding/exception/SearchResultNotFoundException.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,12 @@ | ||
package com.ourMenu.backend.domain.onboarding.exception; | ||
|
||
import com.ourMenu.backend.global.exception.CustomException; | ||
import com.ourMenu.backend.global.exception.ErrorCode; | ||
|
||
public class SearchResultNotFoundException extends CustomException { | ||
|
||
public SearchResultNotFoundException(){ | ||
super(ErrorCode.ON_BOARDING_STATE_NOT_FOUND); | ||
} | ||
|
||
} |
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