diff --git a/android-example/app/build.gradle b/android-example/app/build.gradle index 7b69887..3e17ca9 100644 --- a/android-example/app/build.gradle +++ b/android-example/app/build.gradle @@ -36,10 +36,11 @@ android { dependencies { implementation project(':decodesdk') - implementation project(':web-api') implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.aar']) + implementation 'net.irext.webapi:irext-androidapi:1.5.1' + implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-v4:28.0.0' diff --git a/android-example/app/src/main/java/net/irext/ircontrol/ui/fragment/CategoryFragment.java b/android-example/app/src/main/java/net/irext/ircontrol/ui/fragment/CategoryFragment.java index 1494785..4d95ae3 100644 --- a/android-example/app/src/main/java/net/irext/ircontrol/ui/fragment/CategoryFragment.java +++ b/android-example/app/src/main/java/net/irext/ircontrol/ui/fragment/CategoryFragment.java @@ -17,8 +17,8 @@ import net.irext.ircontrol.ui.activity.CreateActivity; import net.irext.ircontrol.ui.adapter.CategoryAdapter; import net.irext.ircontrol.ui.widget.PullToRefreshListView; import net.irext.ircontrol.utils.MessageUtil; +import net.irext.webapi.WebAPICallbacks; import net.irext.webapi.model.Category; -import net.irext.webapi.WebAPICallbacks.ListCategoriesCallback; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -50,7 +50,7 @@ public class CategoryFragment extends BaseCreateFragment { private MsgHandler mMsgHandler; private IRApplication mApp; - private ListCategoriesCallback mListCategoriesCallback = new ListCategoriesCallback() { + private WebAPICallbacks.ListCategoriesCallback mListCategoriesCallback = new WebAPICallbacks.ListCategoriesCallback() { @Override public void onListCategoriesSuccess(List categories) { mCategories = categories; diff --git a/android-example/gradle.properties b/android-example/gradle.properties index ead51f6..209cb8d 100644 --- a/android-example/gradle.properties +++ b/android-example/gradle.properties @@ -19,4 +19,6 @@ org.gradle.jvmargs=-Xmx4096M \ android.useDeprecatedNdk=true android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=false + +android.useAndroidX=true \ No newline at end of file diff --git a/android-example/settings.gradle b/android-example/settings.gradle index 6796516..a38dc3a 100644 --- a/android-example/settings.gradle +++ b/android-example/settings.gradle @@ -1 +1 @@ -include ':app', ':decodesdk', ':web-api' +include ':app', ':decodesdk' diff --git a/android-example/web-api/.gitignore b/android-example/web-api/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/android-example/web-api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/android-example/web-api/README.md b/android-example/web-api/README.md deleted file mode 100644 index 25568bd..0000000 --- a/android-example/web-api/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## Usage - -### 1. Register your APP -Register your APP on irext SDK console [irext SDK console](http://irext.net), (You need to register an irext account first) - -You need to fetch the package name and SHA1 signature of your APP and fill these information as SDK registration information - -While your APP is registered, you can see the APP key and APP secret in your APP list - -### 2. Import the SDK -You can either import this project or download the web-api .aar file from [Android SDK](http://irext-lib-releaese.oss-cn-hangzhou.aliyuncs.com/decode/0.1.2/web-api-android-0.1.2.aar) and import to your Android APP project - -Add 2 meta-data tags to your AndroidManifest.xml providing APP key and secret get from step 1. -```xml - - - -``` - -### 3. Use the SDK - -Import classes: -```java -import net.irext.webapi.model.*; -import net.irext.webapi.WebAPIs; -``` -Get web API instance: -```java -WebAPIs webApis = WebAPIs.getInstance(); -``` -Sign in for access id and token: -```java -UserApp userApp = webApis.signIn(context); -int id = userApp.getId(); -int token = userApp.getToken(); -``` -Fetch household appliances categories: -```java -List categories = webApis.listCategories(); -``` -Fetch brands of a certain category other than STB: -```java -List brands = webApis.listBrands(category.getId()); -``` -Fetch cities (in China) for STB: -```java -List provinces = webApis.listProvinces(); -List cities = webApis.listCities(provincePrefix); -``` -Fetch STB operators of a certain city: -```java -List; operators = webApis.listOperators(cityCode); -``` -Fetch remote indexes of a certain brand or STB operator: -```java -List remoteIndexes = webApis.listRemoteIndexes(category.getId(), brand.getId(), city.getCode(), operator.getOperator_id()); -``` -Download IR binary for certain remote index: -```java -InputStream is = webApis.downloadBin(remoteIndex.getRemote_map(), remoteIndex.getId()); -``` diff --git a/android-example/web-api/build.gradle b/android-example/web-api/build.gradle deleted file mode 100644 index ff970ab..0000000 --- a/android-example/web-api/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'com.android.library' - -android { - signingConfigs { - } - compileSdk 36 - defaultConfig { - minSdkVersion 26 - targetSdkVersion 36 - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - productFlavors { - } - namespace 'net.irext.webapi' -} - -dependencies { - implementation 'com.squareup.okhttp3:okhttp:4.11.0' - implementation 'com.squareup.okio:okio:3.4.0' - implementation 'com.google.code.gson:gson:2.13.2' -} diff --git a/android-example/web-api/libs/gson-2.8.0.jar b/android-example/web-api/libs/gson-2.8.0.jar deleted file mode 100644 index 1235f63..0000000 Binary files a/android-example/web-api/libs/gson-2.8.0.jar and /dev/null differ diff --git a/android-example/web-api/libs/okhttp-3.7.0.jar b/android-example/web-api/libs/okhttp-3.7.0.jar deleted file mode 100644 index 853c553..0000000 Binary files a/android-example/web-api/libs/okhttp-3.7.0.jar and /dev/null differ diff --git a/android-example/web-api/libs/okio-1.12.0.jar b/android-example/web-api/libs/okio-1.12.0.jar deleted file mode 100644 index 0ac0d70..0000000 Binary files a/android-example/web-api/libs/okio-1.12.0.jar and /dev/null differ diff --git a/android-example/web-api/proguard-rules.pro b/android-example/web-api/proguard-rules.pro deleted file mode 100644 index e4fe55e..0000000 --- a/android-example/web-api/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in C:\Android\android-sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android-example/web-api/src/main/AndroidManifest.xml b/android-example/web-api/src/main/AndroidManifest.xml deleted file mode 100644 index c504323..0000000 --- a/android-example/web-api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/android-example/web-api/src/main/java/net/irext/webapi/WebAPICallbacks.java b/android-example/web-api/src/main/java/net/irext/webapi/WebAPICallbacks.java deleted file mode 100644 index 0a1a52c..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/WebAPICallbacks.java +++ /dev/null @@ -1,90 +0,0 @@ -package net.irext.webapi; - -import net.irext.webapi.model.Brand; -import net.irext.webapi.model.Category; -import net.irext.webapi.model.City; -import net.irext.webapi.model.RemoteIndex; -import net.irext.webapi.model.StbOperator; -import net.irext.webapi.model.UserApp; - -import java.io.InputStream; -import java.util.List; - -/** - * Filename: WebAPICallbacks.java - * Revised: Date: 2017-07-01 - * Revision: Revision: 1.0 - *

- * Description: HTTP Response Callbacks - *

- * Revision log: - * 2017-07-01: created by strawmanbobi - */ -public class WebAPICallbacks { - - public interface SignInCallback { - void onSignInSuccess(UserApp userApp); - void onSignInFailed(); - void onSignInError(); - } - - public interface ListCategoriesCallback { - void onListCategoriesSuccess(List categories); - void onListCategoriesFailed(); - void onListCategoriesError(); - } - - public interface ListBrandsCallback { - void onListBrandsSuccess(List brands); - void onListBrandsFailed(); - void onListBrandsError(); - } - - public interface ListPopularBrandsCallback { - void onListPopularBrandsSuccess(List brands); - void onListPopularBrandsFailed(); - void onListPopularBrandsError(); - } - - public interface ListPopularCitiesCallback { - void onListPopularCitiesSuccess(List cities); - void onListPopularCitiesFailed(); - void onListPopularCitiesError(); - } - - public interface ListProvincesCallback { - void onListProvincesSuccess(List provinces); - void onListProvincesFailed(); - void onListProvincesError(); - } - - public interface ListCitiesCallback { - void onListCitiesSuccess(List cities); - void onListCitiesFailed(); - void onListCitiesError(); - } - - public interface ListAreasCallback { - void onListAreasSuccess(List cities); - void onListAreasFailed(); - void onListAreasError(); - } - - public interface ListOperatersCallback { - void onListOperatorsSuccess(List operators); - void onListOperatorsFailed(); - void onListOperatorsError(); - } - - public interface ListIndexesCallback { - void onListIndexesSuccess(List indexes); - void onListIndexesFailed(); - void onListIndexesError(); - } - - public interface DownloadBinCallback { - void onDownloadBinSuccess(InputStream inputStream); - void onDownloadBinFailed(); - void onDownloadBinError(); - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/WebAPIs.java b/android-example/web-api/src/main/java/net/irext/webapi/WebAPIs.java deleted file mode 100644 index 0f8a1b5..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/WebAPIs.java +++ /dev/null @@ -1,412 +0,0 @@ -package net.irext.webapi; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.util.Log; - -import com.google.gson.Gson; -import net.irext.webapi.bean.ACStatus; -import net.irext.webapi.model.*; -import net.irext.webapi.utils.Constants; -import net.irext.webapi.request.*; -import net.irext.webapi.response.*; -import net.irext.webapi.utils.PackageUtils; -import net.irext.webapi.WebAPICallbacks.*; - -import okhttp3.*; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Filename: WebAPIs.java - * Revised: Date: 2017-03-30 - * Revision: Revision: 1.0 - *

- * Description: HTTP Request initializer - *

- * Revision log: - * 2017-03-30: created by strawmanbobi - */ -public class WebAPIs { - - @SuppressWarnings("all") - private static final String TAG = WebAPIs.class.getSimpleName(); - - private static WebAPIs mInstance = null; - - private static final String DEFAULT_ADDRESS = "http://srv.irext.net"; - private static final String DEFAULT_APP = "/irext-server"; - private static String URL_PREFIX = DEFAULT_ADDRESS + DEFAULT_APP; - - // download bin from OSS - private static final String IR_BIN_FILE_PREFIX = "irda_"; - private static final String IR_BIN_FILE_SUFFIX = ".bin"; - private static final String IR_BIN_DOWNLOAD_PREFIX = "https://irext-release.oss-cn-hangzhou.aliyuncs.com/"; - - private static final String SERVICE_SIGN_IN = "/app/app_login"; - private static final String SERVICE_LIST_CATEGORIES = "/indexing/list_categories"; - private static final String SERVICE_LIST_BRANDS = "/indexing/list_brands"; - private static final String SERVICE_LIST_PROVINCES = "/indexing/list_provinces"; - private static final String SERVICE_LIST_CITIES = "/indexing/list_cities"; - private static final String SERVICE_LIST_OPERATORS = "/indexing/list_operators"; - private static final String SERVICE_LIST_INDEXES = "/indexing/list_indexes"; - private static final String SERVICE_DOWNLOAD_BIN = "/operation/download_bin"; - private static final String SERVICE_ONLINE_DECODE = "/operation/decode"; - private static final String SERVICE_GET_AC_PARAMETERS = "/operation/get_ac_parameters"; - - private int id; - private String token; - - private final OkHttpClient mHttpClient; - - private WebAPIs(String address, String appName) { - if (null != address && null != appName) { - URL_PREFIX = address + appName; - } - mHttpClient = new OkHttpClient(); - } - - private static void initializeInstance(String address, String appName) { - mInstance = new WebAPIs(address, appName); - } - - @SuppressWarnings("unused") - public static WebAPIs getInstance(String address, String appName) { - if (null == mInstance) { - initializeInstance(address, appName); - } - return mInstance; - } - - private InputStream getFileByteStreamByURL(String url) throws IOException { - Log.d(TAG, "download remote binary file, url = " + url); - Request request = new Request.Builder() - .url(url) - .get() - .build(); - - Response response = new OkHttpClient().newCall(request).execute(); - return response.body().byteStream(); - } - - private String postToServer(String url, String json) throws IOException { - MediaType JSON - = MediaType.parse("application/json; charset=utf-8"); - - RequestBody body = RequestBody.create(JSON, json); - Request request = new Request.Builder() - .url(url) - .post(body) - .build(); - Response response = mHttpClient.newCall(request).execute(); - return response.body().string(); - } - - private InputStream postToServerForOctets(String url, String json) throws IOException { - MediaType JSON - = MediaType.parse("application/json; charset=utf-8"); - RequestBody body = RequestBody.create(JSON, json); - - Request request = new Request.Builder() - .url(url) - .post(body) - .build(); - - Response response = mHttpClient.newCall(request).execute(); - return response.body().byteStream(); - } - - @SuppressWarnings("unused") - public void signIn(Context context, SignInCallback signInCallback) { - try { - String signInURL = URL_PREFIX + SERVICE_SIGN_IN; - AppSignInRequest appSignInRequest = new AppSignInRequest(); - - ApplicationInfo appInfo = context.getPackageManager() - .getApplicationInfo(context.getPackageName(), - PackageManager.GET_META_DATA); - String appKey = appInfo.metaData.getString("irext_app_key"); - String appSecret = appInfo.metaData.getString("irext_app_secret"); - - appSignInRequest.setAppKey(appKey); - appSignInRequest.setAppSecret(appSecret); - appSignInRequest.setAppType(0); - - String packageName = context.getApplicationContext().getPackageName(); - appSignInRequest.setAndroidPackageName(packageName); - - String signature = PackageUtils.getCertificateSHA1Fingerprint(context); - - appSignInRequest.setAndroidSignature(signature); - String bodyJson = appSignInRequest.toJson(); - - Log.d(TAG, "Android APP example sign-in request data : " + bodyJson); - String response = postToServer(signInURL, bodyJson); - - Log.d(TAG, "Android APP example sign-in response data : " + response); - LoginResponse loginResponse = new Gson().fromJson(response, LoginResponse.class); - if (loginResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - UserApp userApp = loginResponse.getEntity(); - if (0 != userApp.getId() && null != userApp.getToken()) { - id = userApp.getId(); - token = userApp.getToken(); - signInCallback.onSignInSuccess(userApp); - } else { - signInCallback.onSignInFailed(); - } - } - } catch (Exception e) { - e.printStackTrace(); - signInCallback.onSignInError(); - } - } - - @SuppressWarnings("unused") - public void listCategories(int from, int count, ListCategoriesCallback listCategoriesCallback) { - String listCategoriesURL = URL_PREFIX + SERVICE_LIST_CATEGORIES; - ListCategoriesRequest listCategoriesRequest = new ListCategoriesRequest(); - listCategoriesRequest.setId(id); - listCategoriesRequest.setToken(token); - listCategoriesRequest.setFrom(from); - listCategoriesRequest.setCount(count); - String bodyJson = listCategoriesRequest.toJson(); - - try { - String response = postToServer(listCategoriesURL, bodyJson); - CategoriesResponse categoriesResponse = new Gson().fromJson(response, CategoriesResponse.class); - - if(categoriesResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - listCategoriesCallback.onListCategoriesSuccess(categoriesResponse.getEntity()); - } else { - listCategoriesCallback.onListCategoriesFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - listCategoriesCallback.onListCategoriesError(); - } - } - - @SuppressWarnings("unused") - public void listBrands(int categoryId, int from, int count, - ListBrandsCallback listBrandsCallback) { - String listBrandsURL = URL_PREFIX + SERVICE_LIST_BRANDS; - ListBrandsRequest listBrandsRequest = new ListBrandsRequest(); - listBrandsRequest.setId(id); - listBrandsRequest.setToken(token); - listBrandsRequest.setCategoryId(categoryId); - listBrandsRequest.setFrom(from); - listBrandsRequest.setCount(count); - String bodyJson = listBrandsRequest.toJson(); - - try { - String response = postToServer(listBrandsURL, bodyJson); - BrandsResponse brandsResponse = new Gson().fromJson(response, BrandsResponse.class); - - if (brandsResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - listBrandsCallback.onListBrandsSuccess(brandsResponse.getEntity()); - } else { - listBrandsCallback.onListBrandsFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - listBrandsCallback.onListBrandsError(); - } - } - - @SuppressWarnings("unused") - public void listProvinces(ListProvincesCallback listProvincesCallback) { - String listProvincesURL = URL_PREFIX + SERVICE_LIST_PROVINCES; - ListCitiesRequest listCitiesRequest = new ListCitiesRequest(); - listCitiesRequest.setId(id); - listCitiesRequest.setToken(token); - String bodyJson = listCitiesRequest.toJson(); - - try { - String response = postToServer(listProvincesURL, bodyJson); - CitiesResponse citiesResponse = new Gson().fromJson(response, CitiesResponse.class); - - if (citiesResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - listProvincesCallback.onListProvincesSuccess(citiesResponse.getEntity()); - } else { - listProvincesCallback.onListProvincesFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - listProvincesCallback.onListProvincesError(); - } - } - - @SuppressWarnings("unused") - public void listCities(String prefix, ListCitiesCallback listCitiesCallback) { - String listCitiesURL = URL_PREFIX + SERVICE_LIST_CITIES; - ListCitiesRequest listCitiesRequest = new ListCitiesRequest(); - listCitiesRequest.setId(id); - listCitiesRequest.setToken(token); - listCitiesRequest.setProvincePrefix(prefix); - String bodyJson = listCitiesRequest.toJson(); - - try { - String response = postToServer(listCitiesURL, bodyJson); - CitiesResponse citiesResponse = new Gson().fromJson(response, CitiesResponse.class); - - if (citiesResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - listCitiesCallback.onListCitiesSuccess(citiesResponse.getEntity()); - } else { - listCitiesCallback.onListCitiesFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - listCitiesCallback.onListCitiesError(); - } - } - - @SuppressWarnings("unused") - public void listOperators(String cityCode, - ListOperatersCallback listOperatersCallback) { - String listOperatorsURL = URL_PREFIX + SERVICE_LIST_OPERATORS; - ListOperatorsRequest listOperatorsRequest = new ListOperatorsRequest(); - listOperatorsRequest.setId(id); - listOperatorsRequest.setToken(token); - listOperatorsRequest.setCityCode(cityCode); - listOperatorsRequest.setFrom(0); - listOperatorsRequest.setCount(20); - String bodyJson = listOperatorsRequest.toJson(); - - try { - String response = postToServer(listOperatorsURL, bodyJson); - OperatorsResponse operatorsResponse = new Gson().fromJson(response, OperatorsResponse.class); - - if (operatorsResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - listOperatersCallback.onListOperatorsSuccess(operatorsResponse.getEntity()); - } else { - listOperatersCallback.onListOperatorsFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - listOperatersCallback.onListOperatorsError(); - } - } - - @SuppressWarnings("unused") - public void listRemoteIndexes(int categoryId, - int brandId, - String cityCode, - String operatorId, - int withParaData, - ListIndexesCallback onListIndexCallback) { - String listIndexesURL = URL_PREFIX + SERVICE_LIST_INDEXES; - ListIndexesRequest listIndexesRequest = new ListIndexesRequest(); - listIndexesRequest.setId(id); - listIndexesRequest.setToken(token); - listIndexesRequest.setCategoryId(categoryId); - listIndexesRequest.setBrandId(brandId); - listIndexesRequest.setCityCode(cityCode); - listIndexesRequest.setOperatorId(operatorId); - listIndexesRequest.setWithParaData(withParaData); - listIndexesRequest.setFrom(0); - listIndexesRequest.setCount(20); - String bodyJson = listIndexesRequest.toJson(); - - try { - String response = postToServer(listIndexesURL, bodyJson); - - IndexesResponse indexesResponse = new Gson().fromJson(response, IndexesResponse.class); - - if (indexesResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - onListIndexCallback.onListIndexesSuccess(indexesResponse.getEntity()); - } else { - onListIndexCallback.onListIndexesFailed(); - } - } catch (Exception e) { - e.printStackTrace(); - onListIndexCallback.onListIndexesError(); - } - } - - @SuppressWarnings("unused") - public void downloadBin(String remoteMap, int indexId, - DownloadBinCallback downloadBinCallback) { - String downloadURL = URL_PREFIX + SERVICE_DOWNLOAD_BIN; - DownloadBinaryRequest downloadBinaryRequest = new DownloadBinaryRequest(); - downloadBinaryRequest.setId(id); - downloadBinaryRequest.setToken(token); - downloadBinaryRequest.setIndexId(indexId); - - String bodyJson = downloadBinaryRequest.toJson(); - - if (null != bodyJson) { - try { - InputStream binStream = postToServerForOctets(downloadURL, bodyJson); - - if (null != binStream) { - downloadBinCallback.onDownloadBinSuccess(binStream); - } else { - downloadBinCallback.onDownloadBinFailed(); - } - } catch (IOException e) { - e.printStackTrace(); - downloadBinCallback.onDownloadBinError(); - } - } - } - - @SuppressWarnings("unused") - public int[] decodeIR(int indexId, ACStatus acStatus, int keyCode, int changeWindDir, - Integer directDecode, Integer paraData) { - String decodeURL = URL_PREFIX + SERVICE_ONLINE_DECODE; - DecodeRequest decodeRequest = new DecodeRequest(); - decodeRequest.setId(id); - decodeRequest.setToken(token); - decodeRequest.setIndexId(indexId); - decodeRequest.setAcStatus(acStatus); - decodeRequest.setKeyCode(keyCode); - decodeRequest.setChangeWindDir(changeWindDir); - decodeRequest.setDirectDecode(directDecode); - decodeRequest.setParaData(paraData); - - String bodyJson = decodeRequest.toJson(); - - if (null != bodyJson) { - try { - String response = postToServer(decodeURL, bodyJson); - - DecodeResponse decodeResponse = new Gson().fromJson(response, DecodeResponse.class); - - if (decodeResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - return decodeResponse.getEntity(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - return null; - } - - @SuppressWarnings("unused") - public ACParameters getACParameters(int indexId, int mode) { - String decodeURL = URL_PREFIX + SERVICE_GET_AC_PARAMETERS; - GetACParametersRequest getACParametersRequest = new GetACParametersRequest(); - getACParametersRequest.setId(id); - getACParametersRequest.setToken(token); - getACParametersRequest.setIndexId(indexId); - getACParametersRequest.setMode(mode); - - String bodyJson = getACParametersRequest.toJson(); - if (null != bodyJson) { - try { - String response = postToServer(decodeURL, bodyJson); - - ACParametersResponse acParametersResponse = new Gson().fromJson(response, ACParametersResponse.class); - - if (acParametersResponse.getStatus().getCode() == Constants.ERROR_CODE_SUCCESS) { - return acParametersResponse.getEntity(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - return null; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/bean/ACStatus.java b/android-example/web-api/src/main/java/net/irext/webapi/bean/ACStatus.java deleted file mode 100644 index ca4c51d..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/bean/ACStatus.java +++ /dev/null @@ -1,104 +0,0 @@ -package net.irext.webapi.bean; - -/** - * Filename: ACStatus.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: Status descriptor for air-conditioner - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class ACStatus { - - private static final String TAG = ACStatus.class.getSimpleName(); - - private int acPower; - private int acTemp; - private int acMode; - private int acWindDir; - private int acWindSpeed; - private int acDisplay; - private int acSleep; - private int acTimer; - - public ACStatus() { - } - - public ACStatus(int acPower, int acMode, int acTemp, int acWindSpeed, int acWindDir, - int acDisplay, int acSleep, int acTimer) { - this.acPower = acPower; - this.acTemp = acTemp; - this.acMode = acMode; - this.acWindDir = acWindDir; - this.acWindSpeed = acWindSpeed; - this.acDisplay = acDisplay; - this.acSleep = acSleep; - this.acTimer = acTimer; - } - - public int getAcPower() { - return acPower; - } - - public void setAcPower(int acPower) { - this.acPower = acPower; - } - - public int getAcTemp() { - return acTemp; - } - - public void setAcTemp(int acTemp) { - this.acTemp = acTemp; - } - - public int getAcMode() { - return acMode; - } - - public void setAcMode(int acMode) { - this.acMode = acMode; - } - - public int getAcWindDir() { - return acWindDir; - } - - public void setAcWindDir(int acWindDir) { - this.acWindDir = acWindDir; - } - - public int getAcWindSpeed() { - return acWindSpeed; - } - - public void setAcWindSpeed(int acWindSpeed) { - this.acWindSpeed = acWindSpeed; - } - - public int getAcDisplay() { - return acDisplay; - } - - public void setAcDisplay(int acDisplay) { - this.acDisplay = acDisplay; - } - - public int getAcSleep() { - return acSleep; - } - - public void setAcSleep(int acSleep) { - this.acSleep = acSleep; - } - - public int getAcTimer() { - return acTimer; - } - - public void setAcTimer(int acTimer) { - this.acTimer = acTimer; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/bean/TemperatureRange.java b/android-example/web-api/src/main/java/net/irext/webapi/bean/TemperatureRange.java deleted file mode 100644 index 5e5106d..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/bean/TemperatureRange.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.irext.webapi.bean; - -/** - * Filename: TemperatureRange.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: Temperature range for air-conditioner - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class TemperatureRange { - - private static final String TAG = TemperatureRange.class.getSimpleName(); - - private int tempMin; - private int tempMax; - - public TemperatureRange() { - } - - public TemperatureRange(int tempMin, int tempMax) { - this.tempMin = tempMin; - this.tempMax = tempMax; - } - - public int getTempMin() { - return tempMin; - } - - public void setTempMin(int tempMin) { - this.tempMin = tempMin; - } - - public int getTempMax() { - return tempMax; - } - - public void setTempMax(int tempMax) { - this.tempMax = tempMax; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/ACParameters.java b/android-example/web-api/src/main/java/net/irext/webapi/model/ACParameters.java deleted file mode 100644 index 98ddd52..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/ACParameters.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: ACParameters.java - * Revised: Date: 2019-02-14 - * Revision: Revision: 1.0 - *

- * Description: AC parameters entity - *

- * Revision log: - * 2018-12-29: created by strawmanbobi - */ -public class ACParameters { - private int tempMin; - private int tempMax; - private int [] supportedModes; - private int []supportedWindSpeed; - private int []supportedSwing; - private int []supportedWindDirections; - - public ACParameters(int tempMin, int tempMax, int[] supportedModes, - int[] supportedWindSpeed, - int[] supportedSwing, int[] supportedWindDirections) { - this.tempMin = tempMin; - this.tempMax = tempMax; - this.supportedModes = supportedModes; - this.supportedWindSpeed = supportedWindSpeed; - this.supportedSwing = supportedSwing; - this.supportedWindDirections = supportedWindDirections; - } - - public ACParameters() { - - } - - public int getTempMin() { - return tempMin; - } - - public void setTempMin(int tempMin) { - this.tempMin = tempMin; - } - - public int getTempMax() { - return tempMax; - } - - public void setTempMax(int tempMax) { - this.tempMax = tempMax; - } - - public int[] getSupportedModes() { - return supportedModes; - } - - public void setSupportedModes(int[] supportedModes) { - this.supportedModes = supportedModes; - } - - public int[] getSupportedWindSpeed() { - return supportedWindSpeed; - } - - public void setSupportedWindSpeed(int[] supportedWindSpeed) { - this.supportedWindSpeed = supportedWindSpeed; - } - - public int[] getSupportedSwing() { - return supportedSwing; - } - - public void setSupportedSwing(int[] supportedSwing) { - this.supportedSwing = supportedSwing; - } - - public int[] getSupportedWindDirections() { - return supportedWindDirections; - } - - public void setSupportedWindDirections(int[] supportedWindDirections) { - this.supportedWindDirections = supportedWindDirections; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/Brand.java b/android-example/web-api/src/main/java/net/irext/webapi/model/Brand.java deleted file mode 100644 index d7fa2be..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/Brand.java +++ /dev/null @@ -1,124 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: Brand.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: Brand bean - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class Brand { - - private int id; - private String name; - private int categoryId; - private String categoryName; - private int status; - private String updateTime; - private int priority; - private String nameEn; - private String nameTw; - private String contributor; - - public Brand(int id, String name, int categoryId, String categoryName, int status, - String updateTime, int priority, - String nameEn, String nameTw, String contributor) { - this.id = id; - this.name = name; - this.categoryId = categoryId; - this.categoryName = categoryName; - this.status = status; - this.updateTime = updateTime; - this.priority = priority; - this.nameEn = nameEn; - this.nameTw = nameTw; - this.contributor = contributor; - } - - public Brand() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getCategoryId() { - return categoryId; - } - - public void setCategoryId(int categoryId) { - this.categoryId = categoryId; - } - - public String getCategoryName() { - return categoryName; - } - - public void setCategoryName(String categoryName) { - this.categoryName = categoryName; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public int getPriority() { - return priority; - } - - public void setPriority(int priority) { - this.priority = priority; - } - - public String getNameEn() { - return nameEn; - } - - public void setNameEn(String nameEn) { - this.nameEn = nameEn; - } - - public String getNameTw() { - return nameTw; - } - - public void setNameTw(String nameTw) { - this.nameTw = nameTw; - } - - public String getContributor() { - return contributor; - } - - public void setContributor(String contributor) { - this.contributor = contributor; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/Category.java b/android-example/web-api/src/main/java/net/irext/webapi/model/Category.java deleted file mode 100644 index 9e36e8a..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/Category.java +++ /dev/null @@ -1,93 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: Category.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: Category bean - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class Category { - - private int id; - private String name; - private int status; - private String updateTime; - private String nameEn; - private String nameTw; - private String contributor; - - public Category(int id, String name, int status, String updateTime, - String nameEn, String nameTw, String contributor) { - this.id = id; - this.name = name; - this.status = status; - this.updateTime = updateTime; - this.nameEn = nameEn; - this.nameTw = nameTw; - this.contributor = contributor; - } - - public Category() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public String getNameEn() { - return nameEn; - } - - public void setNameEn(String nameEn) { - this.nameEn = nameEn; - } - - public String getNameTw() { - return nameTw; - } - - public void setNameTw(String nameTw) { - this.nameTw = nameTw; - } - - public String getContributor() { - return contributor; - } - - public void setContributor(String contributor) { - this.contributor = contributor; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/City.java b/android-example/web-api/src/main/java/net/irext/webapi/model/City.java deleted file mode 100644 index 6105c34..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/City.java +++ /dev/null @@ -1,93 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: City.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: City bean - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class City { - - private int id; - private String code; - private String name; - private double longitude; - private double latitude; - private int status; - private String nameTw; - - public City(int id, String code, String name, double longitude, double latitude, - int status, String nameTw) { - this.id = id; - this.code = code; - this.name = name; - this.longitude = longitude; - this.latitude = latitude; - this.status = status; - this.nameTw = nameTw; - } - - public City() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public double getLongitude() { - return longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public double getLatitude() { - return latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getNameTw() { - return nameTw; - } - - public void setNameTw(String nameTw) { - this.nameTw = nameTw; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/RemoteIndex.java b/android-example/web-api/src/main/java/net/irext/webapi/model/RemoteIndex.java deleted file mode 100644 index 57e7314..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/RemoteIndex.java +++ /dev/null @@ -1,259 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: RemoteIndex.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: RemoteIndex bean - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class RemoteIndex { - - private int id; - private int categoryId; - private String categoryName; - private int brandId; - private String brandName; - private String cityCode; - private String cityName; - private String operatorId; - private String operatorName; - private String protocol; - private String remote; - private String remoteMap; - private int status; - private int subCate; - private int priority; - private String remoteNumber; - private String categoryNameTw; - private String brandNameTw; - private String cityNameTw; - private String operatorNameTw; - private String binaryMd5; - private String contributor; - private String updateTime; - - public RemoteIndex(int id, - int categoryId, String categoryName, int brandId, String brandName, - String cityCode, String cityName, String operatorId, String operatorName, - String protocol, String remote, String remoteMap, int status, int subCate, - int priority, String remoteNumber, - String categoryNameTw, String brandNameTw, - String cityNameTw, String operatorNameTw, - String binaryMd5, String contributor, String updateTime) { - this.id = id; - this.categoryId = categoryId; - this.categoryName = categoryName; - this.brandId = brandId; - this.brandName = brandName; - this.cityCode = cityCode; - this.cityName = cityName; - this.operatorId = operatorId; - this.operatorName = operatorName; - this.protocol = protocol; - this.remote = remote; - this.remoteMap = remoteMap; - this.status = status; - this.subCate = subCate; - this.priority = priority; - this.remoteNumber = remoteNumber; - this.categoryNameTw = categoryNameTw; - this.brandNameTw = brandNameTw; - this.cityNameTw = cityNameTw; - this.operatorNameTw = operatorNameTw; - this.binaryMd5 = binaryMd5; - this.contributor = contributor; - this.updateTime = updateTime; - } - - public RemoteIndex() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getCategoryId() { - return categoryId; - } - - public void setCategoryId(int categoryId) { - this.categoryId = categoryId; - } - - public String getCategoryName() { - return categoryName; - } - - public void setCategoryName(String categoryName) { - this.categoryName = categoryName; - } - - public int getBrandId() { - return brandId; - } - - public void setBrandId(int brandId) { - this.brandId = brandId; - } - - public String getBrandName() { - return brandName; - } - - public void setBrandName(String brandName) { - this.brandName = brandName; - } - - public String getCityCode() { - return cityCode; - } - - public void setCityCode(String cityCode) { - this.cityCode = cityCode; - } - - public String getCityName() { - return cityName; - } - - public void setCityName(String cityName) { - this.cityName = cityName; - } - - public String getOperatorId() { - return operatorId; - } - - public void setOperatorId(String operatorId) { - this.operatorId = operatorId; - } - - public String getOperatorName() { - return operatorName; - } - - public void setOperatorName(String operatorName) { - this.operatorName = operatorName; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public String getRemote() { - return remote; - } - - public void setRemote(String remote) { - this.remote = remote; - } - - public String getRemoteMap() { - return remoteMap; - } - - public void setRemoteMap(String remoteMap) { - this.remoteMap = remoteMap; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public int getSubCate() { - return subCate; - } - - public void setSubCate(int subCate) { - this.subCate = subCate; - } - - public int getPriority() { - return priority; - } - - public void setPriority(int priority) { - this.priority = priority; - } - - public String getRemoteNumber() { - return remoteNumber; - } - - public void setRemoteNumber(String remoteNumber) { - this.remoteNumber = remoteNumber; - } - - public String getCategoryNameTw() { - return categoryNameTw; - } - - public void setCategoryNameTw(String categoryNameTw) { - this.categoryNameTw = categoryNameTw; - } - - public String getBrandNameTw() { - return brandNameTw; - } - - public void setBrandNameTw(String brandNameTw) { - this.brandNameTw = brandNameTw; - } - - public String getCityNameTw() { - return cityNameTw; - } - - public void setCityNameTw(String cityNameTw) { - this.cityNameTw = cityNameTw; - } - - public String getOperatorNameTw() { - return operatorNameTw; - } - - public void setOperatorNameTw(String operatorNameTw) { - this.operatorNameTw = operatorNameTw; - } - - public String getBinaryMd5() { - return binaryMd5; - } - - public void setBinaryMd5(String binaryMd5) { - this.binaryMd5 = binaryMd5; - } - - public String getContributor() { - return contributor; - } - - public void setContributor(String contributor) { - this.contributor = contributor; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/StbOperator.java b/android-example/web-api/src/main/java/net/irext/webapi/model/StbOperator.java deleted file mode 100644 index 167d938..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/StbOperator.java +++ /dev/null @@ -1,93 +0,0 @@ -package net.irext.webapi.model; - -/** - * Filename: StbOperator.java - * Revised: Date: 2017-03-28 - * Revision: Revision: 1.0 - *

- * Description: StbOperator bean - *

- * Revision log: - * 2017-03-28: created by strawmanbobi - */ -public class StbOperator { - - private int id; - private String operatorId; - private String operatorName; - private String cityCode; - private String cityName; - private int status; - private String operatorNameTw; - - public StbOperator(int id, String operatorId, String operatorName, - String cityCode, String cityName, int status, String operatorNameTw) { - this.id = id; - this.operatorId = operatorId; - this.operatorName = operatorName; - this.cityCode = cityCode; - this.cityName = cityName; - this.status = status; - this.operatorNameTw = operatorNameTw; - } - - public StbOperator() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getOperatorId() { - return operatorId; - } - - public void setOperatorId(String operatorId) { - this.operatorId = operatorId; - } - - public String getOperatorName() { - return operatorName; - } - - public void setOperatorName(String operatorName) { - this.operatorName = operatorName; - } - - public String getCityCode() { - return cityCode; - } - - public void setCityCode(String cityCode) { - this.cityCode = cityCode; - } - - public String getCityName() { - return cityName; - } - - public void setCityName(String cityName) { - this.cityName = cityName; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getOperatorNameTw() { - return operatorNameTw; - } - - public void setOperatorNameTw(String operatorNameTw) { - this.operatorNameTw = operatorNameTw; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/model/UserApp.java b/android-example/web-api/src/main/java/net/irext/webapi/model/UserApp.java deleted file mode 100644 index e16c502..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/model/UserApp.java +++ /dev/null @@ -1,397 +0,0 @@ -package net.irext.webapi.model; - -public class UserApp { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private Integer id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.app_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String appName; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.admin_id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private Integer adminId; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.admin_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String adminName; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.app_type - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private Byte appType; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.android_package_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String androidPackageName; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.android_signature - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String androidSignature; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.ios_identity - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String iosIdentity; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.is_debug - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private Byte isDebug; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.app_key - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String appKey; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.app_secret - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String appSecret; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column user_app.update_time - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - private String updateTime; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.id - * - * @return the value of user_app.id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public Integer getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.id - * - * @param id the value for user_app.id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setId(Integer id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.app_name - * - * @return the value of user_app.app_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAppName() { - return appName; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.app_name - * - * @param appName the value for user_app.app_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAppName(String appName) { - this.appName = appName; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.admin_id - * - * @return the value of user_app.admin_id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public Integer getAdminId() { - return adminId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.admin_id - * - * @param adminId the value for user_app.admin_id - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAdminId(Integer adminId) { - this.adminId = adminId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.admin_name - * - * @return the value of user_app.admin_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAdminName() { - return adminName; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.admin_name - * - * @param adminName the value for user_app.admin_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAdminName(String adminName) { - this.adminName = adminName; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.app_type - * - * @return the value of user_app.app_type - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public Byte getAppType() { - return appType; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.app_type - * - * @param appType the value for user_app.app_type - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAppType(Byte appType) { - this.appType = appType; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.android_package_name - * - * @return the value of user_app.android_package_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAndroidPackageName() { - return androidPackageName; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.android_package_name - * - * @param androidPackageName the value for user_app.android_package_name - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAndroidPackageName(String androidPackageName) { - this.androidPackageName = androidPackageName; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.android_signature - * - * @return the value of user_app.android_signature - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAndroidSignature() { - return androidSignature; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.android_signature - * - * @param androidSignature the value for user_app.android_signature - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAndroidSignature(String androidSignature) { - this.androidSignature = androidSignature; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.ios_identity - * - * @return the value of user_app.ios_identity - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getIosIdentity() { - return iosIdentity; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.ios_identity - * - * @param iosIdentity the value for user_app.ios_identity - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setIosIdentity(String iosIdentity) { - this.iosIdentity = iosIdentity; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.is_debug - * - * @return the value of user_app.is_debug - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public Byte getIsDebug() { - return isDebug; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.is_debug - * - * @param isDebug the value for user_app.is_debug - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setIsDebug(Byte isDebug) { - this.isDebug = isDebug; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.app_key - * - * @return the value of user_app.app_key - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAppKey() { - return appKey; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.app_key - * - * @param appKey the value for user_app.app_key - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAppKey(String appKey) { - this.appKey = appKey; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.app_secret - * - * @return the value of user_app.app_secret - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getAppSecret() { - return appSecret; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.app_secret - * - * @param appSecret the value for user_app.app_secret - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setAppSecret(String appSecret) { - this.appSecret = appSecret; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column user_app.update_time - * - * @return the value of user_app.update_time - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public String getUpdateTime() { - return updateTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column user_app.update_time - * - * @param updateTime the value for user_app.update_time - * - * @mbggenerated Fri May 26 19:47:48 CST 2017 - */ - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - private String token; - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } -} \ No newline at end of file diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/AppSignInRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/AppSignInRequest.java deleted file mode 100644 index 7cb3bc8..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/AppSignInRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: AppSignInRequest.java - * Revised: Date: 2017-05-27 - * Revision: Revision: 1.0 - *

- * Description: HTTP admin login request - *

- * Revision log: - * 2017-05-27: created by strawmanbobi - */ -public class AppSignInRequest extends BaseRequest { - - private String appKey; - private String appSecret; - private int appType; - private String iOSID; - private String androidPackageName; - private String androidSignature; - - public AppSignInRequest(String appKey, String appSecret, int appType, - String iOSID, String androidPackageName, String androidSignature) { - this.appKey = appKey; - this.appSecret = appSecret; - this.appType = appType; - this.iOSID = iOSID; - this.androidPackageName = androidPackageName; - this.androidSignature = androidSignature; - } - - public AppSignInRequest() { - - } - - public String getAppKey() { - return appKey; - } - - public void setAppKey(String appKey) { - this.appKey = appKey; - } - - public String getAppSecret() { - return appSecret; - } - - public void setAppSecret(String appSecret) { - this.appSecret = appSecret; - } - - public int getAppType() { - return appType; - } - - public void setAppType(int appType) { - this.appType = appType; - } - - public String getiOSID() { - return iOSID; - } - - public void setiOSID(String iOSID) { - this.iOSID = iOSID; - } - - public String getAndroidPackageName() { - return androidPackageName; - } - - public void setAndroidPackageName(String androidPackageName) { - this.androidPackageName = androidPackageName; - } - - public String getAndroidSignature() { - return androidSignature; - } - - public void setAndroidSignature(String androidSignature) { - this.androidSignature = androidSignature; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/BaseRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/BaseRequest.java deleted file mode 100644 index ef4ba78..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/BaseRequest.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.irext.webapi.request; - -import com.google.gson.Gson; - -/** - * Filename: BaseRequest.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: authentication factors included - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class BaseRequest { - - private int id; - private String token; - - public BaseRequest(int id, String token) { - this.id = id; - this.token = token; - } - - BaseRequest() { - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public String toJson() { - return new Gson().toJson(this, this.getClass()); - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/DecodeRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/DecodeRequest.java deleted file mode 100644 index 9cfcfe3..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/DecodeRequest.java +++ /dev/null @@ -1,85 +0,0 @@ -package net.irext.webapi.request; - -import net.irext.webapi.bean.ACStatus; - -/** - * Filename: DecodeRequest.java - * Revised: Date: 2017-05-16 - * Revision: Revision: 1.0 - *

- * Description: HTTP decode online - *

- * Revision log: - * 2017-05-16: created by strawmanbobi - */ -public class DecodeRequest extends BaseRequest { - - private int indexId; - private ACStatus acStatus; - private int keyCode; - private int changeWindDir; - private Integer directDecode; - private Integer paraData; - - public DecodeRequest(int indexId, ACStatus acStatus, int keyCode, int changeWindDir, - Integer directDecode, Integer paraData) { - this.indexId = indexId; - this.acStatus = acStatus; - this.keyCode = keyCode; - this.changeWindDir = changeWindDir; - this.directDecode = directDecode; - this.paraData = paraData; - } - - public DecodeRequest() { - - } - - public int getIndexId() { - return indexId; - } - - public void setIndexId(int indexId) { - this.indexId = indexId; - } - - public ACStatus getAcStatus() { - return acStatus; - } - - public void setAcStatus(ACStatus acStatus) { - this.acStatus = acStatus; - } - - public int getKeyCode() { - return keyCode; - } - - public void setKeyCode(int keyCode) { - this.keyCode = keyCode; - } - - public int getChangeWindDir() { - return changeWindDir; - } - - public void setChangeWindDir(int changeWindDir) { - this.changeWindDir = changeWindDir; - } - - public Integer getDirectDecode() { - return directDecode; - } - - public void setDirectDecode(Integer directDecode) { - this.directDecode = directDecode; - } - - public Integer getParaData() { - return paraData; - } - - public void setParaData(Integer paraData) { - this.paraData = paraData; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/DownloadBinaryRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/DownloadBinaryRequest.java deleted file mode 100644 index ee995b4..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/DownloadBinaryRequest.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: DownloadBinaryRequest.java - * Revised: Date: 2017-04-14 - * Revision: Revision: 1.0 - *

- * Description: HTTP download IR binary - *

- * Revision log: - * 2017-04-14: created by strawmanbobi - */ -public class DownloadBinaryRequest extends BaseRequest { - - private int indexId; - - public DownloadBinaryRequest(int indexId) { - this.indexId = indexId; - } - - public DownloadBinaryRequest() { - - } - - public int getIndexId() { - return indexId; - } - - public void setIndexId(int indexId) { - this.indexId = indexId; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/GetACParametersRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/GetACParametersRequest.java deleted file mode 100644 index e5f5174..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/GetACParametersRequest.java +++ /dev/null @@ -1,41 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: GetACParametersRequest.java - * Revised: Date: 2017-05-16 - * Revision: Revision: 1.0 - *

- * Description: HTTP server online - *

- * Revision log: - * 2019-02-14: created by strawmanbobi - */ -public class GetACParametersRequest extends BaseRequest { - private int indexId; - private int mode; - - public GetACParametersRequest(int indexId, int mode) { - this.indexId = indexId; - this.mode = mode; - } - - public GetACParametersRequest() { - - } - - public int getIndexId() { - return indexId; - } - - public void setIndexId(int indexId) { - this.indexId = indexId; - } - - public int getMode() { - return mode; - } - - public void setMode(int mode) { - this.mode = mode; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/ListBrandsRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/ListBrandsRequest.java deleted file mode 100644 index 6dcd236..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/ListBrandsRequest.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: ListBrandsRequest.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: HTTP list brands request - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class ListBrandsRequest extends BaseRequest { - - private int categoryId; - private int from; - private int count; - - public ListBrandsRequest(int categoryId, int from, int count) { - this.categoryId = categoryId; - this.from = from; - this.count = count; - } - - public ListBrandsRequest() { - - } - - public int getCategoryId() { - return categoryId; - } - - public void setCategoryId(int categoryId) { - this.categoryId = categoryId; - } - - public int getFrom() { - return from; - } - - public void setFrom(int from) { - this.from = from; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/ListCategoriesRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/ListCategoriesRequest.java deleted file mode 100644 index 48760f3..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/ListCategoriesRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: ListCategoriesRequest.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: HTTP list categories request - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class ListCategoriesRequest extends BaseRequest { - - private int from; - private int count; - - public ListCategoriesRequest(int from, int count) { - this.from = from; - this.count = count; - } - - public ListCategoriesRequest() { - - } - - public int getFrom() { - return from; - } - - public void setFrom(int from) { - this.from = from; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/ListCitiesRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/ListCitiesRequest.java deleted file mode 100644 index 6bd0cd9..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/ListCitiesRequest.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: ListCitiesRequest.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: HTTP list cities request - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class ListCitiesRequest extends BaseRequest { - - private String provincePrefix; - - public ListCitiesRequest(String provincePrefix) { - this.provincePrefix = provincePrefix; - } - - public ListCitiesRequest() { - - } - - public String getProvincePrefix() { - return provincePrefix; - } - - public void setProvincePrefix(String provincePrefix) { - this.provincePrefix = provincePrefix; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/ListIndexesRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/ListIndexesRequest.java deleted file mode 100644 index 99a823e..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/ListIndexesRequest.java +++ /dev/null @@ -1,95 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: ListIndexesRequest.java - * Revised: Date: 2017-04-12 - * Revision: Revision: 1.0 - *

- * Description: HTTP list remote indexes request - *

- * Revision log: - * 2017-04-12: created by strawmanbobi - */ -public class ListIndexesRequest extends BaseRequest { - - private int from; - private int count; - private int categoryId; - private int brandId; - private String cityCode; - private String operatorId; - - // try index in IRIS with this flag set to 1 - private int withParaData; - - public ListIndexesRequest(int from, int count, int categoryId, int brandId, - String cityCode, String operatorId, int withParaData) { - this.from = from; - this.count = count; - this.categoryId = categoryId; - this.brandId = brandId; - this.cityCode = cityCode; - this.operatorId = operatorId; - this.withParaData = withParaData; - } - - public ListIndexesRequest() { - - } - - public int getFrom() { - return from; - } - - public void setFrom(int from) { - this.from = from; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } - - public int getCategoryId() { - return categoryId; - } - - public void setCategoryId(int categoryId) { - this.categoryId = categoryId; - } - - public int getBrandId() { - return brandId; - } - - public void setBrandId(int brandId) { - this.brandId = brandId; - } - - public String getCityCode() { - return cityCode; - } - - public void setCityCode(String cityCode) { - this.cityCode = cityCode; - } - - public String getOperatorId() { - return operatorId; - } - - public void setOperatorId(String operatorId) { - this.operatorId = operatorId; - } - - public int getWithParaData() { - return withParaData; - } - - public void setWithParaData(int withParaData) { - this.withParaData = withParaData; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/request/ListOperatorsRequest.java b/android-example/web-api/src/main/java/net/irext/webapi/request/ListOperatorsRequest.java deleted file mode 100644 index 264be93..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/request/ListOperatorsRequest.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.irext.webapi.request; - -/** - * Filename: ListOperatorsRequest.java - * Revised: Date: 2017-04-10 - * Revision: Revision: 1.0 - *

- * Description: HTTP list STB operators request - *

- * Revision log: - * 2017-04-10: created by strawmanbobi - */ -public class ListOperatorsRequest extends BaseRequest { - - private int from; - private int count; - private String cityCode; - - public ListOperatorsRequest(int from, int count, String cityCode) { - this.from = from; - this.count = count; - this.cityCode = cityCode; - } - - public ListOperatorsRequest() { - - } - - public int getFrom() { - return from; - } - - public void setFrom(int from) { - this.from = from; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } - - public String getCityCode() { - return cityCode; - } - - public void setCityCode(String cityCode) { - this.cityCode = cityCode; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/ACParametersResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/ACParametersResponse.java deleted file mode 100644 index 17f428c..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/ACParametersResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.ACParameters; - -/** - * Filename: ACParametersResponse.java - * Revised: Date: 2017-05-16 - * Revision: Revision: 1.0 - *

- * Description: Air conditioner support parameters response - *

- * Revision log: - * 2019-02-14: created by strawmanbobi - */ -public class ACParametersResponse extends ServiceResponse { - - private ACParameters entity; - - public ACParametersResponse(Status status, ACParameters entity) { - super(status); - this.entity = entity; - } - - public ACParametersResponse() { - super(new Status()); - this.entity = null; - } - - public ACParameters getEntity() { - return entity; - } - - public void setEntity(ACParameters entity) { - this.entity = entity; - } -} \ No newline at end of file diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/BrandsResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/BrandsResponse.java deleted file mode 100644 index 327227f..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/BrandsResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.Brand; - -import java.util.List; - -/** - * Filename: BrandsResponse.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: List brands response - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class BrandsResponse extends ServiceResponse { - - private List entity; - - public BrandsResponse(Status status, List brands) { - super(status); - this.entity = brands; - } - - public BrandsResponse() { - - } - - public List getEntity() { - return entity; - } - - public void setEntity(List entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/CategoriesResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/CategoriesResponse.java deleted file mode 100644 index 409f582..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/CategoriesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.Category; - -import java.util.List; - -/** - * Filename: CategoriesResponse.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: List categories response - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class CategoriesResponse extends ServiceResponse { - - private List entity; - - public CategoriesResponse(Status status, List categories) { - super(status); - this.entity = categories; - } - - public CategoriesResponse() { - - } - - public List getEntity() { - return entity; - } - - public void setEntity(List entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/CitiesResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/CitiesResponse.java deleted file mode 100644 index a97a868..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/CitiesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.City; - -import java.util.List; - -/** - * Filename: CitiesResponse.java - * Revised: Date: 2017-04-07 - * Revision: Revision: 1.0 - *

- * Description: List cities response - *

- * Revision log: - * 2017-04-07: created by strawmanbobi - */ -public class CitiesResponse extends ServiceResponse { - - private List entity; - - public CitiesResponse(Status status, List cities) { - super(status); - this.entity = cities; - } - - public CitiesResponse() { - - } - - public List getEntity() { - return entity; - } - - public void setEntity(List entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/DecodeResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/DecodeResponse.java deleted file mode 100644 index c221f4e..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/DecodeResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.irext.webapi.response; - -/** - * Filename: DecodeResponse.java - * Revised: Date: 2017-05-16 - * Revision: Revision: 1.0 - *

- * Description: Online decode response - *

- * Revision log: - * 2017-05-16: created by strawmanbobi - */ -public class DecodeResponse extends ServiceResponse { - - private int[] entity; - - public DecodeResponse(Status status, int[] entity) { - super(status); - this.entity = entity; - } - - public DecodeResponse() { - - } - - public int[] getEntity() { - return entity; - } - - public void setEntity(int[] entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/IndexesResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/IndexesResponse.java deleted file mode 100644 index 7b666a5..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/IndexesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.RemoteIndex; - -import java.util.List; - -/** - * Filename: IndexesResponse.java - * Revised: Date: 2017-04-12 - * Revision: Revision: 1.0 - *

- * Description: List remote indexes response - *

- * Revision log: - * 2017-04-12: created by strawmanbobi - */ -public class IndexesResponse extends ServiceResponse { - - private List entity; - - public IndexesResponse(Status status, List indexes) { - super(status); - this.entity = indexes; - } - - public IndexesResponse() { - - } - - public List getEntity() { - return entity; - } - - public void setEntity(List entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/LoginResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/LoginResponse.java deleted file mode 100644 index d5e51d7..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/LoginResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.UserApp; -/** - * Filename: LoginResponse.java - * Revised: Date: 2017-03-31 - * Revision: Revision: 1.0 - *

- * Description: HTTP Admin login response - *

- * Revision log: - * 2017-03-31: created by strawmanbobi - */ -public class LoginResponse extends ServiceResponse { - - private UserApp entity; - - public LoginResponse(Status status, UserApp userApp) { - super(status); - this.entity = userApp; - } - - public LoginResponse() { - - } - - public UserApp getEntity() { - return entity; - } - - public void setEntity(UserApp entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/OperatorsResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/OperatorsResponse.java deleted file mode 100644 index 4856989..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/OperatorsResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.irext.webapi.response; - -import net.irext.webapi.model.StbOperator; - -import java.util.List; - -/** - * Filename: OperatorsResponse.java - * Revised: Date: 2017-04-10 - * Revision: Revision: 1.0 - *

- * Description: List STB operators response - *

- * Revision log: - * 2017-04-10: created by strawmanbobi - */ -public class OperatorsResponse extends ServiceResponse { - - private List entity; - - public OperatorsResponse(Status status, List cities) { - super(status); - this.entity = cities; - } - - public OperatorsResponse() { - - } - - public List getEntity() { - return entity; - } - - public void setEntity(List entity) { - this.entity = entity; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/ServiceResponse.java b/android-example/web-api/src/main/java/net/irext/webapi/response/ServiceResponse.java deleted file mode 100644 index 8f8852f..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/ServiceResponse.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.irext.webapi.response; - -/** - * Filename: ServiceResponse.java - * Revised: Date: 2017-03-31 - * Revision: Revision: 1.0 - *

- * Description: HTTP Response base class - *

- * Revision log: - * 2017-03-31: created by strawmanbobi - */ -public class ServiceResponse { - - private Status status; - - public ServiceResponse(Status status) { - this.status = status; - } - - public ServiceResponse() { - - } - - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/response/Status.java b/android-example/web-api/src/main/java/net/irext/webapi/response/Status.java deleted file mode 100644 index 7c354d4..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/response/Status.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.irext.webapi.response; - -/** - * Filename: Status.java - * Revised: Date: 2017-03-31 - * Revision: Revision: 1.0 - *

- * Description: HTTP response status - *

- * Revision log: - * 2017-03-31: created by strawmanbobi - */ -public class Status { - - private int code; - private String cause; - - public Status(int code, String cause) { - this.code = code; - this.cause = cause; - } - - public Status() { - - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getCause() { - return cause; - } - - public void setCause(String cause) { - this.cause = cause; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/utils/Constants.java b/android-example/web-api/src/main/java/net/irext/webapi/utils/Constants.java deleted file mode 100644 index 3b0f335..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/utils/Constants.java +++ /dev/null @@ -1,176 +0,0 @@ -package net.irext.webapi.utils; - -/** - * Filename: Constants.java - * Revised: Date: 2017-04-03 - * Revision: Revision: 1.0 - *

- * Description: SDK Constants - *

- * Revision log: - * 2017-04-03: created by strawmanbobi - */ -public class Constants { - - public static final int ERROR_CODE_SUCCESS = 0; - public static final int ERROR_CODE_NETWORK_ERROR = -1; - public static final int ERROR_CODE_AUTH_FAILURE = 1; - public static final int ERROR_CODE_INVALID_CATEGORY = 2; - public static final int ERROR_CODE_INVALID_BRAND = 3; - public static final int ERROR_CODE_INVALID_PARAMETER = 4; - - public enum CategoryID { - AIR_CONDITIONER(1), - TV(2), - STB(3), - NET_BOX(4), - IPTV(5), - DVD(6), - FAN(7), - PROJECTOR(8), - STEREO(9), - LIGHT(10), - BSTB(11), - CLEANING_ROBOT(12), - AIR_CLEANER(13), - DYSON(14); - - private final int id; - - CategoryID(int id) { - this.id = id; - } - - public int getValue() { - return id; - } - } - - public enum BinaryType { - TYPE_BINARY(0), - TYPE_HEXDECIMAL(1); - - private final int type; - - BinaryType(int type) { - this.type = type; - } - - public int getValue() { - return type; - } - } - - public enum ACPower { - POWER_ON(0), - POWER_OFF(1); - - private final int power; - - ACPower(int power) { - this.power = power; - } - - public int getValue() { - return power; - } - } - - public enum ACMode { - MODE_COOL(0), - MODE_HEAT(1), - MODE_AUTO(2), - MODE_FAN(3), - MODE_DEHUMIDITY(4); - - private final int mode; - - ACMode(int mode) { - this.mode = mode; - } - - public int getValue() { - return mode; - } - } - - public enum ACTemperature { - TEMP_16(0), - TEMP_17(1), - TEMP_18(2), - TEMP_19(3), - TEMP_20(4), - TEMP_21(5), - TEMP_22(6), - TEMP_23(7), - TEMP_24(8), - TEMP_25(9), - TEMP_26(10), - TEMP_27(11), - TEMP_28(12), - TEMP_29(13), - TEMP_30(14); - - private final int temp; - - ACTemperature(int temp) { - this.temp = temp; - } - - public int getValue() { - return temp; - } - } - - public enum ACWindSpeed { - SPEED_AUTO(0), - SPEED_LOW(1), - SPEED_MEDIUM(2), - SPEED_HIGH(3); - - private final int speed; - - ACWindSpeed(int speed) { - this.speed = speed; - } - - public int getValue() { - return speed; - } - } - - public enum ACSwing { - SWING_ON(0), - SWING_OFF(1); - - private final int swing; - - ACSwing(int swing) { - this.swing = swing; - } - - public int getValue() { - return swing; - } - } - - public enum ACFunction { - FUNCTION_SWITCH_POWER(1), - FUNCTION_CHANGE_MODE(2), - FUNCTION_TEMPERATURE_UP(3), - FUNCTION_TEMPERATURE_DOWN(4), - FUNCTION_SWITCH_WIND_SPEED(5), - FUNCTION_SWITCH_WIND_DIR(6), - FUNCTION_SWITCH_SWING(7); - - private final int function; - - ACFunction(int function) { - this.function = function; - } - - public int getValue() { - return function; - } - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/utils/MD5Digest.java b/android-example/web-api/src/main/java/net/irext/webapi/utils/MD5Digest.java deleted file mode 100644 index 1c48710..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/utils/MD5Digest.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.irext.webapi.utils; - -import java.security.MessageDigest; - -/** - * Filename: MD5Digest.java - * Revised: Date: 2017-04-03 - * Revision: Revision: 1.0 - *

- * Description: MD5 digest algorithm - *

- * Revision log: - * 2017-04-03: created by strawmanbobi - */ -public class MD5Digest { - - public static String MD5(String content) { - String result = null; - try { - MessageDigest md = MessageDigest.getInstance("MD5"); - md.update(content.getBytes()); - byte b[] = md.digest(); - - int i; - - StringBuffer buf = new StringBuffer(""); - for (int offset = 0; offset < b.length; offset++) { - i = b[offset]; - if (i < 0) i += 256; - if (i < 16) buf.append("0"); - buf.append(Integer.toHexString(i)); - } - result = buf.toString(); - } catch (Exception e) { - e.printStackTrace(); - return content; - } - return result; - } -} diff --git a/android-example/web-api/src/main/java/net/irext/webapi/utils/PackageUtils.java b/android-example/web-api/src/main/java/net/irext/webapi/utils/PackageUtils.java deleted file mode 100644 index f7bac70..0000000 --- a/android-example/web-api/src/main/java/net/irext/webapi/utils/PackageUtils.java +++ /dev/null @@ -1,79 +0,0 @@ -package net.irext.webapi.utils; - -import android.content.Context; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.Signature; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; - -/** - * Filename: PackageUtils.java - * Revised: Date: 2017-05-27 - * Revision: Revision: 1.0 - *

- * Description: String utils - *

- * Revision log: - * 2017-05-27: created by strawmanbobi - */ -public class PackageUtils { - - public static String byte2HexFormatted(byte[] arr) { - StringBuilder str = new StringBuilder(arr.length * 2); - for (int i = 0; i < arr.length; i++) { - String h = Integer.toHexString(arr[i]); - int l = h.length(); - if (l == 1) h = "0" + h; - if (l > 2) h = h.substring(l - 2, l); - str.append(h.toUpperCase()); - if (i < (arr.length - 1)) str.append(':'); - } - return str.toString(); - } - - public static String getCertificateSHA1Fingerprint(Context context) { - PackageManager pm = context.getPackageManager(); - String packageName = context.getPackageName(); - int flags = PackageManager.GET_SIGNATURES; - PackageInfo packageInfo = null; - try { - packageInfo = pm.getPackageInfo(packageName, flags); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - Signature[] signatures = packageInfo.signatures; - byte[] cert = signatures[0].toByteArray(); - InputStream input = new ByteArrayInputStream(cert); - CertificateFactory cf = null; - try { - cf = CertificateFactory.getInstance("X509"); - } catch (CertificateException e) { - e.printStackTrace(); - } - X509Certificate c = null; - try { - c = (X509Certificate) cf.generateCertificate(input); - } catch (CertificateException e) { - e.printStackTrace(); - } - String hexString = null; - try { - MessageDigest md = MessageDigest.getInstance("SHA1"); - byte[] publicKey = md.digest(c.getEncoded()); - hexString = byte2HexFormatted(publicKey); - } catch (NoSuchAlgorithmException e1) { - e1.printStackTrace(); - } catch (CertificateEncodingException e) { - e.printStackTrace(); - } - return hexString; - } -}