Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
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
段启岩
beyond-clouds
Commits
99c88ec9
Commit
99c88ec9
authored
Feb 12, 2020
by
张晋雄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将所有消息标记为已读
parent
be797c0c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
src/main/java/cn/meteor/beyondclouds/modules/message/api/MessageApi.java
+8
-0
src/main/java/cn/meteor/beyondclouds/modules/message/service/IMessageService.java
+7
-0
src/main/java/cn/meteor/beyondclouds/modules/message/service/impl/MessageServiceImpl.java
+8
-0
No files found.
src/main/java/cn/meteor/beyondclouds/modules/message/api/MessageApi.java
View file @
99c88ec9
...
...
@@ -40,6 +40,14 @@ public class MessageApi {
return
Response
.
success
();
}
@ApiOperation
(
"标记所有信息为已读"
)
@PutMapping
(
"/messages/read"
)
public
Response
readMessages
(
@CurrentSubject
Subject
subject
){
messageService
.
readMessages
(
String
.
valueOf
(
subject
.
getId
()));
return
Response
.
success
();
}
}
src/main/java/cn/meteor/beyondclouds/modules/message/service/IMessageService.java
View file @
99c88ec9
...
...
@@ -4,6 +4,8 @@ import cn.meteor.beyondclouds.core.exception.ServiceException;
import
cn.meteor.beyondclouds.modules.message.entity.Message
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.io.Serializable
;
/**
* <p>
* 服务类
...
...
@@ -20,4 +22,9 @@ public interface IMessageService extends IService<Message> {
*/
void
readMessage
(
String
messageId
)
throws
ServiceException
;
/**
* 将所有消息标记为已读
* @param userId
*/
void
readMessages
(
String
userId
);
}
src/main/java/cn/meteor/beyondclouds/modules/message/service/impl/MessageServiceImpl.java
View file @
99c88ec9
...
...
@@ -31,4 +31,12 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
updateById
(
message
);
}
@Override
public
void
readMessages
(
String
userId
)
{
UpdateWrapper
updateWrapper
=
new
UpdateWrapper
();
updateWrapper
.
eq
(
"user_id"
,
userId
);
updateWrapper
.
set
(
"status"
,
1
);
update
(
updateWrapper
);
}
}
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