package com.sheep.gamegroup.util;

import com.sheep.gamegroup.model.api.ApiService;
import com.sheep.gamegroup.model.entity.BaseMessage;
import com.sheep.gamegroup.model.entity.GameListType;

import io.reactivex.Observable;

/**
 * Created by realicing on 2018/10/31.
 * realicing@sina.com
 */
public class ObservableUtil {
    //根据游戏列表类型来获取Observable
    public static Observable<BaseMessage> getObservable(ApiService apiService, GameListType gameListType) {
        switch (gameListType.getTitle()) {
            case "猜你喜欢":
                return apiService.getUserLikeList();
            default:
                return apiService.getPlayGameList(1, 20, gameListType.getMap());
        }
    }
}
