Skip to content

Commit

Permalink
Merge pull request #88 from pknu-wap/chore/jaino/#84
Browse files Browse the repository at this point in the history
Chore/jaino/#84
  • Loading branch information
jeongjaino authored Jan 7, 2024
2 parents eb7037b + 8685524 commit 70e6a2d
Show file tree
Hide file tree
Showing 42 changed files with 1,083 additions and 435 deletions.
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ dependencies {
implementation(project(":feature:auth"))
implementation(project(":feature:notice"))
implementation(project(":feature:survey"))
implementation(project(":feature:survey-check"))
implementation(project(":feature:profile"))
implementation(project(":feature:management"))
implementation(project(":feature:management-survey"))
implementation(project(":feature:splash"))
implementation(project(":core:designresource"))
implementation(project(":core:designsystem"))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/wap/wapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.wap.wapp.core.domain.usecase.auth.SignInUseCase
import com.wap.wapp.feature.auth.signin.navigation.signInNavigationRoute
import com.wap.wapp.feature.auth.signup.navigation.signUpNavigationRoute
import com.wap.wapp.feature.management.registration.event.navigation.eventRegistrationNavigationRoute
import com.wap.wapp.feature.management.registration.survey.navigation.surveyRegistrationNavigationRoute
import com.wap.wapp.feature.management.survey.registration.navigation.surveyRegistrationNavigationRoute
import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavigationRoute
import com.wap.wapp.feature.splash.navigation.splashNavigationRoute
import com.wap.wapp.navigation.TopLevelDestination
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ import com.wap.wapp.feature.auth.signin.navigation.navigateToSignIn
import com.wap.wapp.feature.auth.signin.navigation.signInScreen
import com.wap.wapp.feature.auth.signup.navigation.navigateToSignUp
import com.wap.wapp.feature.auth.signup.navigation.signUpScreen
import com.wap.wapp.feature.management.check.navigation.navigateToSurveyCheck
import com.wap.wapp.feature.management.check.navigation.surveyCheckScreen
import com.wap.wapp.feature.management.edit.event.navigation.eventEditScreen
import com.wap.wapp.feature.management.edit.event.navigation.navigateToEventEdit
import com.wap.wapp.feature.management.navigation.managementScreen
import com.wap.wapp.feature.management.navigation.navigateToManagement
import com.wap.wapp.feature.management.registration.event.navigation.eventRegistrationScreen
import com.wap.wapp.feature.management.registration.event.navigation.navigateToEventRegistration
import com.wap.wapp.feature.management.registration.survey.navigation.navigateToSurveyRegistration
import com.wap.wapp.feature.management.registration.survey.navigation.surveyRegistrationScreen
import com.wap.wapp.feature.management.survey.registration.navigation.navigateToSurveyRegistration
import com.wap.wapp.feature.management.survey.registration.navigation.surveyRegistrationScreen
import com.wap.wapp.feature.notice.navigation.navigateToNotice
import com.wap.wapp.feature.notice.navigation.noticeScreen
import com.wap.wapp.feature.profile.navigation.navigateToProfile
Expand All @@ -32,6 +30,8 @@ import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavi
import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingScreen
import com.wap.wapp.feature.splash.navigation.splashNavigationRoute
import com.wap.wapp.feature.splash.navigation.splashScreen
import com.wap.wapp.feature.survey.check.navigation.navigateToSurveyCheck
import com.wap.wapp.feature.survey.check.navigation.surveyCheckScreen
import com.wap.wapp.feature.survey.navigation.navigateToSurvey
import com.wap.wapp.feature.survey.navigation.navigateToSurveyAnswer
import com.wap.wapp.feature.survey.navigation.surveyNavGraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class GetUserRoleUseCase @Inject constructor(
private val userRepository: UserRepository,
private val managementRepository: ManagementRepository,
) {
suspend operator fun invoke(): Result<UserRole> {
return runCatching {
suspend operator fun invoke(): Result<UserRole> =
runCatching {
val userId = userRepository.getUserId()
.getOrElse { exception ->
if (exception is IllegalStateException) { // 회원이 아닌 경우
Expand All @@ -32,5 +32,4 @@ class GetUserRoleUseCase @Inject constructor(
},
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.wap.wapp.core.model.survey

import java.time.Duration
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter

// 운영진이 등록하는 설문 모델
Expand All @@ -21,7 +22,8 @@ data class SurveyForm(
)

fun calculateDeadline(): String {
val currentDateTime = LocalDateTime.now()
val zoneId = ZoneId.of("Asia/Seoul")
val currentDateTime = LocalDateTime.now(zoneId)
val duration = Duration.between(currentDateTime, deadline)

if (duration.toMinutes() < 60) {
Expand All @@ -43,7 +45,8 @@ data class SurveyForm(
}

fun isAfterDeadline(): Boolean {
val currentDateTime = LocalDateTime.now()
val zoneId = ZoneId.of("Asia/Seoul")
val currentDateTime = LocalDateTime.now(zoneId)
return deadline.isAfter(currentDateTime)
}
}
1 change: 1 addition & 0 deletions feature/management-survey/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
38 changes: 38 additions & 0 deletions feature/management-survey/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id("com.wap.wapp.feature")
id("com.wap.wapp.hilt")
}

android {
namespace = "com.wap.wapp.feature.management.survey"

defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
}

dependencies {
implementation(project(":core:domain"))
implementation(project(":core:model"))
implementation(project(":core:designsystem"))
implementation(project(":core:designresource"))
implementation(project(":core:common"))

implementation(libs.bundles.androidx)
implementation(libs.material)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.test.espresso)
}
Empty file.
21 changes: 21 additions & 0 deletions feature/management-survey/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
4 changes: 4 additions & 0 deletions feature/management-survey/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Loading

0 comments on commit 70e6a2d

Please sign in to comment.