package Ġcom . example . clone _ da um . di . module Ċ Ċ import Ġb rig it te . Authorization Interceptor Ċ import Ġb rig it te . di . d agger . module . Ok http Module Ċ import Ġcom . example . clone _ da um . model . remote . Da um Service Ċ import Ġcom . example . clone _ da um . model . remote . Da um Suggest Service Ċ import Ġcom . example . clone _ da um . model . remote . Github Service Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġorg . slf 4 j . Logger Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġjavax . inject . Singleton Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġ< a Ġhref =" mailto : auc d 2 9 @ gmail . com "> Bur ke ĠCh oi </ a > Ġon Ġ 2 0 1 8 . Ġ 1 2 . Ġ 5 . Ġ< p /> Ċ Ġ*/ Ċ Ċ @ Module ( includes Ġ= Ġ[ Ok http Module :: class ]) Ċ class ĠNetwork Module Ġ{ ĊĠĠĠ Ġ// Ġëĭ¤ ìĪĺ ê°ľ ìĿĺ Ġretrofit ĠìĿ Ħ ĠìĿ´ìļ© íķ´ìķ¼ Ġíķĺ ë¯ Ģë¡ľ ĠRet rofit . Builder Ġë ¥ ¼ ĠìłĦ ëĭ ¬ Ġë°Ľ ìĿĢ ĠíĽĦ ĊĠĠĠ Ġ// ĠìĿ´ ê³ ³ ìĹĲìĦľ Ġbase url ĠìĿ Ħ ĠìĦ¤ìłķ íķĺëĬĶ Ġë°© ìĭĿ ìĿĦ ĠìĿ´ìļ© íķľëĭ¤ . ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠLOG _ CLASS Ġ= ĠNetwork Module :: class . java ĊĊĠĠĠĠĠĠĠ Ġconst Ġval ĠG ITHUB _ BASE _ URL ĠĠĠĠĠĠ Ġ= Ġ" https :// raw . githubusercontent . com /" ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠDA UM _ BASE _ URL ĠĠĠĠĠĠĠĠ Ġ= Ġ" https :// m . da um . net /" ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠDA UM _ SU G GEST _ BASE _ URL Ġ= Ġ" https :// ms uggest . search . da um . net /" ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Github Service ( ret rofit Builder : ĠRet rofit . Builder ): ĠGithub Service Ġ= ĊĠĠĠĠĠĠĠ Ġretrofit Builder . baseUrl ( GITHUB _ BASE _ URL ). build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( Github Service :: class . java ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Da um Service ( ret rofit Builder : ĠRet rofit . Builder ): ĠDa um Service Ġ= ĊĠĠĠĠĠĠĠ Ġretrofit Builder . baseUrl ( DA UM _ BASE _ URL ). build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( Da um Service :: class . java ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Da um Suggest Service ( ret rofit Builder : ĠRet rofit . Builder ): ĠDa um Suggest Service Ġ= ĊĠĠĠĠĠĠĠ Ġretrofit Builder . baseUrl ( DA UM _ SU G GEST _ BASE _ URL ). build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( Da um Suggest Service :: class . java ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Logger (): ĠLogger Ġ= ĊĠĠĠĠĠĠĠ ĠLoggerFactory . getLogger ( LOG _ CLASS ) ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide LogLevel () Ġ= ĊĠĠĠĠĠĠĠ ĠHttp Logging Interceptor . Level . BODY ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Authorization Interceptor (): ĠAuthorization Interceptor ? Ġ= Ġnull Ċ } Ċ