From 3613f142cf474af4bcaba1ae300496ef35fd488d Mon Sep 17 00:00:00 2001 From: Strawmanbobi Date: Tue, 25 Apr 2017 19:27:54 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe2f4aa..20e6c62 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,52 @@ -# irext-web-api -Java web api for remote indexing +# irext Java web API +Indexing to the specified remote index and download its IR binary file + +#### Usage +1. Make the source code to a .jar file for your own project + +2. Java API methods + +Import classes: + +    import net.irext.webapi.model.*; + + import net.irext.webapi.WebAPIs; + +Get web API instance: + + WebAPIs webApis = WebAPIs.getInstance(); + +Sign in for access id and token: + +    Admin admin = webApis.signIn(userName, password); + + int id = admin.getId(); + + int token = admin.getToken(); + +Fetch categories of household appliances: + +    List categories = webApis.listCategories(); + +Fetch brands for an certain category (other than STB): + +    List brands = webApis.listBrands(); + +Fetch cities (in China) for STB: + + List provinces = webApis.listProvinces(); + + List cities = webApis.listCities(provincePrefix); + +Fetch STB operators of a certain city: + + List operators = webApis.listOperators(cityCode); + +Fetch remote indexes of certain brand or STB operator: + +    List remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID); + // default value of each property is null + +Download IR binary for certain remote index: + + InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId()); From 020c5e2aa98f5d7c64c808464749a666a635283b Mon Sep 17 00:00:00 2001 From: Strawmanbobi Date: Tue, 25 Apr 2017 19:30:51 +0800 Subject: [PATCH 2/4] Update README.md --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 20e6c62..8482d98 100644 --- a/README.md +++ b/README.md @@ -8,45 +8,44 @@ Indexing to the specified remote index and download its IR binary file Import classes: -    import net.irext.webapi.model.*; +    `import net.irext.webapi.model.*;` - import net.irext.webapi.WebAPIs; + `import net.irext.webapi.WebAPIs;` Get web API instance: - WebAPIs webApis = WebAPIs.getInstance(); + `WebAPIs webApis = WebAPIs.getInstance();` Sign in for access id and token: -    Admin admin = webApis.signIn(userName, password); +    `Admin admin = webApis.signIn(userName, password);` - int id = admin.getId(); + `int id = admin.getId();` - int token = admin.getToken(); + `int token = admin.getToken();` Fetch categories of household appliances: -    List categories = webApis.listCategories(); +    `List categories = webApis.listCategories();` Fetch brands for an certain category (other than STB): -    List brands = webApis.listBrands(); +    `List brands = webApis.listBrands();` Fetch cities (in China) for STB: - List provinces = webApis.listProvinces(); + `List provinces = webApis.listProvinces();` - List cities = webApis.listCities(provincePrefix); + `List cities = webApis.listCities(provincePrefix);` Fetch STB operators of a certain city: - List operators = webApis.listOperators(cityCode); + `List operators = webApis.listOperators(cityCode);` Fetch remote indexes of certain brand or STB operator: -    List remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID); - // default value of each property is null +    `List remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID);` Download IR binary for certain remote index: - InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId()); + `InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId());` From 423981cc66cb8475478616d0055bdbc59a076147 Mon Sep 17 00:00:00 2001 From: Strawmanbobi Date: Tue, 25 Apr 2017 19:37:06 +0800 Subject: [PATCH 3/4] Update README.md --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8482d98..b89beaf 100644 --- a/README.md +++ b/README.md @@ -8,44 +8,45 @@ Indexing to the specified remote index and download its IR binary file Import classes: -    `import net.irext.webapi.model.*;` +    import net.irext.webapi.model.*; - `import net.irext.webapi.WebAPIs;` + import net.irext.webapi.WebAPIs; Get web API instance: - `WebAPIs webApis = WebAPIs.getInstance();` + WebAPIs webApis = WebAPIs.getInstance(); Sign in for access id and token: -    `Admin admin = webApis.signIn(userName, password);` +    Admin admin = webApis.signIn(userName, password); - `int id = admin.getId();` + int id = admin.getId(); - `int token = admin.getToken();` + int token = admin.getToken(); Fetch categories of household appliances: -    `List categories = webApis.listCategories();` +    List<Category> categories = webApis.listCategories(); Fetch brands for an certain category (other than STB): -    `List brands = webApis.listBrands();` +    List<Brand> brands = webApis.listBrands(); Fetch cities (in China) for STB: - `List provinces = webApis.listProvinces();` + List provinces = webApis.listProvinces(); - `List cities = webApis.listCities(provincePrefix);` + List cities = webApis.listCities(provincePrefix); Fetch STB operators of a certain city: - `List operators = webApis.listOperators(cityCode);` + List; operators = webApis.listOperators(cityCode); Fetch remote indexes of certain brand or STB operator: -    `List remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID);` +    List<RemoteIndex> remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID); Download IR binary for certain remote index: - `InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId());` + InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId()); + From 5ffae188c7cd72b638f0bb0b4a66a1cc5031f32d Mon Sep 17 00:00:00 2001 From: Strawmanbobi Date: Tue, 25 Apr 2017 19:42:19 +0800 Subject: [PATCH 4/4] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b89beaf..a994ba5 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ Sign in for access id and token: int token = admin.getToken(); -Fetch categories of household appliances: +Fetch household appliances categories: -    List<Category> categories = webApis.listCategories(); + List categories = webApis.listCategories(); + +Fetch brands of a certain category other than STB: -Fetch brands for an certain category (other than STB): - -    List<Brand> brands = webApis.listBrands(); + List brands = webApis.listBrands(category.getId()); Fetch cities (in China) for STB: @@ -42,9 +42,9 @@ Fetch STB operators of a certain city: List; operators = webApis.listOperators(cityCode); -Fetch remote indexes of certain brand or STB operator: +Fetch remote indexes of a certain brand or STB operator: -    List<RemoteIndex> remoteIndexes = webApis.listRemoteIndexes(categoryID, brandID, cityCode, operatorID); + List remoteIndexes = webApis.listRemoteIndexes(category.getId(), brand.getId(), city.getCode(), operator.getOperator_id()); Download IR binary for certain remote index: