Skip to content

Commit

Permalink
πŸš€ :: v2.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
parkuiery authored Nov 5, 2024
2 parents 668938c + cd12bd8 commit c5566e9
Show file tree
Hide file tree
Showing 20 changed files with 131 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-production-deploy-play-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
id: discord-success
run: |
curl -H "Content-Type: application/json" \
-d '{"content": "πŸš€ 앱이 λ°°ν¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€.\nTag: ${{ github.ref_name }}\n Version: ${{ steps.get_tag.outputs.name }}\nRelease Note: ${{ env.RELEASE_NOTE }}"}' \
-d '{"content": "πŸš€ 앱이 λ°°ν¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€.\n🏷️ Tag: ${{ github.ref_name }}\nβš™οΈ Version: ${{ steps.get_tag.outputs.name }}\nπŸ“„ Release Note:\n${{ env.RELEASE_NOTE }}"}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Notify Discord on Failure
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/play/release-notes/ko-KR/default.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[v2.2.4]
[v2.2.5]
β€’ 버그 μˆ˜μ • 및 데이터λ₯Ό μˆ˜μ •ν–ˆμ–΄μš”.

[ μƒˆλ‘œμš΄ κΈ°λŠ₯ ]
Expand All @@ -9,4 +9,4 @@
β€’ κΈ°μ—… 및 λͺ¨μ§‘μ˜λ’°μ„œμ˜ 데이터가 μˆ˜μ •λ˜μ—ˆμ–΄μš”.

