Commit 74e7d457 authored by liusheng's avatar liusheng

Merge branch 'cc-dev' into 11a-dev

parents d62e4e00 3bc259c4
package com.github.shadowsocks.http
data class ApiResult<T>(
val code: Int,
val data: T? = null,
val error: String? = null,
) {
constructor(err: ApiError) : this(err.code, null, err.msg)
fun isSuccessful(): Boolean = code == 200 && error == null
fun unwrapData(): T = data!!
}
enum class ApiError(val code: Int, val msg: String) {
NetworkError(901, "网络错误")
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment