Commit 503acccc by Future

单人rtc查找完善

parent c52a8fc6
......@@ -23,17 +23,17 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@RequestMapping("/rtcrecord")
@Api(value = "后台通话记录列表")
@RequestMapping("/rtcRecord")
@Api(value = "通话记录控制器")
public class ImRtcRecordController extends BaseController {
@Autowired
private ImRtcRecordService rtcRecordService;
@PostMapping("/listRtcRecords")
@ApiOperation(value = "分页获取后台通话记录")
public ApiResult<Page<ImRtcRecord>> listRtcRecords(@RequestBody SingleRtcRecordParam singleRtcRecordParam){
log.info("获取后台通话记录入参 {}", JSON.toJSONString(singleRtcRecordParam));
@ApiOperation(value = "分页获取通话记录")
public ApiResult<Page<ImRtcRecord>> listRtcRecords(@RequestBody SingleRtcRecordParam singleRtcRecordParam) {
log.info("分页获取通话记录入参 {}", JSON.toJSONString(singleRtcRecordParam));
return ApiResult.ok(rtcRecordService.getPageImRtcRecords(singleRtcRecordParam));
}
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author nanqianhao
......@@ -53,4 +54,11 @@ public class SingleRtcRecordParam implements Serializable {
*/
@ApiModelProperty("每页数量")
private Integer pageSize;
@ApiModelProperty("开始时间")
private Date createTimeStart;
@ApiModelProperty("结束时间")
private Date createTimeEnd;
}
......@@ -14,6 +14,7 @@ import com.wecloud.im.sdk.enums.SingleRtcOperateTypeEnum;
import com.wecloud.im.service.ImClientService;
import com.wecloud.im.service.ImRtcRecordService;
import com.wecloud.utils.SnowflakeUtil;
import io.geekidea.springbootplus.framework.common.exception.BusinessException;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
......@@ -93,16 +94,24 @@ public class ImRtcRecordServiceImpl extends BaseServiceImpl<ImRtcRecordMapper, I
}
@Override
public Page<ImRtcRecord> getPageImRtcRecords(SingleRtcRecordParam singleRtcRecordParam) {
public Page<ImRtcRecord> getPageImRtcRecords(SingleRtcRecordParam param) {
if (param.getPageNum() == null) {
throw new BusinessException("页码不可为空");
}
if (param.getPageSize() == null) {
throw new BusinessException("每页数量不可为空");
}
ImClient imClient = imClientService.getCurrentClient();
LambdaQueryWrapper<ImRtcRecord> rtcRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
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.eq(param.getFromClientId() != null, ImRtcRecord::getFromClientId, param.getFromClientId());
rtcRecordLambdaQueryWrapper.eq(param.getToClientId() != null, ImRtcRecord::getToClientId, param.getToClientId());
rtcRecordLambdaQueryWrapper.eq(param.getChannelId() != null, ImRtcRecord::getChannelId, param.getChannelId());
rtcRecordLambdaQueryWrapper.eq(param.getCallType() != null, ImRtcRecord::getCallType, param.getCallType());
rtcRecordLambdaQueryWrapper.lt(param.getCreateTimeEnd() != null, ImRtcRecord::getCreateTime, param.getCreateTimeEnd());
rtcRecordLambdaQueryWrapper.gt(param.getCreateTimeStart() != null, ImRtcRecord::getCreateTime, param.getCreateTimeStart());
rtcRecordLambdaQueryWrapper.orderByDesc(ImRtcRecord::getCreateTime);
Page<ImRtcRecord> pageParam = new Page<>(singleRtcRecordParam.getPageNum(), singleRtcRecordParam.getPageSize());
Page<ImRtcRecord> pageParam = new Page<>(param.getPageNum(), param.getPageSize());
Page<ImRtcRecord> page = this.page(pageParam, rtcRecordLambdaQueryWrapper);
return page;
}
......
......@@ -169,7 +169,7 @@ public class ResourcePathConstants {
/**
* 获取通话记录请求
*/
public static final String LIST_RTCRECORDS_REQUEST = "/api/rtcrecord/listRtcRecords";
public static final String LIST_RTC_RECORDS_REQUEST = "/api/rtcRecord/listRtcRecords";
/**
* 单次发布
......
......@@ -12,7 +12,7 @@ import com.wecloud.im.sdk.model.ImRtcRecord;
import com.wecloud.im.sdk.model.PageResult;
import com.wecloud.im.sdk.model.RtcRecordRequest;
import static com.wecloud.im.sdk.ResourcePathConstants.LIST_RTCRECORDS_REQUEST;
import static com.wecloud.im.sdk.ResourcePathConstants.LIST_RTC_RECORDS_REQUEST;
/**
* @author nanqianhao
......@@ -48,7 +48,7 @@ public class WecloudImRtcRecordOperation extends WecloudImOperation {
}
// 发送请求
RequestMessage request = new WecloudRequestMessageBuilder().setEndpoint(LIST_RTCRECORDS_REQUEST)
RequestMessage request = new WecloudRequestMessageBuilder().setEndpoint(LIST_RTC_RECORDS_REQUEST)
.setMethod(HttpMethod.POST).setParameters(param)
.setOriginalRequest(rtcRecordRequest).build();
......
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