Commit 2a3ce8ba by Kazuyuki Hida

規約同系API関連のコードをBizから移植。

parent 17000bea
......@@ -15,6 +15,7 @@ import java.util.Observer;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsBooleanResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.json.AgreementToTermsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.AppLatestVersionJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON;
......@@ -54,6 +55,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameter
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AgreementToTermsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveDetailRequestParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters;
......@@ -1112,6 +1114,20 @@ public class AcmsClient implements AcmsClientResponseListener {
return new TermsOfUseJson(response.httpResponseBody);
}
public AgreementToTermsJSON getTerms(String sid) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiGetTerms, new AcmsParameters(sid));
AgreementToTermsJSON json = new AgreementToTermsJSON(response.httpResponseBody);
return json;
}
public AcmsCommonJSON agreeTerms(AgreementToTermsParameters params) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiAgreeTerms, params);
AcmsCommonJSON json = new AcmsCommonJSON(response.httpResponseBody);
return json;
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONException;
import org.json.adf.JSONObject;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
public class AgreementToTermsJSON extends AcmsCommonJSON {
private static final String TERMS_VERSION = "termsVersion";
private static final String TERMS = "terms";
private String termsVersion;
private String terms;
public AgreementToTermsJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException, JSONException {
super.parse(json);
termsVersion = json.getString(TERMS_VERSION);
terms = json.getString(TERMS);
}
public String getTermsVersion() {
return termsVersion;
}
public String getTerms() {
return terms;
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
public class AgreementToTermsParameters extends HttpParameterObject {
private final String sid;
private final String termsVersion;
public AgreementToTermsParameters(String sid, String termsVersion) {
super();
this.sid = sid;
this.termsVersion = termsVersion;
}
public String getSid() {
return sid;
}
public String getTermsVersion() {
return termsVersion;
}
}
......@@ -177,6 +177,10 @@ public class AcmsApis {
public static final String ApigetArchive = "archive";
public static final String ApigetCollaboration = "collaboration";
// 規約同意
public static final String ApiGetTerms = "getTerms";
public static final String ApiAgreeTerms = "agreeTerms";
public static final class UserCmds {
public static final String inviteUsers = "3";
public static final String getMyInfo = "9";
......
......@@ -180,5 +180,10 @@ public interface ServiceOption {
* 利用しない:N(通常)、利用する:Y
*/
int AlcoholCheckerHw = 202;
/**
* 規約同意
*/
int agrementToTerms = 203;
}
}
\ No newline at end of file
......@@ -246,6 +246,9 @@ public class ABookKeys {
public static final String TASK_DEVICE_TYPE = "deviceType"; // CMSのインターフェースのパラメータ:devicetype
public static final String TASK_QUESTION_ID = "qid"; // CMSのインターフェースのパラメータ:qid
public static final String AGREEMENT_TO_TERMS_VERSION = "termsVersion";
public static final String AGREEMENT_TO_TERMS = "terms";
public static final String JSON_NAME = "jsonName";
public static final String JSON_DATA = "jsonData";
public static final String PUSH_MESSAGE_ID = "pushMessageId";
......
......@@ -351,6 +351,10 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.AlcoholCheckerHw);
}
public boolean isUsableAgreementToTerms() {
return isServiceOptionEnable(ServiceOptionId.agrementToTerms);
}
/**
* @version 1.2.300
* サービスオプション(ユーザパスワードソルト付加)返す
......
package jp.agentec.abook.abv.bl.logic;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.acms.client.json.AgreementToTermsJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AgreementToTermsParameters;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
public class AgreementToTermsLogic extends AbstractLogic {
private static final String TAG = "AgreementToTermsLogic";
public AgreementToTermsJSON getTerms() throws AcmsException, NetworkDisconnectedException {
String sid = cache.getMemberInfo().sid;
return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getTerms(sid);
}
public AcmsCommonJSON agreeTerms(String termsVersion) throws AcmsException, NetworkDisconnectedException {
String sid = cache.getMemberInfo().sid;
return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).agreeTerms(new AgreementToTermsParameters(sid, termsVersion));
}
}
Subproject commit 10f8770205ba330c997ba23a2e4010c1366e830f
Subproject commit 3afcff19b2b133882e03a98e5f6e060731439b01
......@@ -1548,4 +1548,8 @@
<string name="msg_ble_connect_success">%1$sと接続になりました。%1$sを操作してください。</string>
<string name="select_spp_device_title">シリアル通信機器選択</string>
<string name="msg_get_device_token_fail">プッシュ通知サービスに必要なデバイストークンの取得に失敗しました。\nGooglePlayServiceアプリがインストールされているか確認してください。</string>
<string name="failed_to_get_terms_of_service">利用規約の取得に失敗しました。</string>
<string name="logout_by_disagree">ログアウトされ、ログイン画面に遷移します。よろしいでしょうか?</string>
<string name="failed_to_send_agreement">利用規約同意情報をサーバへ送信失敗しました。\nもう一度、同意ボタンをタップしてください。</string>
</resources>
......@@ -1545,4 +1545,8 @@
<string name="pairing_search_scan">주사</string>
<string name="pairing_search_stop">멈추다</string>
<string name="msg_get_device_token_fail">알림 서비스에 필요한 단말기 토큰을 취득하지 못했습니다. \nGooglePlayService가 인스톨 되어있는지 확인해 주세요.</string>
<string name="failed_to_get_terms_of_service">이용규약 정보 취득에 실패하였습니다.</string>
<string name="logout_by_disagree">로그 아웃되어 로그인 화면으로 이동합니다. 실행 하시겠습니까?</string>
<string name="failed_to_send_agreement">이용 규약 동의 정보를 서버에 전송 실패하였습니다. 다시 한번 동의 버튼을 눌러주세요.</string>
</resources>
\ No newline at end of file
......@@ -1548,4 +1548,8 @@
<string name="msg_ble_connect_success">It is now connected to the %1$s.Operate the %1$s.</string>
<string name="select_spp_device_title">Serial communication device selection</string>
<string name="msg_get_device_token_fail">Failed to acquire the device token required for the push notification service. \nCheck if the GooglePlayService app is installed.</string>
<string name="failed_to_get_terms_of_service">Failed to get the terms of service information.</string>
<string name="logout_by_disagree">Log out and transition to the login screen. Are you okay?</string>
<string name="failed_to_send_agreement">Failed to send information about agreeing to the Terms of Service to the server. Please tap \"Agree\" again.</string>
</resources>
......@@ -38,12 +38,16 @@ app_versioncode=1
# abvEnvironments.xml
#cms server
acms_address=https://chatdev2.agentec.jp/acms
download_server_address=https://chatdev2.agentec.jp/acms
#acms_address=https://chatdev2.agentec.jp/acms
#download_server_address=https://chatdev2.agentec.jp/acms
acms_address=https://check130.abook.bz/acms
download_server_address=https://check130.abook.bz/acms
#syncview server
websocket_server_http_url=https://check130.agentec.jp/v1
websocket_server_ws_url=wss://check130.agentec.jp/v1
#websocket_server_http_url=https://check130.agentec.jp/v1
#websocket_server_ws_url=wss://check130.agentec.jp/v1
websocket_server_http_url=https://check130.abook.bz:10443/v1
websocket_server_ws_url=wss://check130.abook.bz:10443/v1
#WebSocket debug出力
websocket_debug=false
......@@ -86,7 +90,7 @@ is_check_invalid_passward_limit=true
repeat_default=true
#Setting Info(設定画面のABookについての設定情報)
version_name=1.4.413
version_name=1.4.500
release_date=2023/04/25
copy_right=2016 AGENTEC Co.,Ltd. All rights reserved.
hope_page=http://www.agentec.jp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment