IM 聊天记录
This commit is contained in:
@@ -43,10 +43,11 @@ public class ImCallHistoryController {
|
||||
if(req.getLimit()!=null){
|
||||
Page<ImCallHistoryEntity> objectPage = new Page<>(req.getOffset(),req.getLimit());
|
||||
QueryWrapper<ImCallHistoryEntity> query=new QueryWrapper<>();
|
||||
query.eq("invite_id",req.getUid());
|
||||
// query.eq("invite_id",req.getUid());
|
||||
query.orderByDesc("create_time");
|
||||
IPage<ImCallHistoryEntity> imCallHistoryEntityIPage=callHistoryMapper.selectPage(objectPage,query);
|
||||
|
||||
|
||||
return ResponseVO.successResponse(imCallHistoryEntityIPage);
|
||||
}else {
|
||||
return ResponseVO.errorResponse();
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.lld.im.service.message.model.req.SendMessageReq;
|
||||
import com.lld.im.service.message.model.resp.ImMessageHistoryVo;
|
||||
import com.lld.im.service.message.service.MessageSyncService;
|
||||
import com.lld.im.service.message.service.P2PMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -21,6 +22,7 @@ import java.util.List;
|
||||
* @author: lld
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("v1/message")
|
||||
public class MessageController {
|
||||
@@ -73,6 +75,9 @@ public class MessageController {
|
||||
@RequestMapping("/chatHistory")
|
||||
public ResponseVO chatHistory(@RequestBody
|
||||
@Validated ChatHistoryReq chatHistoryReq, Integer appId) {
|
||||
|
||||
|
||||
|
||||
chatHistoryReq.setAppId(appId);
|
||||
List<ImMessageHistoryVo> imMessageHistoryVos = messageSyncService.chatHistory(chatHistoryReq);
|
||||
return ResponseVO.successResponse(imMessageHistoryVos);
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.util.Objects;
|
||||
* @author: lld
|
||||
* @version: 1.0
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class ChatOperateReceiver {
|
||||
|
||||
|
||||
@@ -179,6 +179,9 @@ public class MessageSyncService {
|
||||
.orderByDesc(ImMessageHistoryEntity::getMessageKey);
|
||||
Page<ImMessageHistoryEntity> imMessageHistoryEntities = imMessageHistoryMapper.selectPage(objectPage,and);
|
||||
List<Long> messageKeys = imMessageHistoryEntities.getRecords().stream().map(x -> x.getMessageKey()).collect(Collectors.toList());
|
||||
if (messageKeys.size() == 0) {
|
||||
return new ArrayList<ImMessageHistoryVo>();
|
||||
}
|
||||
List<ImMessageBodyEntity> imMessageBodyEntities = imMessageBodyMapper.selectList(new LambdaQueryWrapper<ImMessageBodyEntity>().in(ImMessageBodyEntity::getMessageKey, messageKeys));
|
||||
Map<Long, ImMessageBodyEntity> collect = imMessageBodyEntities.stream().collect(Collectors.toMap(ImMessageBodyEntity::getMessageKey, x -> x));
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ public class SRSStreamTask {
|
||||
@Scheduled(cron="0/5 * * * * ? ")
|
||||
public void executeTask(){
|
||||
String ip = System.getenv("SRS_HOST");
|
||||
|
||||
log.error("213132");
|
||||
log.info("========定时任务");
|
||||
//
|
||||
// log.error("213132");
|
||||
// log.info("========定时任务");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
|
||||
Reference in New Issue
Block a user