Sfoglia il codice sorgente

坐席sdk接口开发,fix

刘威 4 mesi fa
parent
commit
647e6fe250

+ 1 - 1
src/core/callcenter/acd.py

@@ -7,7 +7,7 @@ from typing import Dict, Any, Optional
 import src.core.callcenter.cache as Cache
 from src.core.callcenter.agent import AgentService
 from src.core.callcenter.call import CallService
-from src.core.callcenter.model import CallInfo, AgentActionRequest
+from src.core.callcenter.api import CallInfo, AgentActionRequest
 from apscheduler.schedulers.background import BackgroundScheduler
 from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED, FIRST_COMPLETED
 

+ 1 - 1
src/core/callcenter/agent.py

@@ -6,7 +6,7 @@ from src.core.callcenter.enumeration import AgentState, AgentCheck, AgentHeartSt
 from sqlalchemy import or_
 from src.core.callcenter.dao import *
 from src.core.callcenter.exception import BizException
-from src.core.callcenter.model import AgentActionRequest, AgentInfo, AgentQueryRequest, AgentRequest, AgentEventData, \
+from src.core.callcenter.api import AgentActionRequest, AgentInfo, AgentQueryRequest, AgentRequest, AgentEventData, \
     AgentStateData, HumanServiceQueryRequest, AgentMonitorData
 from src.core.callcenter.push import PushHandler
 from src.core.datasource import RedisHandler

+ 0 - 72
src/core/callcenter/model.py → src/core/callcenter/api.py

@@ -120,78 +120,6 @@ class HumanServiceQueryRequest:
         return cls(**data)
 
 
