mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-13 23:53:42 +08:00
Pre Merge pull request !872 from AprilWind/6.X-magess
This commit is contained in:
commit
63f1f95e77
@ -6,9 +6,7 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.system.domain.vo.SysMessageBoxVo;
|
||||
import org.dromara.system.service.ISysMessageService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 消息记录控制器
|
||||
@ -31,4 +29,27 @@ public class SysMessageController extends BaseController {
|
||||
public R<SysMessageBoxVo> getBox() {
|
||||
return R.ok(messageService.queryMessageBox(LoginHelper.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将指定单条消息标记为已读
|
||||
*
|
||||
* @param messageId 消息主键ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/{messageId}/read")
|
||||
public R<Void> markMessageRead(@PathVariable Long messageId) {
|
||||
return toAjax(messageService.readMessage(LoginHelper.getUserId(), messageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前用户指定分类下所有未读消息标记为已读
|
||||
*
|
||||
* @param category 消息分类标识
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/read/category/{category}")
|
||||
public R<Void> markCategoryAllRead(@PathVariable String category) {
|
||||
return toAjax(messageService.readAllMessages(LoginHelper.getUserId(), category));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,6 +21,24 @@ public interface ISysMessageService {
|
||||
*/
|
||||
SysMessageBoxVo queryMessageBox(Long userId);
|
||||
|
||||
/**
|
||||
* 将指定消息标记为已读
|
||||
*
|
||||
* @param userId 当前登录用户ID
|
||||
* @param messageId 待标记的消息主键ID
|
||||
* @return 结果
|
||||
*/
|
||||
boolean readMessage(Long userId, Long messageId);
|
||||
|
||||
/**
|
||||
* 将当前用户指定分类下所有未读消息标记为已读
|
||||
*
|
||||
* @param userId 当前登录用户ID
|
||||
* @param category 消息分类标识
|
||||
* @return 结果
|
||||
*/
|
||||
boolean readAllMessages(Long userId, String category);
|
||||
|
||||
/**
|
||||
* 发送指定用户文本消息
|
||||
*
|
||||
|
||||
@ -81,6 +81,32 @@ public class SysMessageServiceImpl implements ISysMessageService, MessageService
|
||||
return box;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将指定消息标记为已读
|
||||
*
|
||||
* @param userId 当前登录用户ID
|
||||
* @param messageId 待标记的消息主键ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean readMessage(Long userId, Long messageId) {
|
||||
// TODO 自行实现单条消息标记已读业务逻辑
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前用户指定分类下所有未读消息标记为已读
|
||||
*
|
||||
* @param userId 当前登录用户ID
|
||||
* @param category 消息分类标识
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean readAllMessages(Long userId, String category) {
|
||||
// TODO 自行实现全部消息批量标记已读业务逻辑
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送指定用户文本消息
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user