Skip to content

Instantly share code, notes, and snippets.

View CreateChance's full-sized avatar
🎯
Focusing

高超 CreateChance

🎯
Focusing
View GitHub Profile
@CreateChance
CreateChance / RetrofitKotlinNullSafety.kt
Last active December 20, 2023 03:46
The most elegant practice found so far is to use retrofit, gson converter, and kudos to ensure the empty security of kotlin data.
package org.example
import com.google.gson.annotations.SerializedName
import com.kanyun.kudos.annotations.Kudos
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET