package com.ruoyi.web.controller.smartor.AIRobot; 
 | 
  
 | 
import com.ruoyi.common.core.controller.BaseController; 
 | 
import com.ruoyi.common.core.domain.AjaxResult; 
 | 
import com.smartor.domain.robot.back.RobotAIDialogBack; 
 | 
import com.smartor.domain.robot.back.RobotCallBack; 
 | 
import com.smartor.domain.robot.back.RobotcdrInfoBack; 
 | 
import com.smartor.service.AIRobotPhoneCallBackService; 
 | 
import io.swagger.annotations.Api; 
 | 
import io.swagger.annotations.ApiOperation; 
 | 
import lombok.extern.slf4j.Slf4j; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
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.RestController; 
 | 
  
 | 
/** 
 | 
 * 单一任务(随访)Controller 
 | 
 * 
 | 
 * @author ruoyi 
 | 
 * @date 2024-02-02 
 | 
 */ 
 | 
@Slf4j 
 | 
@Api(description = "AIRobot回调") 
 | 
@RestController 
 | 
@RequestMapping("/smartor/robot") 
 | 
public class AIRobotPhoneCallBackController extends BaseController { 
 | 
    @Autowired 
 | 
    private AIRobotPhoneCallBackService aiRobotPhoneCallBackService; 
 | 
  
 | 
    /** 
 | 
     * AIRobot呼叫到达线路后的状态返回接口 
 | 
     */ 
 | 
    @ApiOperation("AIRobot呼叫到达线路后的状态返回接口") 
 | 
    @PostMapping("/callstatus") 
 | 
    public AjaxResult callstatus(@RequestBody RobotCallBack robotCallBack) { 
 | 
        log.info("AIRobot呼叫到达线路后的状态返回接口---------{}", robotCallBack); 
 | 
        aiRobotPhoneCallBackService.callstatus(robotCallBack); 
 | 
        return success(); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 用户 AI 交互数据返回接口(包括 n 种节点的返回数据包) 
 | 
     */ 
 | 
    @ApiOperation("AIRobot用户 AI 交互数据返回接口(包括 n 种节点的返回数据包)") 
 | 
    @PostMapping("/aidialog") 
 | 
    public AjaxResult aidialog(@RequestBody RobotAIDialogBack robotAIDialogBack) { 
 | 
        log.info("用户 AI 交互数据返回接口(包括 n 种节点的返回数据包)-----------{}", robotAIDialogBack); 
 | 
        aiRobotPhoneCallBackService.aidialog(robotAIDialogBack); 
 | 
        return success(); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 挂机计费信息返回数据接口 
 | 
     */ 
 | 
    @ApiOperation("挂机计费信息返回数据接口") 
 | 
    @PostMapping("/cdrinfo") 
 | 
    public AjaxResult cdrinfo(@RequestBody RobotcdrInfoBack robotAIDialogBack) { 
 | 
        log.info("挂机计费信息返回数据接口-----------{}", robotAIDialogBack); 
 | 
        aiRobotPhoneCallBackService.cdrinfo(robotAIDialogBack); 
 | 
        return success(); 
 | 
    } 
 | 
// 
 | 
//    /** 
 | 
//     * 外呼发起请求接口(模板数据或加密模板文件路径)测试用的 
 | 
//     */ 
 | 
//    @PostMapping("/outbound") 
 | 
//    public AjaxResult outbound(RobotScritpTemplateVO robotScritpTemplateVO) { 
 | 
//        RobotPhoneUtils robotPhoneUtils = new RobotPhoneUtils(); 
 | 
//        robotPhoneUtils.outbound(new RobotScritpTemplateVO()); 
 | 
//        return success(); 
 | 
//    } 
 | 
} 
 |