[ 버그 μˆ˜μ • ]
β€’ 이메일이 μ „μ†‘λ˜μ§€ μ•ŠλŠ” 버그λ₯Ό μˆ˜μ •ν–ˆμ–΄μš”.
β€’ 리이슈 버그λ₯Ό μˆ˜μ •ν–ˆμ–΄μš”.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/ProjectProperties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ object ProjectProperties {
const val COMPILE_SDK = 34
const val MIN_SDK = 28
const val TARGET_SDK = 34
const val VERSION_CODE = 18
const val VERSION_NAME = "2.2.4"
const val VERSION_CODE = 19
const val VERSION_NAME = "2.2.5"
const val COMPOSE_COMPILER_EXTENSION = "1.5.6"
const val JVM_TARGET = "18"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ enum class AlarmType {
INTERVIEW_SOON,
NEW_RECRUITMENT,
RECRUITMENT_DONE,
WINTER_INTERN_REGISTERED,
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package team.retum.common.enums

enum class NotificationTopic {
APPLICATION_STATUS_CHANGED, RECRUITMENT_DONE, NEW_NOTICE, NEW_INTERESTED_RECRUITMENT, WINTER_INTERN_STATUS_CHANGED,
APPLICATION,
RECRUITMENT,
NOTICE,
WINTER_INTERN,
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ data class RecruitmentDetailsEntity(
val trainPay: Long,
val pay: String?,
val benefits: String?,
val militarySupport: Boolean,
val militarySupport: Boolean?,
val submitDocument: String,
val startDate: String?,
val endDate: String?,
val etc: String?,
val isApplicable: Boolean,
val bookmarked: Boolean,
val winterIntern: Boolean,
val integrationPlan: Boolean,
)

@Immutable
Expand Down Expand Up @@ -71,6 +72,7 @@ internal fun FetchRecruitmentDetailsResponse.toEntity() = RecruitmentDetailsEnti
isApplicable = this.isApplicable,
bookmarked = this.bookmarked,
winterIntern = this.winterIntern,
integrationPlan = this.integrationPlan,
)

private fun Areas.toEntity() = AreasEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class RecruitmentsEntity(
val companyName: String,
val companyProfileUrl: String,
val trainPay: Long,
val militarySupport: MilitarySupport,
val militarySupport: MilitarySupport?,
val hiringJobs: String,
val bookmarked: Boolean,
) {
Expand Down Expand Up @@ -46,6 +46,7 @@ private fun FetchRecruitmentsResponse.RecruitmentResponse.toEntity() =
militarySupport = when (this.militarySupport) {
true -> MilitarySupport.TRUE
false -> MilitarySupport.FALSE
else -> null
},
hiringJobs = this.hiringJobs,
bookmarked = this.bookmarked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ object NetworkModule {

@Provides
@Singleton
fun provideTokenInterceptor(localUserDataSource: LocalUserDataSource): Interceptor {
return TokenInterceptor(localUserDataSource = localUserDataSource)
fun provideTokenInterceptor(
localUserDataSource: LocalUserDataSource,
): Interceptor {
return TokenInterceptor(
localUserDataSource = localUserDataSource,
)
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ data class FetchRecruitmentDetailsResponse(
@Json(name = "train_pay") val trainPay: Long,
@Json(name = "pay") val pay: String?,
@Json(name = "benefits") val benefits: String?,
@Json(name = "military_support") val militarySupport: Boolean,
@Json(name = "military_support") val militarySupport: Boolean?,
@Json(name = "submit_document") val submitDocument: String,
@Json(name = "start_date") val startDate: String?,
@Json(name = "end_date") val endDate: String?,
@Json(name = "etc") val etc: String?,
@Json(name = "is_applicable") val isApplicable: Boolean,
@Json(name = "bookmarked") val bookmarked: Boolean,
@Json(name = "winter_intern") val winterIntern: Boolean,
@Json(name = "integration_plan") val integrationPlan: Boolean,
)

@JsonClass(generateAdapter = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class FetchRecruitmentsResponse(
@Json(name = "company_name") val companyName: String,
@Json(name = "company_profile_url") val companyProfileUrl: String,
@Json(name = "train_pay") val trainPay: Long,
@Json(name = "military_support") val militarySupport: Boolean,
@Json(name = "military_support") val militarySupport: Boolean?,
@Json(name = "hiring_jobs") val hiringJobs: String,
@Json(name = "bookmarked") val bookmarked: Boolean,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package team.retum.network.util

import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import team.retum.common.enums.PlatformType
import team.retum.network.BuildConfig
import team.retum.network.api.AuthApi
import team.retum.network.model.response.TokenResponse

object RefreshTokenService {

private val refreshRetrofit = Retrofit.Builder()
.baseUrl(BuildConfig.BASE_URL)
.client(
OkHttpClient.Builder()
.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
.build(),
)
.addConverterFactory(
MoshiConverterFactory.create(
Moshi.Builder()
.addLast(KotlinJsonAdapterFactory())
.build(),
),
)
.build()

private val refreshService = refreshRetrofit.create(AuthApi::class.java)

suspend fun refreshToken(refreshToken: String): TokenResponse {
return runCatching {
refreshService.reissueToken(
refreshToken = refreshToken,
platformType = PlatformType.ANDROID,
)
}.onSuccess { token ->
return token
}.onFailure {
throw IllegalStateException("Fail refresh: ${it.message}")
}.getOrThrow()
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package team.retum.network.util

import kotlinx.coroutines.runBlocking
import okhttp3.Interceptor
import okhttp3.Response
import team.retum.common.utils.ResourceKeys
Expand All @@ -11,8 +12,6 @@ class TokenInterceptor @Inject constructor(
private val localUserDataSource: LocalUserDataSource,
) : Interceptor {

private lateinit var accessToken: String

private val ignorePaths by lazy {
listOf(
RequestUrls.Users.login,
Expand All @@ -29,18 +28,43 @@ class TokenInterceptor @Inject constructor(
}

override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
var request = chain.request()
val path = request.url.encodedPath

return chain.proceed(
var response = chain.proceed(
if (ignorePaths.contains(path) || checkS3Request(url = request.url.toString())) {
request
} else {
accessToken = localUserDataSource.getAccessToken()
val accessToken = localUserDataSource.getAccessToken()
request.newBuilder()
.addHeader("Authorization", "${ResourceKeys.BEARER} $accessToken").build()
.addHeader("Authorization", "${ResourceKeys.BEARER} $accessToken")
.build()
},
)

if (response.code == 401 && !ignorePaths.contains(path)) {
response.close()

val refreshToken = localUserDataSource.getRefreshToken()

runBlocking {
val newToken = RefreshTokenService.refreshToken(refreshToken)
localUserDataSource.run {
saveAccessToken(newToken.accessToken)
saveAccessExpiresAt(newToken.accessExpiresAt)
saveRefreshToken(newToken.refreshToken)
saveRefreshExpiresAt(newToken.refreshExpiresAt)
}

request = request.newBuilder()
.removeHeader("Authorization")
.addHeader("Authorization", "${ResourceKeys.BEARER} ${newToken.accessToken}")
.build()

response = chain.proceed(request)
}
}
return response
}

private fun checkS3Request(url: String): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,15 @@ internal fun CompanyDetails(
val companyInfo = with(state.companyDetailsEntity) {
listOf(
CompanyInfoData(R.string.representative_name, representativeName),
CompanyInfoData(R.string.service_name, serviceName),
CompanyInfoData(R.string.founded_at, foundedAt),
CompanyInfoData(R.string.worker_number, workerNumber),
CompanyInfoData(R.string.take, take),
CompanyInfoData(
if (headquarter) R.string.main_address else R.string.address,
mainAddress,
),
CompanyInfoData(R.string.manager, managerName),
CompanyInfoData(R.string.represent_phone_number, representativePhoneNo),
CompanyInfoData(R.string.email, email),
CompanyInfoData(R.string.businessArea, businessArea),
)
}

Expand Down
5 changes: 2 additions & 3 deletions feature/company/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
<string name="company_details">κΈ°μ—… 상세</string>

<string name="representative_name">λŒ€ν‘œμž</string>
<string name="service_name">μ„œλΉ„μŠ€ 이름</string>
<string name="founded_at">섀립일</string>
<string name="worker_number">근둜자 수</string>
<string name="take">μ—°λ§€μΆœ</string>
<string name="address">μ£Όμ†Œ</string>
<string name="main_address">μ£Όμ†Œ (본사)</string>
<string name="manager">λ‹΄λ‹Ήμž</string>
<string name="represent_phone_number">λŒ€ν‘œ 번호</string>
<string name="email">이메일</string>
<string name="businessArea">사업뢄야</string>

<string name="review">λ©΄μ ‘ ν›„κΈ°</string>
<string name="show_more_reviews">더 λ§Žμ€ ν›„κΈ° 보기</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ private fun NotificationSettingScreen(
)
NotificationDetailLayout(
title = stringResource(id = R.string.notice_notification),
topic = NotificationTopic.NEW_NOTICE,
topic = NotificationTopic.NOTICE,
isSubscribe = state.isNoticeSubscribe,
onCheckChange = onTopicChange,
)
NotificationDetailLayout(
title = stringResource(id = R.string.application_notification),
topic = NotificationTopic.APPLICATION_STATUS_CHANGED,
topic = NotificationTopic.APPLICATION,
isSubscribe = state.isApplicationSubscribe,
onCheckChange = onTopicChange,
)
NotificationDetailLayout(
title = stringResource(id = R.string.recruitment_notification),
topic = NotificationTopic.RECRUITMENT_DONE,
topic = NotificationTopic.RECRUITMENT,
isSubscribe = state.isRecruitmentSubscribe,
onCheckChange = onTopicChange,
)
NotificationDetailLayout(
title = stringResource(id = R.string.winter_intern_notification),
topic = NotificationTopic.WINTER_INTERN_STATUS_CHANGED,
topic = NotificationTopic.WINTER_INTERN,
isSubscribe = state.isWinterInternSubscribe,
onCheckChange = onTopicChange,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ internal class NotificationSettingViewModel @Inject constructor(
fetchNotificationSettingsStatusesUseCase()
.onSuccess { topics ->
topics.topics.forEach {
if (it.topic != NotificationTopic.NEW_INTERESTED_RECRUITMENT) {
changeSubscribeState(
topic = it.topic,
isSubscribed = it.subscribed,
)
}
changeSubscribeState(
topic = it.topic,
isSubscribed = it.subscribed,
)
}
}
.onFailure {
Expand Down Expand Up @@ -96,11 +94,10 @@ internal class NotificationSettingViewModel @Inject constructor(
) {
with(state.value) {
val subscribeState = when (topic) {
NotificationTopic.NEW_NOTICE -> copy(isNoticeSubscribe = isSubscribed)
NotificationTopic.APPLICATION_STATUS_CHANGED -> copy(isApplicationSubscribe = isSubscribed)
NotificationTopic.RECRUITMENT_DONE -> copy(isRecruitmentSubscribe = isSubscribed)
NotificationTopic.WINTER_INTERN_STATUS_CHANGED -> copy(isWinterInternSubscribe = isSubscribed)
NotificationTopic.NEW_INTERESTED_RECRUITMENT -> copy()
NotificationTopic.NOTICE -> copy(isNoticeSubscribe = isSubscribed)
NotificationTopic.APPLICATION -> copy(isApplicationSubscribe = isSubscribed)
NotificationTopic.RECRUITMENT -> copy(isRecruitmentSubscribe = isSubscribed)
NotificationTopic.WINTER_INTERN -> copy(isWinterInternSubscribe = isSubscribed)
}
setState { subscribeState }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,12 @@ private fun RecruitmentDetailInfo(
endDate = endDate,
),
)
Detail(
title = stringResource(id = if (winterIntern) R.string.industrial_technical_personnel_whether else R.string.special_military_service_whether),
content = "${if (winterIntern) "μ‚°μ—…κΈ°λŠ₯ μš”μ› 근무" else "λ³‘μ—­νŠΉλ‘€"} ${if (militarySupport) "" else "뢈"}κ°€λŠ₯",
)
if (!winterIntern && militarySupport != null) {
Detail(
title = stringResource(id = R.string.special_military_service_whether),
content = "λ³‘μ—­νŠΉλ‘€ ${if (militarySupport!!) "" else "뢈"}κ°€λŠ₯",
)
}
Position(areas = recruitmentDetail.areas.toPersistentList())
Detail(
title = stringResource(id = R.string.certificate),
Expand Down Expand Up @@ -251,6 +253,12 @@ private fun RecruitmentDetailInfo(
title = stringResource(id = R.string.etc),
content = etc,
)
if (winterIntern) {
Detail(
title = stringResource(id = R.string.integration_plan),
content = "${if (integrationPlan) "있" else "μ—†"}음",
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private fun RecruitmentItem(
.fillMaxWidth(DEFAULT_SIZE_WHETHER_MILITARY_SUPPORTED)
.clip(RoundedCornerShape(4.dp))
.background(
if (whetherMilitarySupported.isBlank()) {
if (recruitment.militarySupport == MilitarySupport.LOADING) {
JobisTheme.colors.surfaceVariant
} else {
Color.Unspecified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal data class RecruitmentDetailsState(
isApplicable = false,
bookmarked = false,
winterIntern = false,
integrationPlan = false,
),
buttonEnabled = false,
)
Expand Down
Loading

0 comments on commit c5566e9

Please sign in to comment.