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
ceddbc2f
Commit
ceddbc2f
authored
Feb 16, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャットルーム開設API追加
parent
b18009f9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
10 deletions
+165
-10
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+16
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/CreatedRoomJSON.java
+55
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/GroupListJSON.java
+8
-8
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/createRoomParameters.java
+74
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+4
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+7
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
ceddbc2f
...
...
@@ -21,6 +21,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.ChatPushDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ContentCheckDeliverableJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.CreatedRoomJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.GroupListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON
;
...
...
@@ -61,6 +62,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters
import
jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.UpdateDeviceTokenParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.createRoomParameters
;
import
jp.agentec.abook.abv.bl.acms.type.AcmsApis
;
import
jp.agentec.abook.abv.bl.acms.type.LoginStatus
;
import
jp.agentec.abook.abv.bl.acms.type.RequirePasswordChangeCode
;
...
...
@@ -572,6 +574,20 @@ public class AcmsClient implements AcmsClientResponseListener {
}
/**
* ルーム作成。
*
* @param sid
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
CreatedRoomJSON
createRoom
(
String
sid
,
Integer
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetChatRooms
,
new
createRoomParameters
(
sid
,
AcmsApis
.
Cmds
.
createRoom
,
roomType
,
inviteMemberIds
,
newRoomName
));
CreatedRoomJSON
json
=
new
CreatedRoomJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
* 作業報告データ送信
* @param sid
* @param operationId
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/CreatedRoomJSON.java
0 → 100644
View file @
ceddbc2f
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
import
java.util.ArrayList
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.GroupDto
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
public
class
CreatedRoomJSON
extends
AcmsCommonJSON
{
private
static
final
String
Body
=
"body"
;
private
static
final
String
CHAT_ROOM_INFO
=
"chatRoomInfo"
;
private
static
final
String
ROOM_ID
=
"roomId"
;
private
static
final
String
ROOM_NAME
=
"roomName"
;
private
static
final
String
ATTEND_USERS
=
"attendUsers"
;
private
static
final
String
MEMBER_NAME
=
"memberName"
;
private
static
final
String
SHOP_MEMBER_ID
=
"shopMemberId"
;
private
static
final
String
PROFILE_IMAGE_PATH
=
"profileImagePath"
;
private
static
final
String
DEL_FLG
=
"del_flg"
;
private
static
final
String
TYPE
=
"type"
;
public
ArrayList
<
ShopMemberDto
>
attendUsers
;
public
ChatRoomDto
chatRoomDto
;
public
CreatedRoomJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
{
// ルーム一覧情報を取得
if
(!
json
.
has
(
Body
))
{
return
;
}
JSONObject
createdRoomJson
=
json
.
getJSONObject
(
Body
).
getJSONObject
(
CHAT_ROOM_INFO
);
if
(
createdRoomJson
==
null
)
{
return
;
}
JSONArray
groupListJsonArray
=
createdRoomJson
.
getJSONArray
(
ATTEND_USERS
);
chatRoomDto
=
new
ChatRoomDto
();
chatRoomDto
.
userCount
=
groupListJsonArray
.
length
();
chatRoomDto
.
chatRoomId
=
createdRoomJson
.
getInt
(
ROOM_ID
);
chatRoomDto
.
chatRoomName
=
createdRoomJson
.
getString
(
ROOM_NAME
);
chatRoomDto
.
type
=
createdRoomJson
.
getInt
(
TYPE
);
chatRoomDto
.
unreadCount
=
0
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/GroupListJSON.java
View file @
ceddbc2f
...
...
@@ -33,20 +33,20 @@ public class GroupListJSON extends AcmsCommonJSON {
// ルーム一覧情報を取得
if
(!
json
.
has
(
Body
))
{
return
;
}
JSONArray
G
roupListJsonArray
=
json
.
getJSONObject
(
Body
).
getJSONArray
(
GROUP_INFO_LIST
);
if
(
G
roupListJsonArray
==
null
)
{
return
;
}
JSONArray
g
roupListJsonArray
=
json
.
getJSONObject
(
Body
).
getJSONArray
(
GROUP_INFO_LIST
);
if
(
g
roupListJsonArray
==
null
)
{
return
;
}
groupList
=
new
ArrayList
<
GroupDto
>();
for
(
int
listCount
=
0
;
listCount
<
G
roupListJsonArray
.
length
();
listCount
++)
{
if
(
G
roupListJsonArray
.
getJSONObject
(
listCount
).
length
()
==
0
)
{
for
(
int
listCount
=
0
;
listCount
<
g
roupListJsonArray
.
length
();
listCount
++)
{
if
(
g
roupListJsonArray
.
getJSONObject
(
listCount
).
length
()
==
0
)
{
break
;
}
GroupDto
groupDto
=
new
GroupDto
();
groupDto
.
groupId
=
G
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
GROUP_ID
);
groupDto
.
parentGroupId
=
G
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
PARENT_GROUP_ID
);
groupDto
.
groupName
=
G
roupListJsonArray
.
getJSONObject
(
listCount
).
getString
(
GROUP_NAME
);
groupDto
.
delFlg
=
G
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
DEL_FLG
);
groupDto
.
groupId
=
g
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
GROUP_ID
);
groupDto
.
parentGroupId
=
g
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
PARENT_GROUP_ID
);
groupDto
.
groupName
=
g
roupListJsonArray
.
getJSONObject
(
listCount
).
getString
(
GROUP_NAME
);
groupDto
.
delFlg
=
g
roupListJsonArray
.
getJSONObject
(
listCount
).
getInt
(
DEL_FLG
);
groupList
.
add
(
groupDto
);
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/createRoomParameters.java
0 → 100644
View file @
ceddbc2f
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
jp.agentec.abook.abv.bl.acms.type.AcmsApis
;
import
jp.agentec.adf.net.http.HttpParameterObject
;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link createRoomParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author Taejin Hong
* @version 1.0.0
*/
public
class
createRoomParameters
extends
HttpParameterObject
{
/**
* セッションID
* @since 1.0.0
*/
private
String
sid
;
private
String
cmd
;
private
Integer
roomType
;
private
String
inviteMemberIds
;
private
String
newRoomName
;
/**
* {@link createRoomParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @since 1.0.0
*/
public
createRoomParameters
(
String
sid
)
{
this
.
sid
=
sid
;
}
/**
* {@link createRoomParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public
createRoomParameters
(
String
sid
,
String
cmd
,
Integer
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
roomType
=
roomType
;
this
.
inviteMemberIds
=
inviteMemberIds
;
this
.
newRoomName
=
newRoomName
;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getSid
()
{
return
sid
;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getCmd
()
{
return
cmd
;
}
public
Integer
getRoomType
()
{
return
roomType
;
}
public
String
getInviteMemberIds
()
{
return
inviteMemberIds
;
}
public
String
getNewRoomName
()
{
return
newRoomName
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
ceddbc2f
...
...
@@ -177,6 +177,7 @@ public class AcmsApis {
public
static
final
String
getRoomList
=
"5"
;
public
static
final
String
getMyInfo
=
"9"
;
public
static
final
String
getGroupInfo
=
"10"
;
public
static
final
String
createRoom
=
"2"
;
}
// download
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
ceddbc2f
...
...
@@ -103,9 +103,12 @@ public class CommunicationLogic extends AbstractLogic {
chatMessageDao
.
insertChatMessage
(
insertMessageList
);
}
public
void
insertChatRoom
(
ChatRoomDto
chatRoomDto
)
{
chatRoomDao
.
insertChatRoom
(
chatRoomDto
);
}
public
void
insertShopMember
(
ShopMemberDto
shopMemberDto
)
{
shopMemberDao
.
insertShopMember
(
shopMemberDto
);
}
public
void
updateGroup
(
List
<
GroupDto
>
GroupList
)
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
ceddbc2f
...
...
@@ -39,6 +39,7 @@ import java.util.Objects;
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.CreatedRoomJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.GroupListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON
;
...
...
@@ -705,7 +706,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public
void
updateMyInfo
()
throws
NetworkDisconnectedException
,
AcmsException
{
MyInfoJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMyInfo
(
sid
);
communicationLogic
.
insertShopMember
(
resultJson
.
shopMemberDto
);
}
...
...
@@ -714,6 +714,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
"0"
);
communicationLogic
.
updateGroup
(
resultJson
.
groupList
);
}
@JavascriptInterface
public
void
createRoom
(
Integer
roomType
,
String
userIdList
,
String
encodedRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
CreatedRoomJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
createRoom
(
sid
,
roomType
,
userIdList
,
encodedRoomName
);
communicationLogic
.
insertChatRoom
(
resultJson
.
chatRoomDto
);
}
}
/**
...
...
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