|
@@ -28,6 +28,7 @@ class Agent(db.Model):
|
|
is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
|
|
is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
|
|
update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
|
|
update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
|
|
create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
|
|
create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
|
|
|
|
+ user_id= db.Column(db.BigInteger, nullable=False, default='', comment='用户id')
|
|
|
|
|
|
__table_args__ = (
|
|
__table_args__ = (
|
|
db.UniqueConstraint('saas_id', 'agent_num', name='uniq_vcc_id_agent_num'),
|
|
db.UniqueConstraint('saas_id', 'agent_num', name='uniq_vcc_id_agent_num'),
|
|
@@ -54,6 +55,7 @@ class Agent(db.Model):
|
|
'is_delete': self.is_delete,
|
|
'is_delete': self.is_delete,
|
|
'update_time': self.update_time.isoformat() if self.update_time else None,
|
|
'update_time': self.update_time.isoformat() if self.update_time else None,
|
|
'create_time': self.create_time.isoformat() if self.create_time else None,
|
|
'create_time': self.create_time.isoformat() if self.create_time else None,
|
|
|
|
+ 'user_id': self.user_id
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -375,7 +377,7 @@ class Whitelist(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键')
|
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键')
|
|
phone = db.Column(db.String(20), nullable=False, comment='电话号码')
|
|
phone = db.Column(db.String(20), nullable=False, comment='电话号码')
|
|
description = db.Column(db.String(255), nullable=True, comment='描述说明(备注)')
|
|
description = db.Column(db.String(255), nullable=True, comment='描述说明(备注)')
|
|
- del_flag = db.Column(db.Boolean, nullable=False, default=False, comment='删除标志(0代表存在 2代表删除)')
|
|
|
|
|
|
+ del_flag = db.Column(db.SmallInteger, nullable=False, default=False, comment='删除标志(0代表存在 2代表删除)')
|
|
revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
|
|
revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
|
|
create_by = db.Column(db.String(32), nullable=True, comment='创建人')
|
|
create_by = db.Column(db.String(32), nullable=True, comment='创建人')
|
|
create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
|
|
create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
|
|
@@ -404,10 +406,10 @@ class CallRecord(db.Model):
|
|
|
|
|
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键')
|
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键')
|
|
session_id = db.Column(db.String(30), nullable=True, comment='sessionId')
|
|
session_id = db.Column(db.String(30), nullable=True, comment='sessionId')
|
|
- type = db.Column(db.SmallInteger, nullable=True, comment='呼入分类(0白名单 1AI服务 2传统服务)')
|
|
|
|
|
|
+ type = db.Column(db.SmallInteger, nullable=True,comment='呼入分类(0白名单 1AI服务 2传统服务)')
|
|
user_id = db.Column(db.BigInteger, nullable=True, comment='客服ID')
|
|
user_id = db.Column(db.BigInteger, nullable=True, comment='客服ID')
|
|
user_name = db.Column(db.String(255), nullable=True, comment='客服名字')
|
|
user_name = db.Column(db.String(255), nullable=True, comment='客服名字')
|
|
- service_category = db.Column(db.SmallInteger, nullable=False, comment='服务类型(0人工坐席 1机器人坐席 2机器人转人工)')
|
|
|
|
|
|
+ service_category = db.Column(db.SmallInteger, nullable=False,default=0, comment='服务类型(0人工坐席 1机器人坐席 2机器人转人工)')
|
|
time_begin = db.Column(db.DateTime, nullable=True, comment='通话发起时间')
|
|
time_begin = db.Column(db.DateTime, nullable=True, comment='通话发起时间')
|
|
time_end = db.Column(db.DateTime, nullable=True, comment='通话结束时间')
|
|
time_end = db.Column(db.DateTime, nullable=True, comment='通话结束时间')
|
|
times = db.Column(db.String(30), nullable=True, comment='通话时长(暂时按字符串接收)')
|
|
times = db.Column(db.String(30), nullable=True, comment='通话时长(暂时按字符串接收)')
|
|
@@ -417,15 +419,18 @@ class CallRecord(db.Model):
|
|
bussiness_type = db.Column(db.String(50), nullable=True, comment='业务类型(创个返回字符串)')
|
|
bussiness_type = db.Column(db.String(50), nullable=True, comment='业务类型(创个返回字符串)')
|
|
url = db.Column(db.String(255), nullable=True, comment='录音的地址')
|
|
url = db.Column(db.String(255), nullable=True, comment='录音的地址')
|
|
remark = db.Column(db.String(500), nullable=True, comment='备注')
|
|
remark = db.Column(db.String(500), nullable=True, comment='备注')
|
|
- has_parsed = db.Column(db.Boolean, nullable=False, default=False, comment='是否已转录音(0否 1是)')
|
|
|
|
|
|
+ has_parsed = db.Column(db.SmallInteger, nullable=False, default=0, comment='是否已转录音(0否 1是)')
|
|
parsed_voice_content = db.Column(db.Text, nullable=True, comment='通话录音内容')
|
|
parsed_voice_content = db.Column(db.Text, nullable=True, comment='通话录音内容')
|
|
- del_flag = db.Column(db.Boolean, nullable=False, default=False, comment='删除标志(0代表存在 2代表删除)')
|
|
|
|
|
|
+ del_flag = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标志(0代表存在 2代表删除)')
|
|
revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
|
|
revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
|
|
create_by = db.Column(db.String(32), nullable=True, default="admin", comment='创建人')
|
|
create_by = db.Column(db.String(32), nullable=True, default="admin", comment='创建人')
|
|
create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
|
|
create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
|
|
update_by = db.Column(db.String(32), nullable=True, default="admin", comment='更新人')
|
|
update_by = db.Column(db.String(32), nullable=True, default="admin", comment='更新人')
|
|
update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.utcnow, comment='更新时间')
|
|
update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.utcnow, comment='更新时间')
|
|
|
|
|
|
|
|
+ def __repr__(self):
|
|
|
|
+ return json.dumps(self.to_dict())
|
|
|
|
+
|
|
def to_dict(self):
|
|
def to_dict(self):
|
|
return {
|
|
return {
|
|
'id': self.id,
|
|
'id': self.id,
|