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.VoucherUseLog;
import com.sheep.gamegroup.view.adapter.VoucherUseLogAdapter;

import java.util.Locale;

import io.reactivex.Observable;

/**
 * 我的福利--使用记录
 * Created by realicing on 2018/8/28.
 * realicing@sina.com
 */
public class FgtWelfareUseRecord extends BaseListFragment2<VoucherUseLog> {
    @Override
    protected boolean isFirstGetACache() {
        return false;
    }
    @Override
    protected RecyclerView.Adapter getAdapter() {
        return new VoucherUseLogAdapter(activity, list);
    }

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

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

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

}
