|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xy.dto.MsgUserMessageDto;
|
|
|
import com.xy.entity.MsgSysMonitorNotice;
|
|
|
import com.xy.entity.MsgUserMessage;
|
|
|
+import com.xy.enums.MsgReadStatus;
|
|
|
import com.xy.mapper.MsgUserMessageMapper;
|
|
|
import com.xy.utils.*;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -20,6 +21,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.xy.utils.Beans.copy;
|
|
|
import static com.xy.utils.PlusBeans.toIPage;
|
|
|
import static com.xy.utils.PlusBeans.toPageBean;
|
|
|
|
|
@@ -39,6 +41,26 @@ public class MsgUserMessageServiceImpl extends ServiceImpl<MsgUserMessageMapper,
|
|
|
|
|
|
private MsgSysMonitorNoticeServiceImpl msgSysMonitorNoticeService;
|
|
|
|
|
|
+ @Override
|
|
|
+ @ApiOperation("消息详情")
|
|
|
+ public R<MsgUserMessageDto.Vo> obj(MsgUserMessageDto.Vo vo) {
|
|
|
+ MsgUserMessageDto.SelectList selectList = copy(MsgUserMessageDto.SelectList.class, vo);
|
|
|
+ List<MsgUserMessageDto.Vo> list = list(selectList).getData();
|
|
|
+ if (Emptys.check(list)) {
|
|
|
+ MsgUserMessageDto.Vo myMsg = list.get(0);
|
|
|
+ //更新已读
|
|
|
+ this.updateById(new MsgUserMessage().setId(myMsg.getId()).setReadState(MsgReadStatus.READ.getCode().toString()));
|
|
|
+ return R.ok(myMsg);
|
|
|
+ }
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ public R<List<MsgUserMessageDto.Vo>> list(MsgUserMessageDto.SelectList selectList) {
|
|
|
+ LambdaQueryWrapper<MsgUserMessage> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(selectList, MsgUserMessage.class).build();
|
|
|
+ List<MsgUserMessage> list = list(lambdaQueryWrapper);
|
|
|
+ return R.ok(copy(MsgUserMessageDto.Vo.class, list));
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("我的消息")
|
|
|
@Override
|
|
|
public R<PageBean<MsgUserMessageDto.PageVO>> myMsgPage(MsgUserMessageDto.Page page) {
|