Files
cloud-sdk/README.md

53 lines
1.3 KiB
Markdown
Raw Normal View History

2017-04-25 19:27:54 +08:00
# 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:
2017-04-25 19:37:06 +08:00
   import net.irext.webapi.model.*;
2017-04-25 19:27:54 +08:00
2017-04-25 19:37:06 +08:00
import net.irext.webapi.WebAPIs;
2017-04-25 19:27:54 +08:00
Get web API instance:
2017-04-25 19:37:06 +08:00
WebAPIs webApis = WebAPIs.getInstance();
2017-04-25 19:27:54 +08:00
Sign in for access id and token:
2017-04-25 19:37:06 +08:00
   Admin admin = webApis.signIn(userName, password);
2017-04-25 19:27:54 +08:00
2017-04-25 19:37:06 +08:00
int id = admin.getId();
2017-04-25 19:27:54 +08:00
2017-04-25 19:37:06 +08:00
int token = admin.getToken();
2017-04-25 19:27:54 +08:00
2017-04-25 19:42:19 +08:00
Fetch household appliances categories:
2017-04-25 19:27:54 +08:00
2017-04-25 19:42:19 +08:00
List<Category> categories = webApis.listCategories();
Fetch brands of a certain category other than STB:
2017-04-25 19:27:54 +08:00
2017-04-25 19:42:19 +08:00
List<Brand> brands = webApis.listBrands(category.getId());
2017-04-25 19:27:54 +08:00
Fetch cities (in China) for STB:
2017-04-25 19:37:06 +08:00
List<City> provinces = webApis.listProvinces();
2017-04-25 19:27:54 +08:00
2017-04-25 19:37:06 +08:00
List<City> cities = webApis.listCities(provincePrefix);
2017-04-25 19:27:54 +08:00
Fetch STB operators of a certain city:
2017-04-25 19:37:06 +08:00
List<StbOperator>; operators = webApis.listOperators(cityCode);
2017-04-25 19:27:54 +08:00
2017-04-25 19:42:19 +08:00
Fetch remote indexes of a certain brand or STB operator:
2017-04-25 19:27:54 +08:00
2017-04-25 19:42:19 +08:00
List<RemoteIndex> remoteIndexes = webApis.listRemoteIndexes(category.getId(), brand.getId(), city.getCode(), operator.getOperator_id());
2017-04-25 19:27:54 +08:00
Download IR binary for certain remote index:
2017-04-25 19:37:06 +08:00
InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId());