<?php

namespace app\api\controller\notify;

use app\adminapi\service\WeCallService;
use app\api\controller\BaseApiController;

/**
 * 网易云商外呼任务回调接口
 * Class WeCallController
 * @package app\api\controller\notify
 */
class WeCallController extends BaseApiController
{

    public array $notNeedLogin = ['notify'];

    public function notify()
    {
        $params = $this->request->param();
        if (!empty($params['dataType']) && $params['dataType'] == 'ROBOT_TASK_STATUS_CHANGE') {
            \think\facade\Log::write("外呼回调：".json_encode($params));
            // 任务状态变更回调
            $weCallService = new WeCallService();
            $weCallService->notify($params);
        }
        
        return $this->success('success');
       
    }

}