From 41075b12eeda7a0dd8962442b530aee4480e17ad Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Wed, 15 Apr 2020 20:50:40 +0800 Subject: [PATCH] updated index api to 0.2.5 --- android-sdk/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../main/java/net/irext/webapi/WebAPIs.java | 60 +++++++++++--- .../net/irext/webapi/model/ACParameters.java | 83 +++++++++++++++++++ .../irext/webapi/request/DecodeRequest.java | 23 ++++- .../request/GetACParametersRequest.java | 41 +++++++++ .../webapi/request/ListIndexesRequest.java | 14 +++- .../webapi/response/ACParametersResponse.java | 36 ++++++++ .../net/irext/webapi/utils/Constants.java | 2 +- web-sdk/src/net/irext/webapi/WebAPIs.java | 48 +++++++++-- .../net/irext/webapi/model/ACParameters.java | 83 +++++++++++++++++++ .../irext/webapi/request/DecodeRequest.java | 23 ++++- .../request/GetACParametersRequest.java | 41 +++++++++ .../webapi/request/ListIndexesRequest.java | 14 +++- .../webapi/response/ACParametersResponse.java | 36 ++++++++ web-sdk/web-sdk.iml | 12 +++ 16 files changed, 494 insertions(+), 28 deletions(-) create mode 100644 android-sdk/src/main/java/net/irext/webapi/model/ACParameters.java create mode 100644 android-sdk/src/main/java/net/irext/webapi/request/GetACParametersRequest.java create mode 100644 android-sdk/src/main/java/net/irext/webapi/response/ACParametersResponse.java create mode 100644 web-sdk/src/net/irext/webapi/model/ACParameters.java create mode 100644 web-sdk/src/net/irext/webapi/request/GetACParametersRequest.java create mode 100644 web-sdk/src/net/irext/webapi/response/ACParametersResponse.java create mode 100644 web-sdk/web-sdk.iml diff --git a/android-sdk/build.gradle b/android-sdk/build.gradle index 7daead3..7572433 100644 --- a/android-sdk/build.gradle +++ b/android-sdk/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:3.6.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/android-sdk/gradle/wrapper/gradle-wrapper.properties b/android-sdk/gradle/wrapper/gradle-wrapper.properties index 6e157c7..5b3fb83 100644 --- a/android-sdk/gradle/wrapper/gradle-wrapper.properties +++ b/android-sdk/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Dec 29 09:58:52 CST 2019 +#Wed Apr 15 19:56:17 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/android-sdk/src/main/java/net/irext/webapi/WebAPIs.java b/android-sdk/src/main/java/net/irext/webapi/WebAPIs.java index 58dfc2e..c7f5fd1 100644 --- a/android-sdk/src/main/java/net/irext/webapi/WebAPIs.java +++ b/android-sdk/src/main/java/net/irext/webapi/WebAPIs.java @@ -6,6 +6,7 @@ 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.*; @@ -35,7 +36,7 @@ public class WebAPIs { private static WebAPIs mInstance = null; - private static final String DEFAULT_ADDRESS = "http://irext.net"; + private static final String DEFAULT_ADDRESS = "http://localhost:8081"; private static final String DEFAULT_APP = "/irext-server"; private static String URL_PREFIX = DEFAULT_ADDRESS + DEFAULT_APP; @@ -53,11 +54,12 @@ public class WebAPIs { 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 OkHttpClient mHttpClient; + private final OkHttpClient mHttpClient; private WebAPIs(String address, String appName) { if (null != address && null != appName) { @@ -187,7 +189,7 @@ public class WebAPIs { @SuppressWarnings("unused") public void listBrands(int categoryId, int from, int count, - ListBrandsCallback listBrandsCallback) { + ListBrandsCallback listBrandsCallback) { String listBrandsURL = URL_PREFIX + SERVICE_LIST_BRANDS; ListBrandsRequest listBrandsRequest = new ListBrandsRequest(); listBrandsRequest.setId(id); @@ -261,7 +263,7 @@ public class WebAPIs { @SuppressWarnings("unused") public void listOperators(String cityCode, - ListOperatersCallback listOperatersCallback) { + ListOperatersCallback listOperatersCallback) { String listOperatorsURL = URL_PREFIX + SERVICE_LIST_OPERATORS; ListOperatorsRequest listOperatorsRequest = new ListOperatorsRequest(); listOperatorsRequest.setId(id); @@ -288,10 +290,11 @@ public class WebAPIs { @SuppressWarnings("unused") public void listRemoteIndexes(int categoryId, - int brandId, - String cityCode, - String operatorId, - ListIndexesCallback onListIndexCallback) { + int brandId, + String cityCode, + String operatorId, + int withParaData, + ListIndexesCallback onListIndexCallback) { String listIndexesURL = URL_PREFIX + SERVICE_LIST_INDEXES; ListIndexesRequest listIndexesRequest = new ListIndexesRequest(); listIndexesRequest.setId(id); @@ -300,6 +303,7 @@ public class WebAPIs { listIndexesRequest.setBrandId(brandId); listIndexesRequest.setCityCode(cityCode); listIndexesRequest.setOperatorId(operatorId); + listIndexesRequest.setWithParaData(withParaData); listIndexesRequest.setFrom(0); listIndexesRequest.setCount(20); String bodyJson = listIndexesRequest.toJson(); @@ -323,8 +327,7 @@ public class WebAPIs { @SuppressWarnings("unused") public void downloadBin(String remoteMap, int indexId, DownloadBinCallback downloadBinCallback) { - String fileName = IR_BIN_FILE_PREFIX + remoteMap + IR_BIN_FILE_SUFFIX; - String downloadURL = IR_BIN_DOWNLOAD_PREFIX + fileName; + String downloadURL = URL_PREFIX + SERVICE_DOWNLOAD_BIN; DownloadBinaryRequest downloadBinaryRequest = new DownloadBinaryRequest(); downloadBinaryRequest.setId(id); downloadBinaryRequest.setToken(token); @@ -334,7 +337,7 @@ public class WebAPIs { if (null != bodyJson) { try { - InputStream binStream = getFileByteStreamByURL(downloadURL); + InputStream binStream = postToServerForOctets(downloadURL, bodyJson); if (null != binStream) { downloadBinCallback.onDownloadBinSuccess(binStream); @@ -349,13 +352,18 @@ public class WebAPIs { } @SuppressWarnings("unused") - @Deprecated - public int[] decodeIR(int indexId) { + 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(); @@ -374,4 +382,30 @@ public class WebAPIs { } 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-sdk/src/main/java/net/irext/webapi/model/ACParameters.java b/android-sdk/src/main/java/net/irext/webapi/model/ACParameters.java new file mode 100644 index 0000000..98ddd52 --- /dev/null +++ b/android-sdk/src/main/java/net/irext/webapi/model/ACParameters.java @@ -0,0 +1,83 @@ +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-sdk/src/main/java/net/irext/webapi/request/DecodeRequest.java b/android-sdk/src/main/java/net/irext/webapi/request/DecodeRequest.java index 93b977e..9cfcfe3 100644 --- a/android-sdk/src/main/java/net/irext/webapi/request/DecodeRequest.java +++ b/android-sdk/src/main/java/net/irext/webapi/request/DecodeRequest.java @@ -18,12 +18,17 @@ public class DecodeRequest extends BaseRequest { 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) { + 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() { @@ -61,4 +66,20 @@ public class DecodeRequest extends BaseRequest { 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-sdk/src/main/java/net/irext/webapi/request/GetACParametersRequest.java b/android-sdk/src/main/java/net/irext/webapi/request/GetACParametersRequest.java new file mode 100644 index 0000000..e5f5174 --- /dev/null +++ b/android-sdk/src/main/java/net/irext/webapi/request/GetACParametersRequest.java @@ -0,0 +1,41 @@ +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-sdk/src/main/java/net/irext/webapi/request/ListIndexesRequest.java b/android-sdk/src/main/java/net/irext/webapi/request/ListIndexesRequest.java index 8ece383..99a823e 100644 --- a/android-sdk/src/main/java/net/irext/webapi/request/ListIndexesRequest.java +++ b/android-sdk/src/main/java/net/irext/webapi/request/ListIndexesRequest.java @@ -19,14 +19,18 @@ public class ListIndexesRequest extends BaseRequest { 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) { + 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() { @@ -80,4 +84,12 @@ public class ListIndexesRequest extends BaseRequest { 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-sdk/src/main/java/net/irext/webapi/response/ACParametersResponse.java b/android-sdk/src/main/java/net/irext/webapi/response/ACParametersResponse.java new file mode 100644 index 0000000..17f428c --- /dev/null +++ b/android-sdk/src/main/java/net/irext/webapi/response/ACParametersResponse.java @@ -0,0 +1,36 @@ +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-sdk/src/main/java/net/irext/webapi/utils/Constants.java b/android-sdk/src/main/java/net/irext/webapi/utils/Constants.java index 8a73c80..3b0f335 100644 --- a/android-sdk/src/main/java/net/irext/webapi/utils/Constants.java +++ b/android-sdk/src/main/java/net/irext/webapi/utils/Constants.java @@ -34,7 +34,7 @@ public class Constants { CLEANING_ROBOT(12), AIR_CLEANER(13), DYSON(14); - + private final int id; CategoryID(int id) { diff --git a/web-sdk/src/net/irext/webapi/WebAPIs.java b/web-sdk/src/net/irext/webapi/WebAPIs.java index cbb13b8..0917837 100644 --- a/web-sdk/src/net/irext/webapi/WebAPIs.java +++ b/web-sdk/src/net/irext/webapi/WebAPIs.java @@ -1,6 +1,7 @@ package net.irext.webapi; 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.*; @@ -28,7 +29,7 @@ public class WebAPIs { private static WebAPIs mInstance = null; - private static final String DEFAULT_ADDRESS = "http://irext.net"; + private static final String DEFAULT_ADDRESS = "http://localhost:8081"; private static final String DEFAULT_APP = "/irext-server"; private static String URL_PREFIX = DEFAULT_ADDRESS + DEFAULT_APP; @@ -46,11 +47,12 @@ public class WebAPIs { 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 OkHttpClient mHttpClient; + private final OkHttpClient mHttpClient; private WebAPIs(String address, String appName) { if (null != address && null != appName) { @@ -267,6 +269,7 @@ public class WebAPIs { int brandId, String cityCode, String operatorId, + int withParaData, ListIndexesCallback onListIndexCallback) { String listIndexesURL = URL_PREFIX + SERVICE_LIST_INDEXES; ListIndexesRequest listIndexesRequest = new ListIndexesRequest(); @@ -276,6 +279,7 @@ public class WebAPIs { listIndexesRequest.setBrandId(brandId); listIndexesRequest.setCityCode(cityCode); listIndexesRequest.setOperatorId(operatorId); + listIndexesRequest.setWithParaData(withParaData); listIndexesRequest.setFrom(0); listIndexesRequest.setCount(20); String bodyJson = listIndexesRequest.toJson(); @@ -299,8 +303,7 @@ public class WebAPIs { @SuppressWarnings("unused") public void downloadBin(String remoteMap, int indexId, DownloadBinCallback downloadBinCallback) { - String fileName = IR_BIN_FILE_PREFIX + remoteMap + IR_BIN_FILE_SUFFIX; - String downloadURL = IR_BIN_DOWNLOAD_PREFIX + fileName; + String downloadURL = URL_PREFIX + SERVICE_DOWNLOAD_BIN; DownloadBinaryRequest downloadBinaryRequest = new DownloadBinaryRequest(); downloadBinaryRequest.setId(id); downloadBinaryRequest.setToken(token); @@ -310,7 +313,7 @@ public class WebAPIs { if (null != bodyJson) { try { - InputStream binStream = getFileByteStreamByURL(downloadURL); + InputStream binStream = postToServerForOctets(downloadURL, bodyJson); if (null != binStream) { downloadBinCallback.onDownloadBinSuccess(binStream); @@ -325,13 +328,18 @@ public class WebAPIs { } @SuppressWarnings("unused") - @Deprecated - public int[] decodeIR(int indexId) { + 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(); @@ -350,4 +358,30 @@ public class WebAPIs { } 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/web-sdk/src/net/irext/webapi/model/ACParameters.java b/web-sdk/src/net/irext/webapi/model/ACParameters.java new file mode 100644 index 0000000..98ddd52 --- /dev/null +++ b/web-sdk/src/net/irext/webapi/model/ACParameters.java @@ -0,0 +1,83 @@ +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/web-sdk/src/net/irext/webapi/request/DecodeRequest.java b/web-sdk/src/net/irext/webapi/request/DecodeRequest.java index 93b977e..9cfcfe3 100644 --- a/web-sdk/src/net/irext/webapi/request/DecodeRequest.java +++ b/web-sdk/src/net/irext/webapi/request/DecodeRequest.java @@ -18,12 +18,17 @@ public class DecodeRequest extends BaseRequest { 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) { + 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() { @@ -61,4 +66,20 @@ public class DecodeRequest extends BaseRequest { 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/web-sdk/src/net/irext/webapi/request/GetACParametersRequest.java b/web-sdk/src/net/irext/webapi/request/GetACParametersRequest.java new file mode 100644 index 0000000..e5f5174 --- /dev/null +++ b/web-sdk/src/net/irext/webapi/request/GetACParametersRequest.java @@ -0,0 +1,41 @@ +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/web-sdk/src/net/irext/webapi/request/ListIndexesRequest.java b/web-sdk/src/net/irext/webapi/request/ListIndexesRequest.java index 8ece383..99a823e 100644 --- a/web-sdk/src/net/irext/webapi/request/ListIndexesRequest.java +++ b/web-sdk/src/net/irext/webapi/request/ListIndexesRequest.java @@ -19,14 +19,18 @@ public class ListIndexesRequest extends BaseRequest { 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) { + 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() { @@ -80,4 +84,12 @@ public class ListIndexesRequest extends BaseRequest { public void setOperatorId(String operatorId) { this.operatorId = operatorId; } + + public int getWithParaData() { + return withParaData; + } + + public void setWithParaData(int withParaData) { + this.withParaData = withParaData; + } } diff --git a/web-sdk/src/net/irext/webapi/response/ACParametersResponse.java b/web-sdk/src/net/irext/webapi/response/ACParametersResponse.java new file mode 100644 index 0000000..17f428c --- /dev/null +++ b/web-sdk/src/net/irext/webapi/response/ACParametersResponse.java @@ -0,0 +1,36 @@ +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/web-sdk/web-sdk.iml b/web-sdk/web-sdk.iml new file mode 100644 index 0000000..fb8e866 --- /dev/null +++ b/web-sdk/web-sdk.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file