package Ġcom . no ah . express _ send . view Mod le Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . no ah . express _ send . repository . Address Book Repository Ċ import Ġcom . no ah . express _ send . ui . base . Base ViewModel Ċ import Ġcom . no ah . internet . Constant Ċ import Ġcom . no ah . internet . response . Response Address Book Ċ import Ġkotlinx . coroutines . launch Ċ Ċ /** Ċ Ġ* Ġ@ Auth er : Ġ ä½ķ é£ ĺ Ċ Ġ* Ġ@ Date : Ġ 4 / 3 0 / 2 1 Ġ 1 4 : 4 6 Ċ Ġ* Ġ@ Description : Ċ Ġ*/ Ċ class ĠAddress Book ViewModel ( application : ĠApplication ) Ġ: ĠBase ViewModel ( application ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġaddress Book Repository Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠAddress Book Repository () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġvar Ġaddress Book List Ġ= ĠMutable LiveData < ArrayList < Response Address Book >>() ĊĠĠĠ Ġfun Ġget Personal Address Book ( phone Num : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Book List . value Ġ= Ġaddress Book Repository . get Personal Address Book ( phone Num ). data ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġvar Ġis Success Delete Address Book Ġ= ĠMutable LiveData < Boolean >() ĊĠĠĠ Ġfun Ġdelete Address Book ( id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Success Delete Address Book . value Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Book Repository . delete Address Book ( id ). result Code Ġ== ĠConstant . CODE _ SUCCESS ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }