package com.bc_chat.account.task

import com.bc_chat.bc_base.http.Encryption
import com.bc_chat.bc_base.http.RetrofitHelper
import com.google.gson.JsonObject
import com.zhaohaoting.framework.abs.entity.ResultEntity
import com.zhaohaoting.framework.abs.task.RxDataAsyncTask
import io.reactivex.Flowable

/**
 * author：Created by zhaohaoting on 2019/3/5
 * email：526309416@qq.com
 * desc：验证验证没
 */
class VerVerfiyCodeTask constructor(var phone: String?, var code: String?, var type: Int?) : RxDataAsyncTask<JsonObject, ResultEntity<JsonObject>>() {

    //    phone	string	是	手机号
//    code	int	是	验证码
    //    type	int	是	1-注册 2-忘记密码
    override fun loadDataAsyncTask(): Flowable<ResultEntity<JsonObject>>? {
        val params: MutableMap<String, Any?> = mutableMapOf("phone" to phone, "code" to code, "type" to type)
        return RetrofitHelper.api.varfiyCode(Encryption.encryption(params))
    }
}