-class Agent:
-    def __init__(self, saas_id, agent_number, agent_name, out_id, agent_password, agent_type, phone_number, distribute,
-                 agent_state, identity_type):
-        self.id = None
-        # 租户隔离
-        self.saas_id = saas_id
-        # 坐席工号, 生成返回
-        self.agent_number = agent_number
-        # 坐席名称
-        self.agent_name = agent_name
-        # 外部展示Id
-        self.out_id = out_id
-        # 坐席密码
-        self.agent_password = agent_password
-        # 坐席类型 0:普通坐席 ;1:组长:2:主管
-        self.agent_type = agent_type
-        # 分机号
-        self.phone_number = phone_number
-        # 分配标志  0:不参与排队;1:参与排队
-        self.distribute = distribute
-        # 账号状态 0:可用;1:禁用
-        self.agent_state = agent_state
-        # 身份状态
-        self.identity_type = identity_type
-
-
-class AgentMonitor:
-    def __init__(self, id=None, saas_id=None, agent_num=None, out_id=None,
-                 check_state=1, check_scene=None, check_in_time =None,
-                 check_out_time=None, service_state=0, busy_time=None,
-                 idle_time=None, call_time=None, hang_time=None,
-                 heart_state=None, heart_time=None, session_id = None,
-                 is_delete=0, update_time=None, create_time=None):
-        self.id = id
-        # 租户隔离
-        self.saas_id = saas_id
-        # 坐席工号
-        self.agent_num = agent_num
-        # 使用方id
-        self.out_id = out_id
-        # 是否签入 0:是 1: 否  默认未签入
-        self.check_state = check_state
-        # 迁入时scene
-        self.check_scene = check_scene
-        # 签入时间
-        self.check_in_time = check_in_time
-        # 签出时间
-        self.check_out_time = check_out_time
-        # 坐席服务状态 0:签出 1:忙碌 2:空闲
-        self.service_state = service_state
-        # 置忙时间
-        self.busy_time = busy_time
-        # 置闲时间
-        self.idle_time = idle_time
-        # 拨通时间
-        self.call_time = call_time
-        # 挂断时间
-        self.hang_time = hang_time
-        # 心跳状态
-        self.heart_state = heart_state
-        # 上次正常心跳时间
-        self.heart_time = heart_time
-        #
-        self.session_id = session_id
-        # 删除标识
-        self.is_delete = is_delete
-        # 更新时间
-        self.update_time = update_time
-        # 创建时间
-        self.create_time = create_time
-
-
 class AgentMonitorData:
     """坐席状态信息"""
     def __init__(self, saas_id=None, agent_num=None, agent_name=None, out_id=None,

+ 1 - 1
src/core/callcenter/cache.py

@@ -4,7 +4,7 @@
 import json
 
 from src.core.callcenter.constant import *
-from src.core.callcenter.model import AgentInfo, CallInfo, RouteGateway
+from src.core.callcenter.api import AgentInfo, CallInfo, RouteGateway
 from src.core.datasource import RedisHandler
 
 cacheDay = 7

+ 1 - 1
src/core/callcenter/call.py

@@ -6,7 +6,7 @@ import time
 import src.core.callcenter.cache as Cache
 from src.core.callcenter.constant import saasId, HOLD_MUSIC_PATH
 from src.core.callcenter.enumeration import CallCause, Direction, NextType, DeviceType, CdrType
-from src.core.callcenter.model import MakeCallRequest, AgentInfo, CallInfo, HangupCallRequest, CheckInCallRequest, \
+from src.core.callcenter.api import MakeCallRequest, AgentInfo, CallInfo, HangupCallRequest, CheckInCallRequest, \
     DeviceInfo, NextCommand
 from src.core.callcenter.snowflake import Snowflake
 

+ 1 - 1
src/core/callcenter/constant.py

@@ -2,7 +2,7 @@
 # encoding:utf-8
 
 import json
-from src.core.callcenter.model import CallInfo
+from src.core.callcenter.api import CallInfo
 
 saasId = "mdj"
 

+ 1 - 1
src/core/callcenter/esl/handler/channel_answer_handler.py

@@ -9,7 +9,7 @@ from src.core.callcenter.esl.annotation import EslEventName
 import src.core.callcenter.esl.utils.esl_event_util as EslEventUtil
 from src.core.callcenter.esl.constant.event_names import CHANNEL_ANSWER
 from src.core.callcenter.esl.handler.esl_event_handler import EslEventHandler
-from src.core.callcenter.model import CallInfo, DeviceInfo, NextCommand
+from src.core.callcenter.api import CallInfo, DeviceInfo, NextCommand
 
 
 @EslEventName(CHANNEL_ANSWER)

+ 1 - 1
src/core/callcenter/esl/handler/channel_hangup_handler.py

@@ -11,7 +11,7 @@ from src.core.callcenter.esl.annotation import EslEventName
 import src.core.callcenter.esl.utils.esl_event_util as EslEventUtil
 from src.core.callcenter.esl.constant.event_names import CHANNEL_HANGUP
 from src.core.callcenter.esl.handler.esl_event_handler import EslEventHandler
-from src.core.callcenter.model import CallInfo, DeviceInfo, NextCommand
+from src.core.callcenter.api import CallInfo, DeviceInfo, NextCommand
 
 
 @EslEventName(CHANNEL_HANGUP)

+ 1 - 1
src/core/callcenter/web.py

@@ -14,7 +14,7 @@ from src.core.callcenter.esl.client import InboundClient, OutboundClient
 from flask import Flask, request, render_template_string
 
 from src.core.callcenter.call import CallService
-from src.core.callcenter.model import MakeCallRequest, AgentInfo, AgentActionRequest, HangupCallRequest, \
+from src.core.callcenter.api import MakeCallRequest, AgentInfo, AgentActionRequest, HangupCallRequest, \
     HumanServiceQueryRequest
 from src.core.voip.bot import BotAgent
 

+ 1 - 1
src/core/voip/bot.py

@@ -13,7 +13,7 @@ from enum import Enum
 from src.core.voip.constant import *
 
 import requests
-from src.core.callcenter.model import BotChatRequest, ChatResponse,ChatMessage
+from src.core.callcenter.api import BotChatRequest, ChatResponse,ChatMessage
 
 
 calls = {}