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
af412954
Commit
af412954
authored
Apr 14, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
利用規約文言取得APIをcontentsLogic から contractLogicへ移動した。
parent
e67f928b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
42 deletions
+50
-42
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentLogic.java
+0
-41
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContractLogic.java
+49
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
+1
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentLogic.java
View file @
af412954
...
...
@@ -521,45 +521,4 @@ public class ContentLogic extends AbstractLogic {
}
return
new
ContentJSON
(
text
);
}
/**
* 利用規約の詳細文を取得する
* @param url 取得しに行くURL
* @return 取得した文字列(失敗したらnullが返る)
*/
public
String
getTermsOfServiceText
(
String
url
,
String
laungage
)
{
HttpResponse
response
=
new
HttpResponse
();
HttpURLConnection
conn
=
null
;
try
{
URL
requestUrl
=
new
URL
(
url
+
"?language="
+
laungage
);
conn
=
HttpRequestSender
.
openConnection
(
"GET"
,
requestUrl
,
"UTF-8"
,
null
,
null
,
5000
);
Logger
.
i
(
TAG
,
"responseCode : "
+
conn
.
getResponseCode
());
response
.
httpResponseCode
=
conn
.
getResponseCode
();
if
(
response
.
httpResponseCode
!=
200
)
{
return
null
;
}
response
.
httpResponseMessage
=
conn
.
getResponseMessage
();
response
.
contentLength
=
NumericUtil
.
parseLong
(
conn
.
getHeaderField
(
"Content-Length"
),
0
);
InputStream
inputStream
=
conn
.
getInputStream
();
BufferedReader
bufferReader
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
(),
"UTF-8"
));
String
resultJson
=
new
String
();
String
str
;
while
(
null
!=
(
str
=
bufferReader
.
readLine
()
)
)
{
resultJson
=
resultJson
+
str
;
}
bufferReader
.
close
();
Logger
.
d
(
TAG
,
"response JSON : "
+
resultJson
);
return
resultJson
;
}
catch
(
IOException
e
)
{
Logger
.
e
(
e
.
getMessage
());
}
catch
(
NumberFormatException
e
)
{
Logger
.
e
(
e
.
getMessage
());
}
finally
{
if
(
conn
!=
null
)
{
conn
.
disconnect
();
}
}
return
null
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContractLogic.java
View file @
af412954
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
...
...
@@ -15,6 +21,8 @@ import jp.agentec.abook.abv.bl.data.dao.AcmsDao;
import
jp.agentec.abook.abv.bl.data.dao.ServiceOptionDao
;
import
jp.agentec.abook.abv.bl.dto.AcmsDto
;
import
jp.agentec.abook.abv.bl.dto.ServiceOptionDto
;
import
jp.agentec.adf.net.http.HttpRequestSender
;
import
jp.agentec.adf.net.http.HttpResponse
;
import
jp.agentec.adf.util.NumericUtil
;
import
jp.agentec.adf.util.StringUtil
;
...
...
@@ -354,4 +362,45 @@ public class ContractLogic extends AbstractLogic {
public
static
boolean
getBooleanValue
(
String
value
)
{
return
True
.
equals
(
value
);
}
/**
* 利用規約の詳細文を取得する
* @param url 取得しに行くURL
* @return 取得した文字列(失敗したらnullが返る)
*/
public
String
getTermsOfServiceText
(
String
url
,
String
laungage
)
{
HttpResponse
response
=
new
HttpResponse
();
HttpURLConnection
conn
=
null
;
try
{
URL
requestUrl
=
new
URL
(
url
+
"?language="
+
laungage
);
conn
=
HttpRequestSender
.
openConnection
(
"GET"
,
requestUrl
,
"UTF-8"
,
null
,
null
,
5000
);
Logger
.
i
(
TAG
,
"responseCode : "
+
conn
.
getResponseCode
());
response
.
httpResponseCode
=
conn
.
getResponseCode
();
if
(
response
.
httpResponseCode
!=
200
)
{
return
null
;
}
response
.
httpResponseMessage
=
conn
.
getResponseMessage
();
response
.
contentLength
=
NumericUtil
.
parseLong
(
conn
.
getHeaderField
(
"Content-Length"
),
0
);
InputStream
inputStream
=
conn
.
getInputStream
();
BufferedReader
bufferReader
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
(),
"UTF-8"
));
String
resultJson
=
new
String
();
String
str
;
while
(
null
!=
(
str
=
bufferReader
.
readLine
()
)
)
{
resultJson
=
resultJson
+
str
;
}
bufferReader
.
close
();
Logger
.
d
(
TAG
,
"response JSON : "
+
resultJson
);
return
resultJson
;
}
catch
(
IOException
e
)
{
Logger
.
e
(
e
.
getMessage
());
}
catch
(
NumberFormatException
e
)
{
Logger
.
e
(
e
.
getMessage
());
}
finally
{
if
(
conn
!=
null
)
{
conn
.
disconnect
();
}
}
return
null
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
View file @
af412954
...
...
@@ -278,7 +278,7 @@ public class LoginActivity extends ABVLoginActivity {
@Override
public
void
run
()
{
// CMSより文言を取得し、ダイアログで表示する。
Cont
entLogic
logic
=
AbstractLogic
.
getLogic
(
Conten
tLogic
.
class
);
Cont
ractLogic
logic
=
AbstractLogic
.
getLogic
(
Contrac
tLogic
.
class
);
String
language
=
Locale
.
getDefault
().
getLanguage
();
termsOfUseText
=
logic
.
getTermsOfServiceText
(
termsOfUseUrl
,
language
);
runOnUiThread
(
new
Runnable
()
{
...
...
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