package com.bc_chat.mine.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 FeedbackTask constructor(var photo: String, var content: String, var phone: String) : RxDataAsyncTask<JsonObject, ResultEntity<JsonObject>>() {
    //cuid	int	是	被获取资料用户id
    override fun loadDataAsyncTask(): Flowable<ResultEntity<JsonObject>>? {
        val params: MutableMap<String, Any?> = mutableMapOf("content" to content, "phone" to phone)
        if (!photo.isNullOrEmpty()) {
            params["photo"] = photo
        }
        return RetrofitHelper.api.feedback(Encryption.encryption(params))
    }
}
