package com.sheep.gamegroup.view.fragment;

import android.support.v7.widget.RecyclerView;

import com.sheep.gamegroup.model.api.ApiService;
import com.sheep.gamegroup.model.entity.BaseMessage;
import com.sheep.gamegroup.model.entity.DownloadWelfare;
import com.sheep.gamegroup.view.adapter.DownloadWelfareAdapter;

import java.util.Locale;

import io.reactivex.Observable;

/**
 * 我的福利--下载福利
 * Created by realicing on 2018/8/28.
 * realicing@sina.com
 */
public class FgtMyDownloadWelfareList extends BaseListFragment2<DownloadWelfare> {
    @Override
    protected RecyclerView.Adapter getAdapter() {
        return new DownloadWelfareAdapter(activity, list);
    }

    @Override
    protected String getKey(int page, int per_page) {
        return String.format(Locale.CHINA, "app/game_consumption/my_voucher?page=%d&per_page=%d", page, per_page);
    }

    @Override
    protected Observable<BaseMessage> getApi(ApiService apiService) {
        return apiService.getMyWelfareList(page, per_page);
    }

    @Override
    protected Class<DownloadWelfare> getTClass() {
        return DownloadWelfare.class;
    }

}
