package com.bc_chat.contacts.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 ExitGroupTask constructor(var groupId: String?, var userNames: String?, var userName: String?, var uids: String) : RxDataAsyncTask<JsonObject, ResultEntity<JsonObject>>() {
    /*
    groupId	int	是	群id
    uids	string	是	退群用户id集合，英文逗号分隔
    userNames	string	是	退群用户昵称集合，英文逗号分隔
    userName	string	是	操作用户昵称
    * */
    override fun loadDataAsyncTask(): Flowable<ResultEntity<JsonObject>>? {
        val params: MutableMap<String, Any?> = mutableMapOf("groupId" to groupId, "userNames" to userNames, "userName" to userName, "uids" to uids)
        return RetrofitHelper.api.exitGroup(Encryption.encryption(params))
    }
}
