-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/jaino/#53 #54
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c96b7a5
[CHORE] #53 : eventId String -> Int 변경 및 deadLine -> deadline 필드 네이밍 수정
jeongjaino 3d2e1c6
[FEATURE] #53 : SurveyForm DTO 모델 구현
jeongjaino 0fb6344
[FEATURE] #53 : Management DataSource 설문 저장 로직 구현
jeongjaino a18d8e1
[FEATURE] #53 : Management Repository 구현 및 domain to dto 변환 구현
jeongjaino c2cb71c
[FEATURE] #53 : 설문 등록 UseCase 구현
jeongjaino 2350b55
[CHORE] #53 : DB Const Table 네이밍 등록
jeongjaino e202888
[REFACTOR] #53 : Type State ViewModel State로 StateHositing 구현
jeongjaino 3cedcfb
[FEATURE] #53 : 상태 검증 로직 및 설문 조사 등록 함수 구현
jeongjaino fcce12c
[FEATURE] #53 : 성공시 화면 전환 구현
jeongjaino 6507078
[STYLE] #53 : Lint 적용
jeongjaino cfa39e2
Merge branch 'develop' into feature/jaino/#53
jeongjaino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepository.kt
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package com.wap.wapp.core.data.repository.management | ||
|
||
import com.wap.wapp.core.model.survey.SurveyForm | ||
|
||
interface ManagementRepository { | ||
suspend fun getManager(userId: String): Result<Boolean> | ||
|
||
suspend fun postManager(userId: String): Result<Unit> | ||
|
||
suspend fun getManagementCode(code: String): Result<Boolean> | ||
|
||
suspend fun postSurveyForm(surveyForm: SurveyForm): Result<Unit> | ||
} |
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
40 changes: 40 additions & 0 deletions
40
...domain/src/main/java/com/wap/wapp/core/domain/usecase/management/RegisterSurveyUseCase.kt
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,40 @@ | ||
package com.wap.wapp.core.domain.usecase.management | ||
|
||
import com.wap.wapp.core.data.repository.management.ManagementRepository | ||
import com.wap.wapp.core.data.repository.user.UserRepository | ||
import com.wap.wapp.core.model.event.Event | ||
import com.wap.wapp.core.model.survey.SurveyForm | ||
import com.wap.wapp.core.model.survey.SurveyQuestion | ||
import java.time.LocalDate | ||
import java.time.LocalDateTime | ||
import java.time.LocalTime | ||
import javax.inject.Inject | ||
|
||
class RegisterSurveyUseCase @Inject constructor( | ||
private val managementRepository: ManagementRepository, | ||
private val userRepository: UserRepository, | ||
) { | ||
suspend operator fun invoke( | ||
event: Event, | ||
title: String, | ||
content: String, | ||
surveyQuestion: List<SurveyQuestion>, | ||
deadlineDate: LocalDate, | ||
deadlineTime: LocalTime, | ||
): Result<Unit> { | ||
return runCatching { | ||
val userId = userRepository.getUserId().getOrThrow() | ||
|
||
managementRepository.postSurveyForm( | ||
SurveyForm( | ||
eventId = event.eventId, | ||
userId = userId, | ||
title = title, | ||
content = content, | ||
surveyQuestion = surveyQuestion, | ||
deadline = LocalDateTime.of(deadlineDate, deadlineTime), | ||
), | ||
) | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
core/network/src/main/java/com/wap/wapp/core/network/model/management/SurveyFormRequest.kt
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,19 @@ | ||
package com.wap.wapp.core.network.model.management | ||
|
||
import com.wap.wapp.core.model.survey.SurveyQuestion | ||
|
||
data class SurveyFormRequest( | ||
val userId: String, | ||
val title: String, | ||
val content: String, | ||
val surveyQuestion: List<SurveyQuestion>, | ||
val deadline: String, | ||
) { | ||
constructor() : this( | ||
"", | ||
"", | ||
"", | ||
emptyList(), | ||
"", | ||
) | ||
} |
4 changes: 4 additions & 0 deletions
4
...network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSource.kt
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package com.wap.wapp.core.network.source.management | ||
|
||
import com.wap.wapp.core.network.model.management.SurveyFormRequest | ||
|
||
interface ManagementDataSource { | ||
suspend fun getManager(userId: String): Result<Boolean> | ||
|
||
suspend fun postManager(userId: String): Result<Unit> | ||
|
||
suspend fun getManagementCode(code: String): Result<Boolean> | ||
|
||
suspend fun postSurveyForm(surveyFormRequest: SurveyFormRequest, eventId: Int): Result<Unit> | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 여기는 runCatching 안한 이유가 있을까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수를 호출하는 로직 안에 runCatching 이요 ,,,,?
저기 Local DateTime 포맷팅 하는 부분에서 예외가 발생할 것 같아서, 주시는 말씀인가요 ??
따로 로직을 수행하는게 아니고, 따로 파라미터를 넘기는 부분이라 하지는 않았습니다.. !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeongjaino
와우 저는 이 때 까지 아무생각 없이 다 갖다 박았는데
파워 인사이트 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;