|
@@ -1,12 +1,16 @@
|
|
|
package com.nb.im.controller;
|
|
package com.nb.im.controller;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.nb.core.result.R;
|
|
import com.nb.core.result.R;
|
|
|
-import com.nb.im.service.LocalImMsgReadService;
|
|
|
|
|
|
|
+import com.nb.im.entity.ImMsgEntity;
|
|
|
import com.nb.im.service.LocalImMsgService;
|
|
import com.nb.im.service.LocalImMsgService;
|
|
|
|
|
+import com.nb.im.service.dto.ImRoomMsgQuery;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
/**
|
|
/**
|
|
@@ -20,23 +24,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("/im/msg")
|
|
@RequestMapping("/im/msg")
|
|
|
@Api(tags = "聊天室消息")
|
|
@Api(tags = "聊天室消息")
|
|
|
-public class ImRooMsgController {
|
|
|
|
|
|
|
+public class ImRoomMsgController {
|
|
|
private final LocalImMsgService chatRoomMsgService;
|
|
private final LocalImMsgService chatRoomMsgService;
|
|
|
- private final LocalImMsgReadService msgReadService;
|
|
|
|
|
-
|
|
|
|
|
- @PostMapping("/offline/no_page")
|
|
|
|
|
- @ApiOperation("读取离线消息")
|
|
|
|
|
- public R offlineMsg(){
|
|
|
|
|
- //todo
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- @PostMapping("")
|
|
|
|
|
- @ApiOperation("获取漫游消息")
|
|
|
|
|
- public R list(){
|
|
|
|
|
- return R.success();
|
|
|
|
|
|
|
+ @PostMapping("/roam")
|
|
|
|
|
+ @ApiOperation("获取漫游消息(默认获取最新500条数据)")
|
|
|
|
|
+ public R list(@RequestBody@Validated ImRoomMsgQuery query){
|
|
|
|
|
+ return R.success(chatRoomMsgService.list(new QueryWrapper<ImMsgEntity>()
|
|
|
|
|
+ .lambda()
|
|
|
|
|
+ .eq(ImMsgEntity::getRoomId,query.getRoomId())));
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+}
|