Commit c52a8fc6 by Future

单人rtc查找完善

parent 42b326a2
......@@ -3,7 +3,7 @@ package com.wecloud.im.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wecloud.im.entity.ImRtcRecord;
import com.wecloud.im.param.rtc.RtcRecordParam;
import com.wecloud.im.param.rtc.SingleRtcRecordParam;
import com.wecloud.im.service.ImRtcRecordService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
......@@ -32,9 +32,9 @@ public class ImRtcRecordController extends BaseController {
@PostMapping("/listRtcRecords")
@ApiOperation(value = "分页获取后台通话记录")
public ApiResult<Page<ImRtcRecord>> listRtcRecords(@RequestBody RtcRecordParam rtcRecordParam){
log.info("获取后台通话记录入参 {}", JSON.toJSONString(rtcRecordParam));
return ApiResult.ok(rtcRecordService.getPageImRtcRecords(rtcRecordParam));
public ApiResult<Page<ImRtcRecord>> listRtcRecords(@RequestBody SingleRtcRecordParam singleRtcRecordParam){
log.info("获取后台通话记录入参 {}", JSON.toJSONString(singleRtcRecordParam));
return ApiResult.ok(rtcRecordService.getPageImRtcRecords(singleRtcRecordParam));
}
}
package com.wecloud.im.param.rtc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -10,37 +12,45 @@ import java.io.Serializable;
* @apiNote
*/
@Data
public class RtcRecordParam implements Serializable {
@ApiModel(value = "单人rtc音视频查找记录")
public class SingleRtcRecordParam implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2176804812523348248L;
/**
* 发送者id
*/
@ApiModelProperty("发送者id")
private String fromClientId;
/**
* 接受者id
*/
@ApiModelProperty("接受者id")
private String toClientId;
/**
* 房间id
*/
@ApiModelProperty("房间id")
private String channelId;
/**
* 音视频类型
* @see com.wecloud.im.sdk.enums.CallTypeEnum
*/
@ApiModelProperty("音视频类型")
private Integer callType;
/***
* 页码
*/
@ApiModelProperty("页码")
private Integer pageNum;
/**
* 每页数量
*/
@ApiModelProperty("每页数量")
private Integer pageSize;
}
......@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImRtcRecord;
import com.wecloud.im.param.rtc.CreateRtcChannelParam;
import com.wecloud.im.param.rtc.RtcRecordParam;
import com.wecloud.im.param.rtc.SingleRtcRecordParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
/**
......@@ -33,5 +33,5 @@ public interface ImRtcRecordService extends BaseService<ImRtcRecord> {
/**
* 获取通话记录
*/
Page<ImRtcRecord> getPageImRtcRecords(RtcRecordParam rtcRecordParam);
Page<ImRtcRecord> getPageImRtcRecords(SingleRtcRecordParam singleRtcRecordParam);
}
......@@ -8,7 +8,7 @@ import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImRtcRecord;
import com.wecloud.im.mapper.ImRtcRecordMapper;
import com.wecloud.im.param.rtc.CreateRtcChannelParam;
import com.wecloud.im.param.rtc.RtcRecordParam;
import com.wecloud.im.param.rtc.SingleRtcRecordParam;
import com.wecloud.im.sdk.enums.RtcStateEnum;
import com.wecloud.im.sdk.enums.SingleRtcOperateTypeEnum;
import com.wecloud.im.service.ImClientService;
......@@ -16,10 +16,10 @@ import com.wecloud.im.service.ImRtcRecordService;
import com.wecloud.utils.SnowflakeUtil;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
......@@ -32,6 +32,9 @@ import java.util.Date;
@Service
public class ImRtcRecordServiceImpl extends BaseServiceImpl<ImRtcRecordMapper, ImRtcRecord> implements ImRtcRecordService {
@Resource
private ImClientService imClientService;
@Async
@Override
......@@ -90,14 +93,16 @@ public class ImRtcRecordServiceImpl extends BaseServiceImpl<ImRtcRecordMapper, I
}
@Override
public Page<ImRtcRecord> getPageImRtcRecords(RtcRecordParam rtcRecordParam) {
public Page<ImRtcRecord> getPageImRtcRecords(SingleRtcRecordParam singleRtcRecordParam) {
ImClient imClient = imClientService.getCurrentClient();
LambdaQueryWrapper<ImRtcRecord> rtcRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
rtcRecordLambdaQueryWrapper.like(rtcRecordParam.getFromClientId()!=null,ImRtcRecord::getFromClientId,rtcRecordParam.getFromClientId());
rtcRecordLambdaQueryWrapper.like(rtcRecordParam.getToClientId()!=null,ImRtcRecord::getToClientId,rtcRecordParam.getToClientId());
rtcRecordLambdaQueryWrapper.like(rtcRecordParam.getChannelId()!=null,ImRtcRecord::getChannelId,rtcRecordParam.getChannelId());
rtcRecordLambdaQueryWrapper.eq(rtcRecordParam.getCallType()!=null,ImRtcRecord::getCallType,rtcRecordParam.getCallType());
rtcRecordLambdaQueryWrapper.eq(ImRtcRecord::getFkAppid, imClient.getFkAppid());
rtcRecordLambdaQueryWrapper.eq(singleRtcRecordParam.getFromClientId()!=null,ImRtcRecord::getFromClientId, singleRtcRecordParam.getFromClientId());
rtcRecordLambdaQueryWrapper.eq(singleRtcRecordParam.getToClientId()!=null,ImRtcRecord::getToClientId, singleRtcRecordParam.getToClientId());
rtcRecordLambdaQueryWrapper.eq(singleRtcRecordParam.getChannelId()!=null,ImRtcRecord::getChannelId, singleRtcRecordParam.getChannelId());
rtcRecordLambdaQueryWrapper.eq(singleRtcRecordParam.getCallType()!=null,ImRtcRecord::getCallType, singleRtcRecordParam.getCallType());
rtcRecordLambdaQueryWrapper.orderByDesc(ImRtcRecord::getCreateTime);
Page<ImRtcRecord> pageParam = new Page<>(rtcRecordParam.getPageNum(), rtcRecordParam.getPageSize());
Page<ImRtcRecord> pageParam = new Page<>(singleRtcRecordParam.getPageNum(), singleRtcRecordParam.getPageSize());
Page<ImRtcRecord> page = this.page(pageParam, rtcRecordLambdaQueryWrapper);
return page;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment