package com.fs.aiSipCall;

import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author：peicj
 * @Description: 远程接口公共参数
 * @Date：2026/3/9 10:50
 */
@Slf4j
@Component
public class RemoteCommon {
    /**
     * 远程接口地址前缀
     */
    public static final String REMOTE_ADDERSS_PREFIX = "http://129.28.164.235:8899";
//    public static final String REMOTE_ADDERSS_PREFIX = "http://127.0.0.1:8899";

    /**
     * 网关列表接口
     */
    public static final String GATEWAY_LIST_API = "/aicall/api/gateway/myList";
    /**
     * 音色列表接口
     */
    public static final String VOICECODE_LIST_API = "/aicall/api/voicecode/list";
    /**
     * 大模型列表接口
     */
    public static final String LLMACOUNT_LIST_API = "/aicall/api/llmacount/list";
    /**
     * 技能组列表接口
     */
    public static final String BUSIGROUP_LIST_API = "/aicall/api/busigroup/list";
    /**
     * 查询AI外呼通话记录列表接口
     */
    public static final String CALL_RECORDS_API = "/aicall/api/call/phone/records";
    /**
     * 新增任务接口
     */
    public static final String CREATE_TASK_API = "/aicall/api/ai/createTask";
    /**
     * 修改任务接口
     */
    public static final String EDIT_TASK_API = "/aicall/api/editTask";
    /**
     * 删除任务接口
     */
    public static final String DEL_TASK_API = "/aicall/api/removeTask";
    /**
     * 启动任务接口
     */
    public static final String START_TASK_API = "/aicall/api/ai/startTask";
    /**
     * 暂停任务接口
     */
    public static final String STOP_TASK_API = "/aicall/api/ai/stopTask";
    /**
     * AI外呼追加名单接口
     */
    public static final String ADD_CALL_LIST_API = "/aicall/api/ai/addCallList";
    /**
     * 通用追加名单接口
     */
    public static final String COMMON_ADD_CALL_LIST_API = "/aicall/api/common/addCallList";
    /**
     * 查询任务统计接口
     */
    public static final String QUERY_TASK_CONNECT_SUM_API = "/aicall/api/task/connectSum";
    /**
     * 获取电话工具条的网关列表
     */
    public static final String PHONEBAR_PARAMS_API = "/aicall/api/myPhoneBar/params";

    /**
     * 新增用户并绑定分机
     */
    public static final String ADD_USER_OR_BIND_EXTNUM_API = "/aicall/api/user/addUserOrBindExtNumReturnUser";
    /**
     * 修改用户
     */
    public static final String EDIT_USER_OR_UNBING_EXTNUM_API = "/aicall/api/user/editUserOrUnBindExtNum";


    /**
     * 查询未分配的分机
     */
    public static final String QUERY_UN_BIND_EXTNUM_API = "/aicall/api/extnum/selectUnBindCcExtNumList";

    /**
     * 获取手动外呼客户沟通信息
     */
    public static final String GET_CUST_COMMUNICATION_INFO_API = "/aicall/api/getCustCommunicationInfo";
    /**
     * 新增保存手动外呼沟通记录
     */
    public static final String ADD_CUSTCALL_RECORD_API = "/aicall/api/add/custcallrecord";
    /**
     * 查询外呼记录列表
     */
    public static final String QUERY_OUTBOUNDCDR_LIST_API = "/aicall/api/outboundcdrList";
    /**
     * 根据id查询自动外呼通话记录列表接口
     */
    public static final String QUERY_CCCALLPHONE_RECORDS_BYID_API = "/aicall/api/getCcCallPhoneByIds";

    /**
     * 发送get请求
     * @param url   地址
     * @return  String  结果
     */
    public static String sendGet(String url){
        try{
            return HttpUtil.get(url, 10 * 1000);
        }catch (Exception e){
            e.printStackTrace();
            log.info("sendGet error");
        }
        return null;
    }
    /**
     * 发送post请求
     * @param url   地址
     * @return  String  结果
     */
    public static String sendPost(String url,String jsonBody){
        try{
            return HttpUtil.post(url, jsonBody);
        }catch (Exception e){
            e.printStackTrace();
            log.info("sendPost error");
        }
        return null;
    }
}
