//package com.gh.gamecenter.qa.article
//
//import android.app.Application
//import com.gh.gamecenter.common.baselist.ListViewModel
//import com.gh.gamecenter.login.user.UserManager
//import com.gh.gamecenter.qa.entity.ArticleEntity
//import com.gh.gamecenter.retrofit.RetrofitManager
//import com.lightgame.utils.Utils
//import io.reactivex.Observable
//import io.reactivex.Single
//
//class SimpleArticleListViewModel(application: Application)
//    : ListViewModel<ArticleEntity, ArticleEntity>(application) {
//
//    // 有两种排序方式 1.时间顺序 2.热度顺序，默认时间
//    var sortType = ""
//
//    private var mSortType = SortType.SORT_BY_TIME
//
//    override fun provideDataObservable(page: Int): Observable<MutableList<ArticleEntity>>? {
//        return null
//    }
//
//    override fun provideDataSingle(page: Int): Single<MutableList<ArticleEntity>> {
//        mSortType = if (sortType == "sortByVote") {
//            SortType.SORT_BY_VOTE
//        } else {
//            SortType.SORT_BY_TIME
//        }
//        return RetrofitManager.getInstance()
//                .api
//                .getAllCommunityArticles(CommunityManager.getInstance().community.id, mSortType.value, page, Utils.getTime(getApplication()))
//    }
//
//    override fun mergeResultLiveData() {
//        mResultLiveData.addSource(mListLiveData) { mResultLiveData.postValue(it) }
//    }
//
//    enum class SortType(val value: String) {
//        SORT_BY_VOTE("vote:-1"),
//        SORT_BY_TIME("time.create:-1");
//
//        override fun toString() = value
//    }
//
//}