Commit 56dbe874 by TaylorZhang

feat(项目):更新xxApi文件规范

parent 0c1fe3e6
......@@ -15,8 +15,7 @@ import com.autocareai.mvvmdemo.demo.enity.UserEntity
*/
object DemoApi {
// 登录
private const val LOGIN = "user/login"
// TODO: 2020/6/28 Api类中不需要定义网络请求路径常量,在实际项目中直接在方法中以ApiVersion.version + 路径即可
/**
* 登录
......@@ -25,7 +24,7 @@ object DemoApi {
* @param password 密码
*/
fun login(phone: String, password: String): HttpObservable<UserEntity> {
return HttpUtil.postForm(LOGIN)
return HttpUtil.postForm("user/login")
.param("username", phone)
.param("password", password)
.asResponse()
......
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