|
@@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.system.controller.admin.notify;
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageRespVO;
|
|
|
-import cn.iocoder.yudao.module.system.convert.notify.NotifyMessageConvert;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO;
|
|
|
import cn.iocoder.yudao.module.system.service.notify.NotifyMessageService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
@@ -39,8 +39,8 @@ public class NotifyMessageController {
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('system:notify-message:query')")
|
|
|
public CommonResult<NotifyMessageRespVO> getNotifyMessage(@RequestParam("id") Long id) {
|
|
|
- NotifyMessageDO notifyMessage = notifyMessageService.getNotifyMessage(id);
|
|
|
- return success(NotifyMessageConvert.INSTANCE.convert(notifyMessage));
|
|
|
+ NotifyMessageDO message = notifyMessageService.getNotifyMessage(id);
|
|
|
+ return success(BeanUtils.toBean(message, NotifyMessageRespVO.class));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page")
|
|
@@ -48,7 +48,7 @@ public class NotifyMessageController {
|
|
|
@PreAuthorize("@ss.hasPermission('system:notify-message:query')")
|
|
|
public CommonResult<PageResult<NotifyMessageRespVO>> getNotifyMessagePage(@Valid NotifyMessagePageReqVO pageVO) {
|
|
|
PageResult<NotifyMessageDO> pageResult = notifyMessageService.getNotifyMessagePage(pageVO);
|
|
|
- return success(NotifyMessageConvert.INSTANCE.convertPage(pageResult));
|
|
|
+ return success(BeanUtils.toBean(pageResult, NotifyMessageRespVO.class));
|
|
|
}
|
|
|
|
|
|
// ========== 查看自己的站内信 ==========
|
|
@@ -58,7 +58,7 @@ public class NotifyMessageController {
|
|
|
public CommonResult<PageResult<NotifyMessageRespVO>> getMyMyNotifyMessagePage(@Valid NotifyMessageMyPageReqVO pageVO) {
|
|
|
PageResult<NotifyMessageDO> pageResult = notifyMessageService.getMyMyNotifyMessagePage(pageVO,
|
|
|
getLoginUserId(), UserTypeEnum.ADMIN.getValue());
|
|
|
- return success(NotifyMessageConvert.INSTANCE.convertPage(pageResult));
|
|
|
+ return success(BeanUtils.toBean(pageResult, NotifyMessageRespVO.class));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update-read")
|
|
@@ -83,13 +83,14 @@ public class NotifyMessageController {
|
|
|
@RequestParam(name = "size", defaultValue = "10") Integer size) {
|
|
|
List<NotifyMessageDO> list = notifyMessageService.getUnreadNotifyMessageList(
|
|
|
getLoginUserId(), UserTypeEnum.ADMIN.getValue(), size);
|
|
|
- return success(NotifyMessageConvert.INSTANCE.convertList(list));
|
|
|
+ return success(BeanUtils.toBean(list, NotifyMessageRespVO.class));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get-unread-count")
|
|
|
@Operation(summary = "获得当前用户的未读站内信数量")
|
|
|
public CommonResult<Long> getUnreadNotifyMessageCount() {
|
|
|
- return success(notifyMessageService.getUnreadNotifyMessageCount(getLoginUserId(), UserTypeEnum.ADMIN.getValue()));
|
|
|
+ return success(notifyMessageService.getUnreadNotifyMessageCount(
|
|
|
+ getLoginUserId(), UserTypeEnum.ADMIN.getValue()));
|
|
|
}
|
|
|
|
|
|
}
|