package com.gh.gamecenter.minigame.wechat

import com.gh.gamecenter.entity.SubjectSettingEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.retrofit.service.ApiService
import com.gh.gamecenter.subject.ISubjectRepository
import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.ResponseBody
import okhttp3.ResponseBody.Companion.toResponseBody

class WGameSubjectRepository(
    private val api: ApiService = RetrofitManager.getInstance().newApi
) : ISubjectRepository {
    override fun getColumnSettings(column_id: String?): Observable<SubjectSettingEntity> {
        return api.getWGameColumnSettings(column_id)
    }

    override fun getSubjectName(column_id: String?): Observable<ResponseBody> {
        return Observable.just("{\"name\": \"专题\"}".toResponseBody("application/json".toMediaTypeOrNull()))
    }
}