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
b6eafe5f
Commit
b6eafe5f
authored
Aug 16, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
聊天记录已读未读状态更新
parent
afa6efa7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
ChartHistoryStatus.java
...antai/sport/http/server/constants/ChartHistoryStatus.java
+6
-0
SportChatHistoryBusinessMapper.java
...s/sport/social/mapper/SportChatHistoryBusinessMapper.java
+2
-0
ChatService.java
...mobile/api/business/sport/social/service/ChatService.java
+5
-0
SportChatHistoryBusinessMapper.xml
...es/mapper/sport/social/SportChatHistoryBusinessMapper.xml
+8
-0
No files found.
constants/src/main/java/com/antai/sport/http/server/constants/ChartHistoryStatus.java
0 → 100644
View file @
b6eafe5f
package
com
.
antai
.
sport
.
http
.
server
.
constants
;
public
class
ChartHistoryStatus
{
public
static
final
Integer
UN_READ
=
1
;
public
static
final
Integer
READ
=
2
;
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/sport/social/mapper/SportChatHistoryBusinessMapper.java
View file @
b6eafe5f
...
@@ -10,4 +10,6 @@ public interface SportChatHistoryBusinessMapper {
...
@@ -10,4 +10,6 @@ public interface SportChatHistoryBusinessMapper {
List
<
RespChatHistory
>
getChatHistory
(
@Param
(
"param"
)
ReqChatHistoryQueryParam
param
);
List
<
RespChatHistory
>
getChatHistory
(
@Param
(
"param"
)
ReqChatHistoryQueryParam
param
);
void
updateChartHistoryStatus
(
@Param
(
"historyList"
)
List
<
RespChatHistory
>
historyList
);
}
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/sport/social/service/ChatService.java
View file @
b6eafe5f
package
com
.
antai
.
sport
.
http
.
server
.
mobile
.
api
.
business
.
sport
.
social
.
service
;
package
com
.
antai
.
sport
.
http
.
server
.
mobile
.
api
.
business
.
sport
.
social
.
service
;
import
com.antai.sport.http.server.constants.ChartHistoryStatus
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.ReqChatHistoryQueryParam
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.ReqChatHistoryQueryParam
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.ReqChatMessage
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.ReqChatMessage
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.RespChatHistory
;
import
com.antai.sport.http.server.mobile.api.business.sport.social.dto.RespChatHistory
;
...
@@ -29,6 +30,7 @@ public class ChatService {
...
@@ -29,6 +30,7 @@ public class ChatService {
history
.
setContent
(
message
.
getContent
());
history
.
setContent
(
message
.
getContent
());
history
.
setRoomKey
(
message
.
getRoomKey
());
history
.
setRoomKey
(
message
.
getRoomKey
());
history
.
setCtDate
(
LocalDateTime
.
now
());
history
.
setCtDate
(
LocalDateTime
.
now
());
history
.
setStatus
(
ChartHistoryStatus
.
UN_READ
);
sportChatHistoryMapper
.
insert
(
history
);
sportChatHistoryMapper
.
insert
(
history
);
return
history
.
getId
();
return
history
.
getId
();
}
}
...
@@ -38,6 +40,9 @@ public class ChatService {
...
@@ -38,6 +40,9 @@ public class ChatService {
param
.
setQuerySize
(
20
);
param
.
setQuerySize
(
20
);
}
}
List
<
RespChatHistory
>
resultList
=
sportChatHistoryBusinessMapper
.
getChatHistory
(
param
);
List
<
RespChatHistory
>
resultList
=
sportChatHistoryBusinessMapper
.
getChatHistory
(
param
);
if
(!
resultList
.
isEmpty
())
{
sportChatHistoryBusinessMapper
.
updateChartHistoryStatus
(
resultList
);
}
Collections
.
reverse
(
resultList
);
Collections
.
reverse
(
resultList
);
return
resultList
;
return
resultList
;
}
}
...
...
mobile-api/src/main/resources/mapper/sport/social/SportChatHistoryBusinessMapper.xml
View file @
b6eafe5f
...
@@ -13,4 +13,12 @@
...
@@ -13,4 +13,12 @@
order by t1.id desc
order by t1.id desc
limit #{param.querySize}
limit #{param.querySize}
</select>
</select>
<update
id=
"updateChartHistoryStatus"
>
update sport_chat_history set status = 2
where id in
<foreach
collection=
"historyList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item.id}
</foreach>
</update>
</mapper>
</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