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
ed621bf1
Commit
ed621bf1
authored
Feb 12, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化消息
parent
cf1bc6d4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
src/main/java/cn/meteor/beyondclouds/modules/message/api/MessageApi.java
+5
-3
src/main/java/cn/meteor/beyondclouds/modules/message/service/impl/MessageServiceImpl.java
+1
-8
No files found.
src/main/java/cn/meteor/beyondclouds/modules/message/api/MessageApi.java
View file @
ed621bf1
...
...
@@ -14,10 +14,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.stereotype.Controller
;
import
javax.validation.Valid
;
/**
...
...
@@ -55,7 +54,10 @@ public class MessageApi {
@ApiOperation
(
"我的消息列表"
)
@GetMapping
(
"/my/messages"
)
public
Response
<
PageVO
<
Message
>>
getMyMessages
(
@Valid
PageForm
pageForm
,
@CurrentSubject
Subject
subject
)
{
public
Response
<?>
getMyMessages
(
@Valid
PageForm
pageForm
,
BindingResult
bindingResult
,
@CurrentSubject
Subject
subject
)
{
if
(
bindingResult
.
hasErrors
())
{
return
Response
.
fieldError
(
bindingResult
.
getFieldError
());
}
// 根据用户获取列表并返回
IPage
<
Message
>
messageIPage
=
messageService
.
getMessagePage
(
pageForm
.
getPage
(),
pageForm
.
getSize
(),
(
String
)
subject
.
getId
());
PageVO
<
Message
>
messagePageVO
=
new
PageVO
<>(
messageIPage
);
...
...
src/main/java/cn/meteor/beyondclouds/modules/message/service/impl/MessageServiceImpl.java
View file @
ed621bf1
...
...
@@ -43,13 +43,6 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
update
(
updateWrapper
);
}
/**
* 获取我的消息列表
* @param pageNumber
* @param pageSize
* @param userId
* @return IPage<Message>
*/
@Override
public
IPage
<
Message
>
getMessagePage
(
Integer
pageNumber
,
Integer
pageSize
,
String
userId
)
{
...
...
@@ -66,7 +59,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
//1. 检测是否存在该消息
Message
message
=
getById
(
messageId
);
if
(
message
==
null
)
{
throw
new
MessageServiceException
(
MessageErrorCode
.
MESSAGE_NOT_EXIST
S
);
throw
new
MessageServiceException
(
MessageErrorCode
.
MESSAGE_NOT_EXIST
);
}
//2. 返回消息详情
...
...
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