package com.kaixed.kchat.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.kaixed.kchat.model.friend.AcceptContactRequest
import com.kaixed.kchat.model.friend.ContactRequestResponse
import com.kaixed.kchat.model.response.friend.SearchFriends
import com.kaixed.kchat.repository.ContactRepo

/**
 * @Author: kaixed
 * @Date: 2024/10/20 17:40
 */
class ContactViewModel : ViewModel() {
    private val contactRepo = ContactRepo()

    fun getContactRequestList(username: String): MutableLiveData<ContactRequestResponse?> =
        contactRepo.getContactRequestList(username)

    fun searchFriends(username: String): MutableLiveData<SearchFriends?> =
        contactRepo.searchContact(username)

    fun acceptContactRequest(
        username: String,
        contactId: String
    ): MutableLiveData<AcceptContactRequest?> =
        contactRepo.acceptContactRequest(username, contactId)
}
