package Ġcom . h 1 0 0 0 0 b 8 4 . android . my book library . api Ċ Ċ import Ġcom . h 1 0 0 0 0 b 8 4 . android . my book library . model . Detail Book Ċ import Ġcom . h 1 0 0 0 0 b 8 4 . android . my book library . api . response . Book Response Ċ import Ġcom . h 1 0 0 0 0 b 8 4 . android . my book library . util . Constants Ċ import Ġio . reactivex . Single Ċ import Ġretrofit 2 . adapter . rx java 2 . Rx Java 2 Call Adapter Factory Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ import Ġretrofit 2 . http . GET Ċ import Ġretrofit 2 . http . Path Ċ Ċ interface ĠApi Service Ġ{ ĊĊĠĠĠ Ġ@ GET (" new ") ĊĠĠĠ Ġfun Ġget New Book List (): ĠSingle < Book Response > ĊĊĠĠĠ Ġ@ GET (" books /{ isbn 1 3 }") ĊĠĠĠ Ġfun Ġget Detail Book (@ Path (" isbn 1 3 ") Ġis bn 1 3 : ĠString ): ĠSingle < Detail Book > ĊĊĠĠĠ Ġ@ GET (" search /{ query }") ĊĠĠĠ Ġfun Ġget Search Book (@ Path (" query ") Ġquery : ĠString ): ĠSingle < Book Response > ĊĊĠĠĠ Ġ@ GET (" search /{ query }/{ page }") ĊĠĠĠ Ġfun Ġget Search Book (@ Path (" query ") Ġquery : ĠString , Ġ@ Path (" page ") Ġpage : ĠInt ): ĠSingle < Book Response > ĊĊĠĠĠ Ġcompanion Ġobject ĠFactory Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġcreate (): ĠApi Service Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġretrofit Ġ= Ġretrofit 2 . Ret rofit . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Call Adapter Factory ( Rx Java 2 Call Adapter Factory . create ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Converter Factory ( Gson Converter Factory . create ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. baseUrl ( Constants . BASE _ URL ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġretrofit . create ( ApiService :: class . java ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