Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
6d13a6be
Commit
6d13a6be
authored
Sep 24, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement agreeTerms API
parent
4ce1d42a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
1 deletions
+138
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+8
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/AgreeTermsJSON.java
+19
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/RequireTermsJSON.java
+13
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AgreeTermsParameters.java
+49
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/RequireTermsParameters.java
+12
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
+37
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
6d13a6be
...
@@ -15,6 +15,7 @@ import java.util.Observer;
...
@@ -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.AcmsBooleanResultJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON
;
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.AcmsMessageJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreeTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON
;
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.AppLatestVersionJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON
;
...
@@ -55,6 +56,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameter
...
@@ -55,6 +56,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.AcmsContentParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters
;
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.AddMemberGroupParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AgreeTermsParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters
;
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.ArchiveDetailRequestParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters
;
...
@@ -1114,12 +1116,17 @@ public class AcmsClient implements AcmsClientResponseListener {
...
@@ -1114,12 +1116,17 @@ public class AcmsClient implements AcmsClientResponseListener {
return
new
TermsOfUseJson
(
response
.
httpResponseBody
);
return
new
TermsOfUseJson
(
response
.
httpResponseBody
);
}
}
//terms
//
agreement to
terms
public
RequireTermsJSON
requireTerms
(
RequireTermsParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
public
RequireTermsJSON
requireTerms
(
RequireTermsParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiUrlRequireTerms
,
param
);
HttpResponse
response
=
send
(
AcmsApis
.
ApiUrlRequireTerms
,
param
);
return
new
RequireTermsJSON
(
response
.
httpResponseBody
);
return
new
RequireTermsJSON
(
response
.
httpResponseBody
);
}
}
public
AgreeTermsJSON
agreeTerms
(
AgreeTermsParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiUrlAgreeTerms
,
param
);
return
new
AgreeTermsJSON
(
response
.
httpResponseBody
);
}
/**********************************************************************************************/
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
/**********************************************************************************************/
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/AgreeTermsJSON.java
0 → 100644
View file @
6d13a6be
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
AgreeTermsJSON
extends
AcmsCommonJSON
{
public
AgreeTermsJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
,
JSONException
{
super
.
parse
(
json
);
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/RequireTermsJSON.java
View file @
6d13a6be
...
@@ -8,6 +8,14 @@ import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
...
@@ -8,6 +8,14 @@ import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
public
class
RequireTermsJSON
extends
AcmsCommonJSON
{
public
class
RequireTermsJSON
extends
AcmsCommonJSON
{
private
static
final
String
TERMS_ID
=
"terms_id"
;
private
static
final
String
TERMS_VERSION
=
"terms_version"
;
private
static
final
String
AGREEMENT
=
"agreement"
;
public
int
termsId
;
public
String
termsVersion
;
public
String
agreement
;
public
RequireTermsJSON
(
String
jsonString
)
throws
AcmsException
{
public
RequireTermsJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
super
(
jsonString
);
}
}
...
@@ -15,5 +23,10 @@ public class RequireTermsJSON extends AcmsCommonJSON {
...
@@ -15,5 +23,10 @@ public class RequireTermsJSON extends AcmsCommonJSON {
@Override
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
,
JSONException
{
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
,
JSONException
{
super
.
parse
(
json
);
super
.
parse
(
json
);
if
(
json
.
has
(
TERMS_ID
))
{
termsId
=
getInt
(
json
,
TERMS_ID
);
termsVersion
=
getString
(
json
,
TERMS_VERSION
);
agreement
=
getString
(
json
,
AGREEMENT
);
}
}
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AgreeTermsParameters.java
0 → 100644
View file @
6d13a6be
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
jp.agentec.adf.net.http.HttpParameterObject
;
import
jp.agentec.adf.util.StringUtil
;
public
class
AgreeTermsParameters
extends
HttpParameterObject
{
private
String
sid
;
private
int
deviceTypeId
;
private
String
deviceId
;
private
int
termsId
;
private
String
termsVersion
;
public
AgreeTermsParameters
(
String
sid
,
int
deviceTypeId
,
String
deviceId
,
int
termsId
,
String
termsVersion
)
{
if
(
StringUtil
.
isNullOrWhiteSpace
(
sid
))
{
throw
new
IllegalArgumentException
(
"argument sid not allowed null or white space."
);
}
if
(
StringUtil
.
isNullOrWhiteSpace
(
deviceId
))
{
throw
new
IllegalArgumentException
(
"argument deviceId not allowed null or white space."
);
}
if
(
StringUtil
.
isNullOrWhiteSpace
(
termsVersion
))
{
throw
new
IllegalArgumentException
(
"argument termsVersion not allowed null or white space."
);
}
this
.
sid
=
sid
;
this
.
deviceTypeId
=
deviceTypeId
;
this
.
deviceId
=
deviceId
;
this
.
termsId
=
termsId
;
this
.
termsVersion
=
termsVersion
;
}
public
String
getSid
()
{
return
sid
;
}
public
int
getDeviceTypeId
()
{
return
deviceTypeId
;
}
public
String
getDeviceId
()
{
return
deviceId
;
}
public
int
getTermsId
()
{
return
termsId
;
}
public
String
getTermsVersion
()
{
return
termsVersion
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/RequireTermsParameters.java
View file @
6d13a6be
...
@@ -19,4 +19,16 @@ public class RequireTermsParameters extends HttpParameterObject {
...
@@ -19,4 +19,16 @@ public class RequireTermsParameters extends HttpParameterObject {
this
.
deviceTypeId
=
deviceTypeId
;
this
.
deviceTypeId
=
deviceTypeId
;
this
.
deviceId
=
deviceId
;
this
.
deviceId
=
deviceId
;
}
}
public
String
getSid
()
{
return
sid
;
}
public
int
getDeviceTypeId
()
{
return
deviceTypeId
;
}
public
String
getDeviceId
()
{
return
deviceId
;
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
0 → 100644
View file @
6d13a6be
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
import
java.io.IOException
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreeTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RequireTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AgreeTermsParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.RequireTermsParameters
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
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
boolean
isTermsEnabled
()
{
return
false
;
}
public
RequireTermsJSON
requireTerms
()
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
String
sid
=
cache
.
getMemberInfo
().
sid
;
String
deviceId
=
ABVEnvironment
.
getInstance
().
deviceId
;
RequireTermsParameters
parameters
=
new
RequireTermsParameters
(
sid
,
ABVEnvironment
.
DeviceTypeId
,
deviceId
);
RequireTermsJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
requireTerms
(
parameters
);
return
json
;
}
public
AgreeTermsJSON
agreeTerms
(
int
termsId
,
String
termsVersion
)
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
String
sid
=
cache
.
getMemberInfo
().
sid
;
String
deviceId
=
ABVEnvironment
.
getInstance
().
deviceId
;
AgreeTermsParameters
parameters
=
new
AgreeTermsParameters
(
sid
,
ABVEnvironment
.
DeviceTypeId
,
deviceId
,
termsId
,
termsVersion
);
AgreeTermsJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
agreeTerms
(
parameters
);
return
json
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment