package com.ifavine.pay.api;


import com.ifavine.pay.vo.CommonListResponse;

import com.ifavine.pay.vo.CommonResponse;
import com.ifavine.pay.vo.User;

import org.json.JSONObject;

import retrofit2.Call;

/**
 * Created by tree on 7/13/2016.
 */
public class APIWrapper extends RetrofitUtil {
    private static APIWrapper mAPIWrapper;

    public static APIWrapper getInstance() {
        if (mAPIWrapper == null) mAPIWrapper = new APIWrapper();
        return mAPIWrapper;
    }

    /**
     * 日事日毕列表
     *
     * @param Page
     * @param PageSize
     * @return
     */

    public Call<CommonResponse<User>> getMsgDaliyList(int Page, int PageSize) {

        JSONObject data = new JSONObject();
        try {
            data.put("Page", Page);
            data.put("PageSize", PageSize);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return getAPIService().getMsgDaliyList(data.toString());
    }

    /**
     * * 日事日毕列表
     * status :0待处理 1处理中 2待评价 3未关闭 4关闭
     * DutyStatus ： 1、已认领 2、可认领 3、需指定
     * Satisfied =0或null未操作 =1满意 =2不满意(正式机)
     *
     * @param Page
     * @param PageSize
     * @param Status
     * @param KeyWord
     * @param Sno
     * @param CreatorID
     * @param Title
     * @param StartTime
     * @param EndTime
     * @return
     */
    public Call<CommonListResponse<User>> getMsgDaliyList2(int Page, int PageSize, int Status, String KeyWord, String Sno, String CreatorID, String Title, String StartTime, String EndTime) {

        JSONObject data = new JSONObject();
        try {
            data.put("Page", Page);
            data.put("PageSize", PageSize);
            data.put("Status", Status);
            data.put("KeyWord", KeyWord);
            data.put("Sno", Sno);
            data.put("CreatorID", CreatorID);
            data.put("Title", Title);
            data.put("StartTime", StartTime);
            data.put("EndTime", EndTime);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return getAPIService().getMsgDaliyList2(data.toString());
    }


}