-
Notifications
You must be signed in to change notification settings - Fork 0
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
라이브러리 버전 업데이트 #49
라이브러리 버전 업데이트 #49
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ object AndroidX { | |
} | ||
|
||
object Kotlin { | ||
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:1.8.10" | ||
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:1.8.22" | ||
} | ||
|
||
object Javax { | ||
|
@@ -53,14 +53,15 @@ object Retrofit { | |
const val base = "com.squareup.retrofit2:retrofit:2.9.0" | ||
const val rxjava = "com.squareup.retrofit2:adapter-rxjava3:2.9.0" | ||
const val kotlinx = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0" | ||
const val okhttp = "com.squareup.okhttp3:okhttp:4.9.1" | ||
const val okhttpLogger = "com.squareup.okhttp3:logging-interceptor:4.9.1" | ||
const val okhttp = "com.squareup.okhttp3:okhttp:4.12.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:property-naming reported by reviewdog 🐶 |
||
const val okhttpLogger = "com.squareup.okhttp3:logging-interceptor:4.12.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:property-naming reported by reviewdog 🐶 |
||
} | ||
|
||
object Glide { | ||
const val base = "com.github.bumptech.glide:glide:4.11.0" | ||
const val okhttp = "com.github.bumptech.glide:okhttp3-integration:4.11.0" | ||
const val compiler = "com.github.bumptech.glide:compiler:4.11.0" | ||
const val base = "com.github.bumptech.glide:glide:4.16.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:property-naming reported by reviewdog 🐶 |
||
const val okhttp = "com.github.bumptech.glide:okhttp3-integration:4.16.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:property-naming reported by reviewdog 🐶 |
||
// const val compiler = "com.github.bumptech.glide:compiler:4.15.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:spacing-between-declarations-with-comments reported by reviewdog 🐶 |
||
const val compiler = "com.github.bumptech.glide:ksp:4.16.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:property-naming reported by reviewdog 🐶 |
||
const val compose = "com.github.bumptech.glide:compose:1.0.0-beta01" | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import com.hmju.core.models.base.JSendObj | |
import io.reactivex.rxjava3.core.Single | ||
import okhttp3.ResponseBody | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
import retrofit2.http.QueryMap | ||
|
||
|
@@ -37,19 +38,34 @@ internal interface ApiService { | |
@GET("/api/v1/memo/aos") | ||
fun fetchAndroid(): Single<ResponseBody> | ||
|
||
@GET("/api/v1/til/auth/jwt/test") | ||
@GET("/api/v1/til/auth/jwt/test/{delay}") | ||
fun fetchJwtTest( | ||
@Query("time_delay") delay: Int = 0 | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): Single<JSendObj<JwtTokenTestEntity>> | ||
|
||
@GET("/api/v1/til/auth/jwt/test1") | ||
@GET("/api/v1/til/auth/jwt/test1/{delay}") | ||
fun fetchJwtTest1( | ||
@Query("time_delay") delay: Int = 0 | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): Single<JSendObj<JwtTokenTestEntity>> | ||
|
||
@GET("/api/v1/til/auth/jwt/test2") | ||
@GET("/api/v1/til/auth/jwt/test2/{delay}") | ||
fun fetchJwtTest2( | ||
@Query("time_delay") delay: Int = 0 | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): Single<JSendObj<JwtTokenTestEntity>> | ||
|
||
@GET("/api/v1/til/auth/jwt/test/{delay}") | ||
suspend fun fetchJwtTestCo( | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): ApiResponse<JSendObj<JwtTokenTestEntity>> | ||
|
||
@GET("/api/v1/til/auth/jwt/test1/{delay}") | ||
suspend fun fetchJwtTest1Co( | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): ApiResponse<JSendObj<JwtTokenTestEntity>> | ||
|
||
@GET("/api/v1/til/auth/jwt/test2/{delay}") | ||
suspend fun fetchJwtTest2Co( | ||
@Path("delay") delay: Int = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
): ApiResponse<JSendObj<JwtTokenTestEntity>> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:no-blank-line-before-rbrace reported by reviewdog 🐶 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
rootProject.name = "TIL" | ||
rootProject.name = "til" | ||
|
||
include( | ||
":app", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
package com.hmju.test | ||
|
||
import org.junit.Test | ||
|
||
import com.google.gson.GsonBuilder | ||
import com.google.gson.annotations.SerializedName | ||
import kotlinx.datetime.Clock | ||
import kotlinx.datetime.Instant | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.decodeFromString | ||
import kotlinx.serialization.json.Json | ||
import org.junit.Assert.* | ||
import org.junit.Test | ||
import java.text.SimpleDateFormat | ||
import java.util.Date | ||
import java.util.Locale | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
|
@@ -14,4 +25,57 @@ class ExampleUnitTest { | |
fun addition_isCorrect() { | ||
assertEquals(4, 2 + 2) | ||
} | ||
|
||
data class Response( | ||
@SerializedName("time") | ||
val date: Date | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
) | ||
|
||
@Serializable | ||
data class ResponseV2( | ||
@SerialName("time") | ||
val time: Instant = Clock.System.now() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:trailing-comma-on-declaration-site reported by reviewdog 🐶 |
||
) { | ||
fun getDate(): Date { | ||
return Date(time.toEpochMilliseconds()) | ||
} | ||
} | ||
|
||
@Test | ||
fun differ_gson_kotlinx() { | ||
assert(getGsonTime() == getKotlinxTime()) | ||
} | ||
|
||
private fun getGsonTime(): Long { | ||
val str = """ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:multiline-expression-wrapping reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:string-template-indent reported by reviewdog 🐶 |
||
{ | ||
"time": "2024-04-02T12:14:52.395Z" | ||
} | ||
""".trimIndent() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:string-template-indent reported by reviewdog 🐶 |
||
val gson = GsonBuilder() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:multiline-expression-wrapping reported by reviewdog 🐶 |
||
.setDateFormat("yyyy-MM-dd HH:mm:ss") | ||
.create() | ||
val res = gson.fromJson(str, Response::class.java) | ||
val sdf = SimpleDateFormat("yyyy년 MM월 dd일 HH:mm:ss", Locale.getDefault()) | ||
println("Gson ${sdf.format(res.date)}") | ||
return res.date.time | ||
} | ||
|
||
@OptIn(ExperimentalSerializationApi::class) | ||
private fun getKotlinxTime(): Long { | ||
val str = """ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:multiline-expression-wrapping reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:string-template-indent reported by reviewdog 🐶 |
||
{ | ||
"time": "2024-04-02T12:14:52.395Z" | ||
} | ||
""".trimIndent() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:string-template-indent reported by reviewdog 🐶 |
||
val json = Json { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [ktlint] standard:multiline-expression-wrapping reported by reviewdog 🐶 |
||
isLenient = true // Json 큰따옴표 느슨하게 체크. | ||
ignoreUnknownKeys = true // Field 값이 없는 경우 무시 | ||
coerceInputValues = true // "null" 이 들어간경우 default Argument 값으로 대체 | ||
} | ||
val res = json.decodeFromString<ResponseV2>(str) | ||
val sdf = SimpleDateFormat("yyyy년 MM월 dd일 HH:mm:ss", Locale.getDefault()) | ||
println("Kotlinx ${sdf.format(res.getDate())}") | ||
return res.getDate().time | ||
} | ||
} |
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.
🚫 [ktlint] standard:property-naming reported by reviewdog 🐶
Property name should use the screaming snake case notation when the value can not be changed