AuthViewModel.kt 553 B

12345678910111213141516171819202122232425262728
  1. package com.hongyegroup.auth.mvvm
  2. import com.guadou.lib_baselib.base.vm.BaseViewModel
  3. import com.guadou.lib_baselib.ext.toast
  4. class AuthViewModel constructor() : BaseViewModel() {
  5. private val mAuthRepository: AuthRepository by lazy { AuthRepository() }
  6. fun getServiceTime() {
  7. launchOnUI {
  8. loadStartProgress()
  9. val serverTime = mAuthRepository.getServerTime()
  10. serverTime.checkSuccess {
  11. toast(it.timestamps.toString())
  12. }
  13. loadSuccess()
  14. }
  15. }
  16. }