更新Google登录
This commit is contained in:
@@ -9,6 +9,11 @@ interface DictService {
|
||||
* 获取字典项
|
||||
*/
|
||||
suspend fun getDictByKey(key: String): DictItem
|
||||
|
||||
/**
|
||||
* 获取字典列表
|
||||
*/
|
||||
suspend fun getDistList(keys: List<String>): List<DictItem>
|
||||
}
|
||||
|
||||
class DictServiceImpl : DictService {
|
||||
@@ -16,4 +21,9 @@ class DictServiceImpl : DictService {
|
||||
val resp = ApiClient.api.getDict(key)
|
||||
return resp.body()?.data ?: throw Exception("failed to get dict")
|
||||
}
|
||||
|
||||
override suspend fun getDistList(keys: List<String>): List<DictItem> {
|
||||
val resp = ApiClient.api.getDicts(keys.joinToString(","))
|
||||
return resp.body()?.list ?: throw Exception("failed to get dict list")
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ data class DictItem(
|
||||
@SerializedName("key")
|
||||
val key: String,
|
||||
@SerializedName("value")
|
||||
val value: String,
|
||||
val value: Any,
|
||||
@SerializedName("desc")
|
||||
val desc: String,
|
||||
)
|
||||
@@ -400,6 +400,11 @@ interface RaveNowAPI {
|
||||
@Query("key") key: String
|
||||
): Response<DataContainer<DictItem>>
|
||||
|
||||
@GET("dicts")
|
||||
suspend fun getDicts(
|
||||
@Query("keys") keys: String
|
||||
): Response<ListContainer<DictItem>>
|
||||
|
||||
@POST("captcha/generate")
|
||||
suspend fun generateCaptcha(
|
||||
@Body body: CaptchaRequestBody
|
||||
|
||||
Reference in New Issue
Block a user