package com.bc_chat.bc_base.task

import com.bc_chat.bc_base.entity.wallet.SendRedPacketEntity
import com.bc_chat.bc_base.http.Encryption
import com.bc_chat.bc_base.http.RetrofitHelper
import com.zhaohaoting.framework.abs.entity.ResultEntity
import com.zhaohaoting.framework.abs.task.RxDataAsyncTask
import io.reactivex.Flowable

/**
 * author：Created by zhaohaoting on 2019/9/6
 * email：526309416@qq.com
 * desc：
 */
class SendRedPacketTask(val type: Int?
                        , var receiver_id: String?
                        , var amount: String
                        , val pay_key: String
                        , val group_id: String?
                        , val num: Int?
                        , val title: String?) : RxDataAsyncTask<SendRedPacketEntity, ResultEntity<SendRedPacketEntity>>() {
    override fun loadDataAsyncTask(): Flowable<ResultEntity<SendRedPacketEntity>>? {
        val params: MutableMap<String, Any?> = mutableMapOf(
                "type" to type
                , "receiver_id" to receiver_id
                , "amount" to amount
                , "pay_key" to pay_key
                , "group_id" to group_id
                , "num" to num
                , "title" to title
        )
        return RetrofitHelper.api.sendRedPacket(Encryption.encryption(params))
    }
}
