Skip to content

Update v.4.1.6 #512

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

Merged
merged 17 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/weekly_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
with:
ref: 'develop'

- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

- name: Make gradlew executable
run: chmod +x ./gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ internal class AndroidApplicationComposeConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("kotlin-kapt")
apply("kotlin-parcelize")
apply("com.google.devtools.ksp")
}
extensions.configure<ApplicationExtension> {
configureAndroidCompose(this)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import `in`.koreatech.convention.implementation
import `in`.koreatech.convention.kapt
import `in`.koreatech.convention.ksp
import `in`.koreatech.convention.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -13,7 +13,7 @@ internal class AndroidApplicationHiltConventionPlugin : Plugin<Project> {
}
dependencies {
implementation(libs.findBundle("hilt").get())
kapt(libs.findLibrary("hilt-compiler").get())
ksp(libs.findLibrary("hilt-compiler").get())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal class AndroidLibraryConventionPlugin : Plugin<Project> {
with(target) {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.kapt")
apply("org.jetbrains.kotlin.android")
apply("com.google.devtools.ksp")
}
extensions.configure<LibraryExtension> {
configureAndroidLibrary(this)
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
}

extra.apply {
set("versionName", "4.1.5")
set("versionCode", 40105)
set("versionName", "4.1.6")
set("versionCode", 40106)
// 코인 버전 관리

set("versionBusinessName", "1.0.1")
Expand All @@ -34,6 +34,7 @@ plugins {
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.google.service) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.ksp) apply false
}

tasks.register<Delete>("clean") {
Expand Down
8 changes: 2 additions & 6 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ dependencies {
debugImplementation(libs.leakcanary.android)

/* Dependency - glide */
api(libs.glide)
kapt(libs.glide.compiler)

/* Dependency - butterknife */
api(libs.butterknife)
kapt(libs.butterknife.compiler)
implementation(libs.glide)
ksp(libs.glide.ksp)

/* Dependency - sticky scroll view */
api(libs.stickyScrollView)
Expand Down
4 changes: 1 addition & 3 deletions core/onboarding/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ plugins {
android {
namespace = "in.koreatech.koin.core.onboarding"
}
kapt {
correctErrorTypes = true
}

dependencies {
implementation(project(":domain"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ object EventLogger {
logEvent(action, EventCategory.NOTIFICATION, label, value, *extras)
}

/**
* AB테스트 이벤트 로깅
* @param category: 이벤트 종류
* @param label: 이벤트 소분류
* @param value: 이벤트 값
*/
fun logABTestEvent(category: String, label: String, value: String) {
logCustomEvent(EventAction.ABTEST.value, category, label, value)
}

/**
* @param action: 커스텀 이벤트 발생(EventAction 이외에 action)
* @param category: 커스텀 이벤트 종류(EventCategory 이외에 category)
Expand Down Expand Up @@ -118,6 +128,7 @@ enum class EventAction(val value: String) {
BUSINESS("BUSINESS"),
CAMPUS("CAMPUS"),
USER("USER"),
ABTEST("AB_TEST"),
}

enum class EventCategory(val value: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ object AnalyticsConstant {

const val CAMPUS_DINING_1 = "CAMPUS_dining_1"
const val CAMPUS_NOTICE_1 = "CAMPUS_notice_1"
const val APP_MAIN_NOTICE_DETAIL = "app_main_notice_detail"
const val POPULAR_NOTICE_BANNER = "popular_notice_banner"
const val TO_MANAGE_KEYWORD = "to_manage_keyword"

const val BUSINESS_CALL_NUMBER = " BUSINESS_call_1"
const val BUSINESS_CALL_FLOATING = "BUSINESS_call_1"
const val BUSINESS_BENEFIT_1 = "BUSINESS_benefit_1"
const val BUSINESS_CALL_1 = "BUSINESS_call_1"
}

const val PREVIOUS_PAGE = "previous_page"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ class ImageZoomableDialog(private val context: Context, private val image: Strin
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>?,
target: Target<Drawable>,
isFirstResource: Boolean
): Boolean = false

override fun onResourceReady(
resource: Drawable?,
model: Any?,
target: Target<Drawable>?,
dataSource: DataSource?,
resource: Drawable,
model: Any,
target: Target<Drawable>,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
binding.photoView.post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import `in`.koreatech.koin.data.request.user.UserRequest
import `in`.koreatech.koin.data.response.notification.NotificationPermissionInfoResponse
import `in`.koreatech.koin.data.response.store.StoreReviewResponse
import `in`.koreatech.koin.data.response.user.ABTestResponse
import `in`.koreatech.koin.data.response.user.ABTestTokenResponse
import `in`.koreatech.koin.data.response.user.UserInfoEditResponse
import `in`.koreatech.koin.data.response.user.UserResponse
import retrofit2.Response
Expand Down Expand Up @@ -90,6 +91,9 @@ interface UserAuthApi {
@GET(URLConstant.OWNER.OWNER)
suspend fun getOwnerTokenIsValid()

@POST("abtest/assign/token")
suspend fun updateABTestToken(): ABTestTokenResponse

@POST("abtest/assign")
suspend fun postABTestAssign(@Body abTestRequest: ABTestRequest): ABTestResponse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class UserRepositoryImpl @Inject constructor(
userRemoteDataSource.verifyPassword(PasswordRequest(hashedPassword))
}

override suspend fun updateABTestToken() {
userRemoteDataSource.updateABTestToken().accessHistoryId.also {
tokenLocalDataSource.saveAccessHistoryId(it)
}
}

override suspend fun postABTestAssign(title: String): ABTest {
userRemoteDataSource.postABTestAssign(ABTestRequest(title)).let {
return ABTest(it.variableName, it.accessHistoryId)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package `in`.koreatech.koin.data.response.user

import com.google.gson.annotations.SerializedName

data class ABTestTokenResponse(
@SerializedName("accessHistoryId") val accessHistoryId: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class UserRemoteDataSource(
suspend fun verifyPassword(passwordRequest: PasswordRequest) {
userAuthApi.checkPassword(passwordRequest)
}

suspend fun updateABTestToken(): ABTestTokenResponse {
return userAuthApi.updateABTestToken()
}

suspend fun postABTestAssign(abTestRequest: ABTestRequest): ABTestResponse {
return userAuthApi.postABTestAssign(abTestRequest)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ interface UserRepository {
suspend fun deleteDeviceToken()
suspend fun verifyPassword(hashedPassword: String)
suspend fun updateUserPassword(user: User, hashedPassword: String)
suspend fun updateABTestToken()
suspend fun postABTestAssign(title: String) : ABTest
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package `in`.koreatech.koin.domain.usecase.user

import `in`.koreatech.koin.domain.error.user.UserErrorHandler
import `in`.koreatech.koin.domain.model.error.ErrorHandler
import `in`.koreatech.koin.domain.repository.TokenRepository
import `in`.koreatech.koin.domain.repository.UserRepository
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import javax.inject.Inject

class ABTestUseCase @Inject constructor(
private val userRepository: UserRepository,
private val tokenRepository: TokenRepository,
private val userErrorHandler: UserErrorHandler
private val tokenRepository: TokenRepository
) {
suspend operator fun invoke(title: String): Pair<String?, ErrorHandler?> {
return try {
val accessHistory = userRepository.postABTestAssign(title)
val accessHistoryId = accessHistory.accessHistoryId
tokenRepository.saveAccessHistoryId(accessHistoryId)
accessHistory.variableName to null
} catch (t: Throwable) {
null to userErrorHandler.handleVerifyUserPasswordError(t)
private val mutex = Mutex()

suspend operator fun invoke(title: String): Result<String> {
return runCatching {
mutex.withLock {
if (tokenRepository.getAccessHistoryId() == null) {
userRepository.updateABTestToken()
}
}
userRepository.postABTestAssign(title).variableName
}
}
}
9 changes: 4 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ securityCryptoVersion = "1.1.0-alpha03"
stickyscrollviewVersion = "1.0.2"
strictVersionMatcherPlugin = "1.2.4"
composeCompilerVersion = "1.5.10"
glideVersion = "4.9.0"
butterknifeVersion = "10.1.0"
glideVersion = "4.14.2"
googleServiceVersion = "4.3.14"
composeNavigationVersion = "2.7.7"
orbitVersion = "7.0.1"
Expand All @@ -70,6 +69,7 @@ timber = "5.0.1"
kotlinxCoroutinesTestVersion = "1.9.0"
turbineVersion = "1.2.0"
kotlinxCollectionsImmutableVersion = "0.3.8"
kspVersion = "1.9.22-1.0.16"


[libraries]
Expand Down Expand Up @@ -151,9 +151,7 @@ rxjava-android = { module = "io.reactivex.rxjava2:rxandroid", version.ref = "rxa
stickyScrollView = { module = "com.github.amarjain07:StickyScrollView", version.ref = "stickyscrollviewVersion" }
strict-version-matcher-plugin = { module = "com.google.android.gms:strict-version-matcher-plugin", version.ref = "strictVersionMatcherPlugin" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glideVersion" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glideVersion" }
butterknife = { module = "com.jakewharton:butterknife", version.ref = "butterknifeVersion" }
butterknife-compiler = { module = "com.jakewharton:butterknife-compiler", version.ref = "butterknifeVersion" }
glide-ksp = { module = "com.github.bumptech.glide:ksp", version.ref = "glideVersion" }
viewpager2 = { module = "androidx.viewpager2:viewpager2", version = "1.0.0" }

orbit-core = { module = "org.orbit-mvi:orbit-core", version.ref = "orbitVersion" }
Expand Down Expand Up @@ -205,6 +203,7 @@ kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", vers
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltVersion" }
androidLibrary = { id = "com.android.library", version.ref = "androidGradleVersion" }
google-service = { id = "com.google.gms.google-services", version.ref = "googleServiceVersion" }
ksp = { id = "com.google.devtools.ksp", version.ref = "kspVersion" }

koin-application = { id = "in.koreatech.plugin.application", version = "unspecified" }
koin-compose = { id = "in.koreatech.plugin.compose", version = "unspecified" }
Expand Down
8 changes: 1 addition & 7 deletions koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ dependencies {
/* Dependency - glide & coil */
implementation(libs.glide)
implementation(libs.coil)
kapt(libs.glide.compiler)

/* Dependency - butterknife api */
implementation(libs.butterknife)
kapt(libs.butterknife.compiler)
ksp(libs.glide.ksp)

/* Dependency - naver api */
implementation(libs.map.sdk)
Expand All @@ -119,8 +115,6 @@ dependencies {
implementation(libs.inApp.update.ktx)
implementation(libs.feature.delivery.ktx)

// https://github.com/irshuLx/Android-WYSIWYG-Editor
implementation(libs.laser.native.editor)
implementation(libs.colorpicker)
implementation(libs.photoview)

Expand Down
2 changes: 1 addition & 1 deletion koin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar"
android:theme="@style/KAPTheme.NoActionBar"
android:usesCleartextTraffic="true"
tools:replace="icon,label">

Expand Down
7 changes: 7 additions & 0 deletions koin/src/main/java/in/koreatech/koin/GlideModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package `in`.koreatech.koin

import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule

@GlideModule
class GlideModule: AppGlideModule()
10 changes: 5 additions & 5 deletions koin/src/main/java/in/koreatech/koin/ui/article/HtmlView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ class HtmlView @JvmOverloads constructor(
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: com.bumptech.glide.request.target.Target<Drawable>?,
target: com.bumptech.glide.request.target.Target<Drawable>,
isFirstResource: Boolean
): Boolean {
return false
}

override fun onResourceReady(
resource: Drawable?,
model: Any?,
target: com.bumptech.glide.request.target.Target<Drawable>?,
dataSource: DataSource?,
resource: Drawable,
model: Any,
target: com.bumptech.glide.request.target.Target<Drawable>,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
val dialog = ImageZoomableDialog(context, model as String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ class DiningAdapter(
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>?,
target: Target<Drawable>,
isFirstResource: Boolean
): Boolean {
return false
}

override fun onResourceReady(
resource: Drawable?,
model: Any?,
target: Target<Drawable>?,
dataSource: DataSource?,
resource: Drawable,
model: Any,
target: Target<Drawable>,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
binding.lottieImageLoading.pauseAnimation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ class DiningOriginalAdapter(
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>?,
target: Target<Drawable>,
isFirstResource: Boolean
): Boolean {
return false
}

override fun onResourceReady(
resource: Drawable?,
model: Any?,
target: Target<Drawable>?,
dataSource: DataSource?,
resource: Drawable,
model: Any,
target: Target<Drawable>,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
binding.lottieImageLoading.pauseAnimation()
Expand Down
Loading
Loading