package Ġcom . cho il abo . simple h ate bu . data . h ate bu Ċ Ċ import Ġandroidx . paging . Paging Source Ċ import Ġcom . cho il abo . simple h ate bu . data . h ate bu . converter . H ate bu Entry Converter Ċ import Ġcom . cho il abo . simple h ate bu . data . h ate bu . entity . H ate bu Entry Ċ import Ġcom . cho il abo . simple h ate bu . data . h ate bu . remote . H ate bu Api Ċ import Ġcom . cho il abo . simple h ate bu . data . h ate bu . repository . H ate bu Repository Ċ import Ġdagger . Re usable Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . with Context Ċ import Ġjavax . inject . Inject Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġs ato _ sh in ich iro Ġon Ġ 2 0 2 0 / 0 9 / 2 9 Ċ Ġ*/ Ċ @ Re usable Ċ class ĠH ate bu DataModel Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġh ate bu Api : ĠH ate bu Api , ĊĠĠĠ Ġprivate Ġval Ġh ate bu Entry Converter : ĠH ate bu Entry Converter , ĊĠĠĠ Ġprivate Ġval Ġh ate bu Repository : ĠH ate bu Repository Ċ ) Ġ{ ĊĊĠĠĠ Ġfun ĠgetAll (): ĠP aging Source < Int , ĠH ate bu Entry > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġh ate bu Repository . getAll () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġload () Ġ{ ĊĠĠĠĠĠĠĠ Ġwith Context ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġh ate bu Api . get Hot ent ory () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. let Ġ{ Ġh ate bu Entry Converter . from ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. also Ġ{ Ġh ate bu Repository . insert IfNeeded ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġmark Read By Links ( links : ĠList < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġwith Context ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġh ate bu Repository . mark Read By Links ( links ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }