package com.cooleshow.usercenter.data.api


import com.cooleshow.base.common.BaseConstant
import com.cooleshow.base.data.net.BaseResponse
import com.cooleshow.usercenter.bean.UserLoginInfo
import com.cooleshow.usercenter.data.protocol.RegisterReq
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.*


/*
    用户相关 接口
 */
interface UserApi {

    /*
        用户注册
     */
    @POST("userCenter/register")
    fun register(@Body req: RegisterReq): Observable<BaseResponse<String>>

    /*
        用户登录
     */
    @FormUrlEncoded
    @POST("api-auth/usernameLogin")
    fun login(@FieldMap req: MutableMap<String?, String?>): Observable<BaseResponse<UserLoginInfo>>


    /*
       发送验证码
    */
    @FormUrlEncoded
    @POST(BaseConstant.TEACHER_GROUP + "code/sendSmsCode")
    fun sendSmsCode(@Field("mobile") mobile: String): Observable<BaseResponse<Object>>


    /*
          校验验证码
       */
    @FormUrlEncoded
    @POST(BaseConstant.TEACHER_GROUP + "code/verifySmsCode")
    fun checkVerifyCodeValidity(
        @Field("phone") phone: String,
        @Field("code") code: String
    ): Observable<BaseResponse<Object>>

    /*
         验证码登录
      */
    @FormUrlEncoded
    @POST(BaseConstant.AUTH_GROUP + "smsLogin")
    fun loginByCode(@FieldMap req: MutableMap<String?, String?>): Observable<BaseResponse<UserLoginInfo>>

    /*
      发送验证码
   */
    @FormUrlEncoded
    @POST(BaseConstant.AUTH_GROUP + "user/setUsernameAndPassword")
    fun bindPassword(@Field("password") password: String): Observable<BaseResponse<Object>>
/*
        忘记密码
//     */
//    @POST("userCenter/forgetPwd")
//    fun forgetPwd(@Body req:ForgetPwdReq):Observable<BaseResp<String>>
//
//    /*
//        重置密码
//     */
//    @POST("userCenter/resetPwd")
//    fun resetPwd(@Body req:ResetPwdReq):Observable<BaseResp<String>>
//
//    /*
//        编辑用户资料
//     */
//    @POST("userCenter/editUser")
//    fun editUser(@Body req:EditUserReq):Observable<BaseResp<UserInfo>>
}
