package Ġcom . tun gn ui . dal at laptop . api Ċ Ċ import Ġcom . tun gn ui . dal at laptop . models . Product Ċ import Ġio . reactivex . Observable Ċ import Ġokhttp 3 . RequestBody Ċ import Ġretrofit 2 . Response Ċ import Ġretrofit 2 . http .* ĊĊ Ċ /** Ċ Ġ* ĠCreated Ġby Ġthan h Ġon Ġ 2 2 / 0 9 / 2 0 1 7 . Ċ Ġ*/ Ċ interface ĠProduct Service { ĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products /{ id }") ĊĠĠĠ Ġfun Ġsingle (@ Path (" id ") Ġproduct ID : Int ): ĠObservable < Product > ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ") ĊĠĠĠ Ġfun Ġpaging (@ Query (" page ") Ġpage : Int Ġ= 1 , Ġ@ Query (" per _ page ") Ġper Page : Int = 1 5 ): Observable < List < Product >> ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ") ĊĠĠĠ Ġfun Ġget Re comment Products (@ Query (" include ") Ġids : List < Int >): Observable < List < Product >> ĊĊĠĠĠ Ġ@ GET ĊĠĠĠ Ġfun ĠgetAll (@ Url Ġurl : String ): Observable < Response < List < Product >>> ĊĊĠĠĠ Ġ@ POST ("/ wp - json / wc / v 2 / products ") ĊĠĠĠ Ġfun Ġcreate (@ Body Ġproduct : ĠProduct ): Observable < Product > ĊĊĠĠĠ Ġ@ PUT ("/ wp - json / wc / v 2 / products /{ id }") ĊĠĠĠ Ġfun Ġupdate (@ Path (" id ") Ġproduct ID : Int ,@ Body Ġproduct : ĠProduct ): Observable < Product > ĊĊĠĠĠ Ġ@ DELETE ("/ wp - json / wc / v 2 / products /{ id }") ĊĠĠĠ Ġfun Ġdelete (@ Path (" id ") Ġproduct ID : Int ,@ Query (" force ") Ġforce : Boolean = true ): Observable < Product > ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ") ĊĠĠĠ Ġfun ĠgetBy Category (@ Query (" category ") Ġcategory Id : Int ,@ Query (" page ") Ġpage : Int , Ġ@ Query (" per _ page ") Ġper Page : ĠInt = 1 5 ) ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ? order = desc & orderby = date ") ĊĠĠĠ Ġfun Ġget New est (@ Query (" page ") Ġpage : Int = 1 , Ġ@ Query (" per _ page ") Ġper Page : ĠInt = 1 5 ): Observable < List < Product >> ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ? on _ sale = true ") ĊĠĠĠ Ġfun Ġget Sale (@ Query (" page ") Ġpage : Int = 1 , Ġ@ Query (" per _ page ") Ġper Page : ĠInt = 1 5 ): Observable < List < Product >> ĊĊĠĠĠ Ġ@ GET ("/ wp - json / wc / v 2 / products ? featured = true ") ĊĠĠĠ Ġfun Ġget Feature d (@ Query (" page ") Ġpage : Int = 1 , Ġ@ Query (" per _ page ") Ġper Page : ĠInt = 1 5 ): Observable < List < Product >> Ċ }