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
a6ff1c56
Commit
a6ff1c56
authored
Feb 17, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャットルーム詳細実装
parent
ceddbc2f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
193 additions
and
23 deletions
+193
-23
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+21
-6
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/CreatedRoomJSON.java
+2
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/MessageInfoListJSON.java
+62
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AcmsParameters.java
+8
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/CreateRoomParameters.java
+8
-8
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetMessagesParameters.java
+69
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+3
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+4
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+13
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
a6ff1c56
...
...
@@ -26,6 +26,7 @@ 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
;
import
jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON
;
...
...
@@ -38,7 +39,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ShopMemberListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters
;
...
...
@@ -54,6 +54,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParamete
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetApertureMasterDataParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetContentParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetEnqueteReplyParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetMessagesParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters
;
...
...
@@ -62,7 +63,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.
c
reateRoomParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.
C
reateRoomParameters
;
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
;
...
...
@@ -567,8 +568,8 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
GroupListJSON
getGroupInfo
(
String
sid
,
String
groupId
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetUser
,
new
AcmsParameters
(
sid
,
AcmsApis
.
Cmds
.
getGroupInfo
,
groupId
));
public
GroupListJSON
getGroupInfo
(
String
sid
,
String
groupId
,
String
updatedDate
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetUser
,
new
AcmsParameters
(
sid
,
AcmsApis
.
Cmds
.
getGroupInfo
,
groupId
,
updatedDate
));
GroupListJSON
json
=
new
GroupListJSON
(
response
.
httpResponseBody
);
return
json
;
}
...
...
@@ -581,13 +582,27 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
CreatedRoomJSON
createRoom
(
String
sid
,
Integer
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetChatRooms
,
new
c
reateRoomParameters
(
sid
,
AcmsApis
.
Cmds
.
createRoom
,
roomType
,
inviteMemberIds
,
newRoomName
));
public
CreatedRoomJSON
createRoom
(
String
sid
,
String
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetChatRooms
,
new
C
reateRoomParameters
(
sid
,
AcmsApis
.
Cmds
.
createRoom
,
roomType
,
inviteMemberIds
,
newRoomName
));
CreatedRoomJSON
json
=
new
CreatedRoomJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
* ルーム作成。
*
* @param sid
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
MessageInfoListJSON
getMessages
(
String
sid
,
String
roomId
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetMessage
,
new
GetMessagesParameters
(
sid
,
AcmsApis
.
Cmds
.
getMessages
,
roomId
,
"0"
));
MessageInfoListJSON
json
=
new
MessageInfoListJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
* 作業報告データ送信
* @param sid
* @param operationId
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/CreatedRoomJSON.java
View file @
a6ff1c56
...
...
@@ -22,7 +22,7 @@ public class CreatedRoomJSON extends AcmsCommonJSON {
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
=
"t
ype"
;
private
static
final
String
ROOM_TYPE
=
"roomT
ype"
;
public
ArrayList
<
ShopMemberDto
>
attendUsers
;
public
ChatRoomDto
chatRoomDto
;
...
...
@@ -46,7 +46,7 @@ public class CreatedRoomJSON extends AcmsCommonJSON {
chatRoomDto
.
userCount
=
groupListJsonArray
.
length
();
chatRoomDto
.
chatRoomId
=
createdRoomJson
.
getInt
(
ROOM_ID
);
chatRoomDto
.
chatRoomName
=
createdRoomJson
.
getString
(
ROOM_NAME
);
chatRoomDto
.
type
=
createdRoomJson
.
getInt
(
TYPE
);
chatRoomDto
.
type
=
createdRoomJson
.
getInt
(
ROOM_
TYPE
);
chatRoomDto
.
unreadCount
=
0
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/MessageInfoListJSON.java
0 → 100644
View file @
a6ff1c56
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.ChatMessageDto
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
MessageInfoListJSON
extends
AcmsCommonJSON
{
private
static
final
String
Body
=
"body"
;
private
static
final
String
MESSAGE_INFO_LIST
=
"messageInfoList"
;
private
static
final
String
MESSAGE
=
"message"
;
private
static
final
String
MESSAGE_ID
=
"messageId"
;
private
static
final
String
SHOP_ID
=
"shopId"
;
private
static
final
String
SHOP_MEMBER_ID
=
"shopMemberId"
;
private
static
final
String
MESSAGE_TYPE
=
"messageType"
;
private
static
final
String
TIME
=
"time"
;
private
static
final
String
CRYPTED_MEMBER_NAME
=
"cryptedMemberName"
;
public
ArrayList
<
ChatMessageDto
>
chatMessageDtoList
;
public
MessageInfoListJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
{
// メッセージ情報を取得
if
(!
json
.
has
(
Body
))
{
return
;
}
JSONArray
messageInfoList
=
json
.
getJSONObject
(
Body
).
getJSONArray
(
MESSAGE_INFO_LIST
);
if
(
messageInfoList
==
null
)
{
return
;
}
chatMessageDtoList
=
new
ArrayList
<
ChatMessageDto
>();
for
(
int
listCount
=
0
;
listCount
<
messageInfoList
.
length
();
listCount
++)
{
if
(
messageInfoList
.
getJSONObject
(
listCount
).
length
()
==
0
)
{
break
;
}
ChatMessageDto
chatMessageDto
=
new
ChatMessageDto
();
JSONObject
messageInfoJSON
=
messageInfoList
.
getJSONObject
(
listCount
);
if
(
messageInfoJSON
==
null
)
{
continue
;
}
chatMessageDto
.
shopMemberId
=
messageInfoJSON
.
getInt
(
SHOP_MEMBER_ID
);
chatMessageDto
.
chatMessageId
=
messageInfoJSON
.
getInt
(
MESSAGE_ID
);
chatMessageDto
.
message
=
messageInfoJSON
.
getString
(
MESSAGE
);
chatMessageDto
.
messageType
=
messageInfoJSON
.
getInt
(
MESSAGE_TYPE
);
if
(
messageInfoJSON
.
has
(
TIME
))
{
chatMessageDto
.
insertDate
=
DateTimeUtil
.
millToDateString
(
messageInfoJSON
.
getJSONObject
(
TIME
).
getLong
(
TIME
));
}
chatMessageDtoList
.
add
(
chatMessageDto
);
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AcmsParameters.java
View file @
a6ff1c56
...
...
@@ -16,6 +16,8 @@ public class AcmsParameters extends HttpParameterObject {
private
String
sid
;
private
String
cmd
;
private
String
groupId
;
private
String
updatedDate
;
/**
* {@link AcmsParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
...
...
@@ -36,10 +38,11 @@ public class AcmsParameters extends HttpParameterObject {
this
.
cmd
=
cmd
;
}
public
AcmsParameters
(
String
sid
,
String
cmd
,
String
groupId
)
{
public
AcmsParameters
(
String
sid
,
String
cmd
,
String
groupId
,
String
updatedDate
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
groupId
=
groupId
;
this
.
updatedDate
=
updatedDate
;
}
/**
...
...
@@ -60,6 +63,10 @@ public class AcmsParameters extends HttpParameterObject {
return
cmd
;
}
public
String
getUpdatedDate
()
{
return
updatedDate
;
}
public
String
getGroupId
()
{
return
groupId
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/
c
reateRoomParameters.java
→
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/
C
reateRoomParameters.java
View file @
a6ff1c56
...
...
@@ -5,36 +5,36 @@ import jp.agentec.adf.net.http.HttpParameterObject;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link
c
reateRoomParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* ただし、このクラスはログイン状態の確認用として使われる {@link
C
reateRoomParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author Taejin Hong
* @version 1.0.0
*/
public
class
c
reateRoomParameters
extends
HttpParameterObject
{
public
class
C
reateRoomParameters
extends
HttpParameterObject
{
/**
* セッションID
* @since 1.0.0
*/
private
String
sid
;
private
String
cmd
;
private
Integer
roomType
;
private
String
roomType
;
private
String
inviteMemberIds
;
private
String
newRoomName
;
/**
* {@link
c
reateRoomParameters} のインスタンスを初期化します。
* {@link
C
reateRoomParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @since 1.0.0
*/
public
c
reateRoomParameters
(
String
sid
)
{
public
C
reateRoomParameters
(
String
sid
)
{
this
.
sid
=
sid
;
}
/**
* {@link
c
reateRoomParameters} のインスタンスを初期化します。
* {@link
C
reateRoomParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public
createRoomParameters
(
String
sid
,
String
cmd
,
Integer
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
{
public
CreateRoomParameters
(
String
sid
,
String
cmd
,
String
roomType
,
String
inviteMemberIds
,
String
newRoomName
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
roomType
=
roomType
;
...
...
@@ -60,7 +60,7 @@ public class createRoomParameters extends HttpParameterObject {
return
cmd
;
}
public
Integer
getRoomType
()
{
public
String
getRoomType
()
{
return
roomType
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetMessagesParameters.java
0 → 100644
View file @
a6ff1c56
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
jp.agentec.adf.net.http.HttpParameterObject
;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link GetMessagesParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author Taejin Hong
* @version 1.0.0
*/
public
class
GetMessagesParameters
extends
HttpParameterObject
{
/**
* セッションID
* @since 1.0.0
*/
private
String
sid
;
private
String
cmd
;
private
String
roomId
;
private
String
lineNum
;
/**
* {@link GetMessagesParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @since 1.0.0
*/
public
GetMessagesParameters
(
String
sid
)
{
this
.
sid
=
sid
;
}
/**
* {@link GetMessagesParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public
GetMessagesParameters
(
String
sid
,
String
cmd
,
String
roomId
,
String
lineNum
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
roomId
=
roomId
;
this
.
lineNum
=
lineNum
;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getSid
()
{
return
sid
;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getCmd
()
{
return
cmd
;
}
public
String
getRoomId
()
{
return
roomId
;
}
public
String
getLineNum
()
{
return
lineNum
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
a6ff1c56
...
...
@@ -172,12 +172,14 @@ public class AcmsApis {
public
static
final
String
ApiGetChatPushData
=
"push"
;
public
static
final
String
ApigetChatRooms
=
"room"
;
public
static
final
String
ApigetUser
=
"user"
;
public
static
final
String
ApigetMessage
=
"message"
;
public
static
final
class
Cmds
{
public
static
final
String
getRoomList
=
"5"
;
public
static
final
String
getMyInfo
=
"9"
;
public
static
final
String
getGroupInfo
=
"10"
;
public
static
final
String
createRoom
=
"2"
;
public
static
final
String
getMessages
=
"2"
;
}
// download
...
...
@@ -226,7 +228,7 @@ public class AcmsApis {
methodName
.
equals
(
ApiOperationGroupMaster
)
||
methodName
.
equals
(
ApiGetApertureMasterData
)
||
methodName
.
equals
(
ApiQuickReportSearch
)
||
methodName
.
equals
(
ApiQuickReportRevision
)
||
methodName
.
equals
(
ApiGetProcessData
)
||
methodName
.
equals
(
ApiDeleteProcess
))
{
apiValue
=
Constant
.
ApiValue
.
checkapi
;
}
else
if
(
methodName
.
equals
(
ApiGetChatPushData
)
||
methodName
.
equals
(
ApigetChatRooms
)
||
methodName
.
equals
(
ApigetUser
))
{
// pushActionはchatapiを指定
}
else
if
(
methodName
.
equals
(
ApiGetChatPushData
)
||
methodName
.
equals
(
ApigetChatRooms
)
||
methodName
.
equals
(
ApigetUser
)
||
methodName
.
equals
(
ApigetMessage
)
)
{
// pushActionはchatapiを指定
apiValue
=
Constant
.
ApiValue
.
chatapi
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
View file @
a6ff1c56
...
...
@@ -67,7 +67,7 @@ public class ChatMessageDao extends AbstractDao {
}
public
void
insertChatMessage
(
ChatMessageDto
dto
)
{
insert
(
"insert into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date) values (?,?,?,?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
insert
(
"insert
or replace
into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date) values (?,?,?,?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
void
insertChatMessage
(
List
<
ChatMessageDto
>
chatMessageDtoList
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
View file @
a6ff1c56
...
...
@@ -94,7 +94,7 @@ public class ChatRoomDao extends AbstractDao {
}
public
void
insertChatRoom
(
ChatRoomDto
dto
)
{
insert
(
"insert into t_chat_room (chat_room_id, chat_room_name, type, unread_count, user_count, favorite_register_date) values (?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
insert
(
"insert
or replace
into t_chat_room (chat_room_id, chat_room_name, type, unread_count, user_count, favorite_register_date) values (?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
void
insertChatRoom
(
List
<
ChatRoomDto
>
chatRoomDtoList
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
View file @
a6ff1c56
...
...
@@ -61,7 +61,7 @@ public class ShopMemberDao extends AbstractDao {
public
void
insertShopMember
(
ShopMemberDto
dto
)
{
try
{
beginTransaction
();
insert
(
"insert into m_shop_member (shop_member_id, shop_member_name, profile_url, favorite_register_date, self_flg) values (?,?,?,?,?)"
,
dto
.
getInsertValues
());
insert
(
"insert
or replace
into m_shop_member (shop_member_id, shop_member_name, profile_url, favorite_register_date, self_flg) values (?,?,?,?,?)"
,
dto
.
getInsertValues
());
for
(
Integer
groupId
:
dto
.
groupIdList
)
{
insert
(
"insert into r_shop_member_group (shop_member_id, group_id) values ("
+
dto
.
shopMemberId
+
",?)"
,
dto
.
getGroupIds
());
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
a6ff1c56
...
...
@@ -103,6 +103,10 @@ public class CommunicationLogic extends AbstractLogic {
chatMessageDao
.
insertChatMessage
(
insertMessageList
);
}
public
void
insertMessageList
(
List
<
ChatMessageDto
>
messageList
)
{
chatMessageDao
.
insertChatMessage
(
messageList
);
}
public
void
insertChatRoom
(
ChatRoomDto
chatRoomDto
)
{
chatRoomDao
.
insertChatRoom
(
chatRoomDto
);
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
a6ff1c56
...
...
@@ -41,6 +41,7 @@ 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.MessageInfoListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ShopMemberListJSON
;
...
...
@@ -52,6 +53,7 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.ContentReadingLogDto
;
import
jp.agentec.abook.abv.bl.dto.PushMessageDto
;
...
...
@@ -711,15 +713,24 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public
void
updateGroupInfo
()
throws
NetworkDisconnectedException
,
AcmsException
{
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
"0"
);
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
"0"
,
"1900010115"
);
communicationLogic
.
updateGroup
(
resultJson
.
groupList
);
}
@JavascriptInterface
public
void
create
Room
(
Integer
roomType
,
String
userIdList
,
String
encodedRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
public
void
create
ChatRoom
(
String
roomType
,
String
userIdList
,
String
encodedRoomName
)
throws
NetworkDisconnectedException
,
AcmsException
{
CreatedRoomJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
createRoom
(
sid
,
roomType
,
userIdList
,
encodedRoomName
);
communicationLogic
.
insertChatRoom
(
resultJson
.
chatRoomDto
);
}
@JavascriptInterface
public
void
updateMessages
(
String
roomId
)
throws
NetworkDisconnectedException
,
AcmsException
{
MessageInfoListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMessages
(
sid
,
roomId
);
for
(
ChatMessageDto
chatMessageDto
:
resultJson
.
chatMessageDtoList
)
{
chatMessageDto
.
chatRoomId
=
Integer
.
parseInt
(
roomId
);
}
communicationLogic
.
insertMessageList
(
resultJson
.
chatMessageDtoList
);
}
}
/**
...
...
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