You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
808 B

package com.gyf.csams
interface UrlPath {
fun build(): String
}
/**
* 帐号接口
*
* @property path
*/
enum class AccountApi(val path: String) : UrlPath {
Register("/register"),
CheckId("/register/checkId"),
Login("/login"),
LoginToken("/login/token");
override fun build(): String {
return "/api/account${this.path}"
}
}
enum class MainApi(val path: String) : UrlPath {
HotActivity("/hotActivity");
override fun build(): String {
return "/api/main/${this.path}"
}
}
/**
* 构建服务端请求接口地址
*
*/
class Api {
companion object {
fun buildUrl(urlPath: UrlPath): String {
return "${BuildConfig.SERVER_ADDRESS}${urlPath.build()}"
}
}
}
const val NOT_IMPL_TIP = "功能尚未实现!"