package com.adealink.weparty.playmate

import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStoreOwner
import com.adealink.frame.spi.RegisterService
import com.adealink.weparty.App
import com.adealink.weparty.module.playmate.IPlaymateService
import com.adealink.weparty.module.playmate.viewmodel.IPlaymateViewModel
import com.adealink.weparty.playmate.datasource.remote.PlaymateHttpService
import com.adealink.weparty.playmate.viewmodel.PlaymateViewModel

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

    private val playmateHttpService by lazy {
        App.instance.networkService.getHttpService(PlaymateHttpService::class.java)
    }


    override fun getService(): IPlaymateService {
        return this
    }

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

    override fun logout() {

    }

}