Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antai-sport
antai-sport-http-server
Commits
035431ed
Commit
035431ed
authored
Aug 16, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
聊天记录已读未读状态更新
parent
c970d5b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
11 deletions
+7
-11
ChatController.java
.../api/business/sport/social/controller/ChatController.java
+2
-2
SportChatHistoryBusinessMapper.java
...s/sport/social/mapper/SportChatHistoryBusinessMapper.java
+1
-1
ChatService.java
...mobile/api/business/sport/social/service/ChatService.java
+3
-4
SportChatHistoryBusinessMapper.xml
...es/mapper/sport/social/SportChatHistoryBusinessMapper.xml
+1
-4
No files found.
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/sport/social/controller/ChatController.java
View file @
035431ed
...
...
@@ -36,8 +36,8 @@ public class ChatController {
@ApiOperation
(
value
=
"查询聊天记录"
)
@PostMapping
(
"history"
)
public
ResponseEntity
<
Result
<
List
<
RespChatHistory
>>>
getChatHistory
(
@RequestBody
ReqChatHistoryQueryParam
param
)
{
return
success
(
chatService
.
getChatHistory
(
param
));
public
ResponseEntity
<
Result
<
List
<
RespChatHistory
>>>
getChatHistory
(
@RequestBody
ReqChatHistoryQueryParam
param
,
@LoginSportUser
SportUser
loginUser
)
{
return
success
(
chatService
.
getChatHistory
(
param
,
loginUser
));
}
...
...
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/sport/social/mapper/SportChatHistoryBusinessMapper.java
View file @
035431ed
...
...
@@ -10,6 +10,6 @@ public interface SportChatHistoryBusinessMapper {
List
<
RespChatHistory
>
getChatHistory
(
@Param
(
"param"
)
ReqChatHistoryQueryParam
param
);
void
updateChartHistoryStatus
(
@Param
(
"
historyList"
)
List
<
RespChatHistory
>
historyList
);
void
updateChartHistoryStatus
(
@Param
(
"
roomKey"
)
String
roomKey
,
@Param
(
"sportUserId"
)
Long
sportUserId
);
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/sport/social/service/ChatService.java
View file @
035431ed
...
...
@@ -35,14 +35,13 @@ public class ChatService {
return
history
.
getId
();
}
public
List
<
RespChatHistory
>
getChatHistory
(
ReqChatHistoryQueryParam
param
)
{
public
List
<
RespChatHistory
>
getChatHistory
(
ReqChatHistoryQueryParam
param
,
SportUser
loginUser
)
{
if
(
param
.
getQuerySize
()
==
null
||
param
.
getQuerySize
()
==
0
)
{
param
.
setQuerySize
(
20
);
}
List
<
RespChatHistory
>
resultList
=
sportChatHistoryBusinessMapper
.
getChatHistory
(
param
);
if
(!
resultList
.
isEmpty
())
{
sportChatHistoryBusinessMapper
.
updateChartHistoryStatus
(
resultList
);
}
//更新消息状态为已读
sportChatHistoryBusinessMapper
.
updateChartHistoryStatus
(
param
.
getRoomKey
(),
loginUser
.
getId
());
Collections
.
reverse
(
resultList
);
return
resultList
;
}
...
...
mobile-api/src/main/resources/mapper/sport/social/SportChatHistoryBusinessMapper.xml
View file @
035431ed
...
...
@@ -16,9 +16,6 @@
<update
id=
"updateChartHistoryStatus"
>
update sport_chat_history set status = 2
where id in
<foreach
collection=
"historyList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item.id}
</foreach>
where room_key = #{roomKey} and receiver_id = #{sportUserId} and status = 1
</update>
</mapper>
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