优化呼出接口

This commit is contained in:
俞扬
2023-08-14 16:06:56 +08:00
parent 634d6ec24e
commit 106975a3e6
3 changed files with 5 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ import com.cool.store.request.CallUpReq;
* @Description:
*/
public interface CallService {
void callUp(CallUpReq request) throws ApiException;
String callUp(CallUpReq request) throws ApiException;
void callFinishBack(CallFinishBackReq request) throws ApiException;
void callRecordBack(CallRecordBackReq request) throws ApiException;
}

View File

@@ -37,7 +37,7 @@ public class CallServiceImpl implements CallService {
@Autowired
private HyOutboundMobileMapper hyOutboundMobileMapper;
@Override
public void callUp(CallUpReq request) throws ApiException {
public String callUp(CallUpReq request) throws ApiException {
try {
//校验拨出手机号APP是否在线
boolean isOnline = WebSocketServer.isOnline(request.getOutgoingMobile());
@@ -70,6 +70,7 @@ public class CallServiceImpl implements CallService {
//保存通话记录
callRecordMapper.insertSelective(callRecordDO);
return transNo;
} catch (Exception e) {
log.error("callUp error, request:{}", JSON.toJSONString(request), e);
throw new ApiException(ErrorCodeEnum.CALL_UP_ERROR);

View File

@@ -33,8 +33,8 @@ public class CallController {
@PostMapping("/callUp")
@ApiOperation("呼出电话")
public ResponseResult callUp(@RequestBody CallUpReq request) throws ApiException {
callService.callUp(request);
return ResponseResult.success();
String res = callService.callUp(request);
return ResponseResult.success(res);
}
@PostMapping("/finish/callback")