package com.gh.gamecenter.subject

import com.gh.gamecenter.entity.SubjectData
import com.gh.gamecenter.minigame.qq.QGameSubjectListRepository
import com.gh.gamecenter.minigame.qq.QGameSubjectRepository
import com.gh.gamecenter.minigame.wechat.WGameSubjectCPMListRepository
import com.gh.gamecenter.minigame.wechat.WGameSubjectCPMRepository
import com.gh.gamecenter.minigame.wechat.WGameSubjectListRepository
import com.gh.gamecenter.minigame.wechat.WGameSubjectRepository

object SubjectRepositoryFactory {
    fun createRepo(subjectType: SubjectData.SubjectType): ISubjectRepository = when(subjectType) {
        SubjectData.SubjectType.QQ_GAME -> QGameSubjectRepository()
        SubjectData.SubjectType.WECHAT_GAME -> WGameSubjectRepository()
        SubjectData.SubjectType.WECHAT_GAME_CPM -> WGameSubjectCPMRepository()
        else -> SubjectRepository()
    }

    fun createListRepo(subjectType: SubjectData.SubjectType): ISubjectListRepository = when(subjectType) {
        SubjectData.SubjectType.QQ_GAME -> QGameSubjectListRepository()
        SubjectData.SubjectType.WECHAT_GAME -> WGameSubjectListRepository()
        SubjectData.SubjectType.WECHAT_GAME_CPM -> WGameSubjectCPMListRepository()
        else -> SubjectListRepository()
    }
}