package com.adealink.weparty.playmate

import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStoreOwner
import com.adealink.frame.spi.RegisterService
import com.adealink.weparty.module.playmate.IPlaymateService
import com.adealink.weparty.module.playmate.viewmodel.IPlaymateDetailViewModel
import com.adealink.weparty.module.playmate.viewmodel.IPlaymateViewModel
import com.adealink.weparty.playmate.detail.viewmodel.PlaymateDetailViewModel
import com.adealink.weparty.playmate.viewmodel.PlaymateViewModel

@RegisterService(IPlaymateService::class)
class PlaymateServiceImpl : IPlaymateService {

    override fun getService(): IPlaymateService {
        return this
    }

    override fun getPlaymateViewModel(owner: ViewModelStoreOwner): IPlaymateViewModel? {
        return ViewModelProvider(owner)[PlaymateViewModel::class.java]
    }

    override fun getPlaymateDetailViewModel(owner: ViewModelStoreOwner): IPlaymateDetailViewModel? {
        return ViewModelProvider(owner)[PlaymateDetailViewModel::class.java]
    }

    override fun onLogout() {

    }

}