mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-18 00:43:42 +08:00
fix:
1.翻页条数限制失败bug 2.消息标记的事务方法重写失效问题
This commit is contained in:
@@ -44,13 +44,13 @@ public class ChatController {
|
||||
|
||||
@GetMapping("/public/room/page")
|
||||
@ApiOperation("会话列表")
|
||||
public ApiResult<CursorPageBaseResp<ChatRoomResp>> getRoomPage(CursorPageBaseReq request) {
|
||||
public ApiResult<CursorPageBaseResp<ChatRoomResp>> getRoomPage(@Valid CursorPageBaseReq request) {
|
||||
return ApiResult.success(chatService.getRoomPage(request, RequestHolder.get().getUid()));
|
||||
}
|
||||
|
||||
@GetMapping("/public/member/page")
|
||||
@ApiOperation("群成员列表")
|
||||
public ApiResult<CursorPageBaseResp<ChatMemberResp>> getMemberPage(CursorPageBaseReq request) {
|
||||
public ApiResult<CursorPageBaseResp<ChatMemberResp>> getMemberPage(@Valid CursorPageBaseReq request) {
|
||||
CursorPageBaseResp<ChatMemberResp> memberPage = chatService.getMemberPage(request);
|
||||
filterBlackMember(memberPage);
|
||||
return ApiResult.success(memberPage);
|
||||
@@ -72,7 +72,7 @@ public class ChatController {
|
||||
|
||||
@GetMapping("/public/msg/page")
|
||||
@ApiOperation("消息列表")
|
||||
public ApiResult<CursorPageBaseResp<ChatMessageResp>> getMsgPage(ChatMessagePageReq request) {
|
||||
public ApiResult<CursorPageBaseResp<ChatMessageResp>> getMsgPage(@Valid ChatMessagePageReq request) {
|
||||
CursorPageBaseResp<ChatMessageResp> msgPage = chatService.getMsgPage(request, RequestHolder.get().getUid());
|
||||
filterBlackMsg(msgPage);
|
||||
return ApiResult.success(msgPage);
|
||||
|
||||
@@ -31,12 +31,12 @@ public abstract class AbstractMsgMarkStrategy {
|
||||
|
||||
@Transactional
|
||||
public void mark(Long uid, Long msgId) {
|
||||
exec(uid, msgId, MessageMarkActTypeEnum.MARK);
|
||||
doMark(uid, msgId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void unMark(Long uid, Long msgId) {
|
||||
exec(uid, msgId, MessageMarkActTypeEnum.UN_MARK);
|
||||
doUnMark(uid, msgId);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@@ -44,6 +44,14 @@ public abstract class AbstractMsgMarkStrategy {
|
||||
MsgMarkFactory.register(getTypeEnum().getType(), this);
|
||||
}
|
||||
|
||||
protected void doMark(Long uid, Long msgId) {
|
||||
exec(uid, msgId, MessageMarkActTypeEnum.MARK);
|
||||
}
|
||||
|
||||
protected void doUnMark(Long uid, Long msgId) {
|
||||
exec(uid, msgId, MessageMarkActTypeEnum.UN_MARK);
|
||||
}
|
||||
|
||||
protected void exec(Long uid, Long msgId, MessageMarkActTypeEnum actTypeEnum) {
|
||||
Integer markType = getTypeEnum().getType();
|
||||
Integer actType = actTypeEnum.getType();
|
||||
|
||||
@@ -22,7 +22,7 @@ public class DisLikeStrategy extends AbstractMsgMarkStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mark(Long uid, Long msgId) {
|
||||
public void doMark(Long uid, Long msgId) {
|
||||
super.mark(uid, msgId);
|
||||
//同时取消点赞的动作
|
||||
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.LIKE.getType()).unMark(uid, msgId);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class LikeStrategy extends AbstractMsgMarkStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mark(Long uid, Long msgId) {
|
||||
public void doMark(Long uid, Long msgId) {
|
||||
super.mark(uid, msgId);
|
||||
//同时取消点踩的动作
|
||||
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.DISLIKE.getType()).unMark(uid, msgId);
|
||||
|
||||
Reference in New Issue
Block a user