package com.kaixed.kchat.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.kaixed.kchat.model.response.register.Register
import com.kaixed.kchat.model.response.search.UserList
import com.kaixed.kchat.repository.UserRepo

/**
 * @Author: kaixed
 * @Date: 2024/10/23 20:14
 */
class UserViewModel : ViewModel() {
    private val userRepo: UserRepo = UserRepo()

    fun getUserListByNickname(username: String): MutableLiveData<UserList?> =
        userRepo.getUserListByNickname(username)

    fun register(
        password: String,
        nickname: String,
        avatarUrl: String,
        signature: String,
        telephone: String
    ): MutableLiveData<Register?> =
        userRepo.register(password, nickname, avatarUrl, signature, telephone)

    fun changeNickname(username: String, nickname: String): MutableLiveData<Boolean> =
        userRepo.changeNickname(username, nickname)

}
