package com.android.chmo.http.service;

import com.android.chmo.app.ChmoApplication;
import com.android.chmo.http.HttpApi;
import com.android.chmo.http.RequestCallback;
import com.android.chmo.model.LoginUser;

import org.xutils.common.Callback;
import org.xutils.http.RequestParams;

/**
 * Created by Administrator on 2018/8/6.
 */

public class PayService {
    private static RequestParams getRequestParams() {
        RequestParams params = new RequestParams(HttpApi.BASE_URL + "pay");
        return params;
    }

    // 发红包
    public static Callback.Cancelable sendRedPkg(String modelPk,String coin, RequestCallback callback) {
        LoginUser user = ChmoApplication.getApp().getLoginUser();
        RequestParams params = getRequestParams();
        params.addQueryStringParameter("action", "giveRed");
        params.addQueryStringParameter("ModelPk", modelPk);
        params.addQueryStringParameter("MemberPk", user.pk);
        params.addQueryStringParameter("coin", coin);
        return HttpApi.GET(params, callback);
    }
}
