123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- // Code generated by ent, DO NOT EDIT.
- package migrate
- import (
- "entgo.io/ent/dialect/entsql"
- "entgo.io/ent/dialect/sql/schema"
- "entgo.io/ent/schema/field"
- )
- var (
- // AgentColumns holds the columns for the "agent" table.
- AgentColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
- {Name: "role", Type: field.TypeString, Size: 1000, Comment: "role | 角色设定"},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- {Name: "background", Type: field.TypeString, Nullable: true, Size: 1000, Comment: "background | 背景介绍", Default: ""},
- {Name: "examples", Type: field.TypeString, Nullable: true, Size: 5000, Comment: "examples | 对话案例", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- {Name: "dataset_id", Type: field.TypeString, Size: 255, Comment: "dataset_id | 知识库ID"},
- {Name: "collection_id", Type: field.TypeString, Size: 255, Comment: "collection_id | 集合ID"},
- }
- // AgentTable holds the schema information for the "agent" table.
- AgentTable = &schema.Table{
- Name: "agent",
- Columns: AgentColumns,
- PrimaryKey: []*schema.Column{AgentColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "agent_organization_id",
- Unique: false,
- Columns: []*schema.Column{AgentColumns[9]},
- },
- },
- }
- // BatchMsgColumns holds the columns for the "batch_msg" table.
- BatchMsgColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "状态 0 未开始 1 开始发送 2 发送完成 3 发送中止"},
- {Name: "batch_no", Type: field.TypeString, Unique: true, Nullable: true, Comment: "批次号"},
- {Name: "task_name", Type: field.TypeString, Nullable: true, Comment: "任务名称", Default: ""},
- {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
- {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "内容"},
- {Name: "tag", Type: field.TypeString, Nullable: true, Comment: "发送规则 all 全部 tag1,tag2 按tag发送"},
- {Name: "total", Type: field.TypeInt32, Nullable: true, Comment: "总数"},
- {Name: "success", Type: field.TypeInt32, Nullable: true, Comment: "成功数量"},
- {Name: "fail", Type: field.TypeInt32, Nullable: true, Comment: "失败数量"},
- {Name: "start_time", Type: field.TypeTime, Nullable: true, Comment: "开始时间"},
- {Name: "stop_time", Type: field.TypeTime, Nullable: true, Comment: "结束时间"},
- {Name: "type", Type: field.TypeInt32, Nullable: true, Comment: "发送类型 1-群发消息 2-群发朋友圈"},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- }
- // BatchMsgTable holds the schema information for the "batch_msg" table.
- BatchMsgTable = &schema.Table{
- Name: "batch_msg",
- Columns: BatchMsgColumns,
- PrimaryKey: []*schema.Column{BatchMsgColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "batchmsg_batch_no",
- Unique: true,
- Columns: []*schema.Column{BatchMsgColumns[5]},
- },
- {
- Name: "batchmsg_type",
- Unique: false,
- Columns: []*schema.Column{BatchMsgColumns[15]},
- },
- },
- }
- // CategoryColumns holds the columns for the "category" table.
- CategoryColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- }
- // CategoryTable holds the schema information for the "category" table.
- CategoryTable = &schema.Table{
- Name: "category",
- Columns: CategoryColumns,
- PrimaryKey: []*schema.Column{CategoryColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "category_organization_id",
- Unique: false,
- Columns: []*schema.Column{CategoryColumns[5]},
- },
- },
- }
- // ContactColumns holds the columns for the "contact" table.
- ContactColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
- {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "联系人类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
- {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
- {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
- {Name: "nickname", Type: field.TypeString, Comment: "微信昵称 群备注名称", Default: ""},
- {Name: "markname", Type: field.TypeString, Comment: "备注名", Default: ""},
- {Name: "headimg", Type: field.TypeString, Comment: "头像", Default: ""},
- {Name: "sex", Type: field.TypeInt, Comment: "性别 0未知 1男 2女", Default: 0},
- {Name: "starrole", Type: field.TypeString, Comment: "星标 65/67=星标 1/3=未星标", Default: ""},
- {Name: "dontseeit", Type: field.TypeInt, Comment: "不让他看我的朋友圈 0可以看 1不让看", Default: 0},
- {Name: "dontseeme", Type: field.TypeInt, Comment: "不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天", Default: 0},
- {Name: "lag", Type: field.TypeString, Comment: "所属标签id清单,多开会用逗号隔开", Default: ""},
- {Name: "gid", Type: field.TypeString, Comment: "群组id", Default: ""},
- {Name: "gname", Type: field.TypeString, Comment: "群组名称", Default: ""},
- {Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // ContactTable holds the schema information for the "contact" table.
- ContactTable = &schema.Table{
- Name: "contact",
- Columns: ContactColumns,
- PrimaryKey: []*schema.Column{ContactColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "contact_wx_wxid_wxid",
- Unique: true,
- Columns: []*schema.Column{ContactColumns[5], ContactColumns[7]},
- },
- {
- Name: "contact_wxid",
- Unique: false,
- Columns: []*schema.Column{ContactColumns[7]},
- },
- {
- Name: "contact_type",
- Unique: false,
- Columns: []*schema.Column{ContactColumns[6]},
- },
- {
- Name: "contact_gid",
- Unique: false,
- Columns: []*schema.Column{ContactColumns[17]},
- },
- },
- }
- // EmployeeColumns holds the columns for the "employee" table.
- EmployeeColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "title", Type: field.TypeString, Size: 255, Comment: "title | 标题"},
- {Name: "avatar", Type: field.TypeString, Size: 1000, Comment: "avatar | 头像"},
- {Name: "tags", Type: field.TypeString, Size: 255, Comment: "tags | 个人标签"},
- {Name: "hire_count", Type: field.TypeInt, Comment: "hire_count | 被雇佣次数", Default: 0},
- {Name: "service_count", Type: field.TypeInt, Comment: "service_count | 已服务次数", Default: 0},
- {Name: "achievement_count", Type: field.TypeInt, Comment: "achievement_count | 业绩单数", Default: 0},
- {Name: "intro", Type: field.TypeString, Size: 1000, Comment: "intro | 个人介绍", Default: ""},
- {Name: "estimate", Type: field.TypeString, Size: 1000, Comment: "estimate | 自我评价", Default: ""},
- {Name: "skill", Type: field.TypeString, Size: 1000, Comment: "skill | 技能卡", Default: ""},
- {Name: "ability_type", Type: field.TypeString, Comment: "ability_type | 能力类型", Default: ""},
- {Name: "scene", Type: field.TypeString, Comment: "scene | 使用场景", Default: ""},
- {Name: "switch_in", Type: field.TypeString, Comment: "switch_in | 支持介入", Default: ""},
- {Name: "video_url", Type: field.TypeString, Size: 1000, Comment: "video_url | 视频地址", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- {Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
- }
- // EmployeeTable holds the schema information for the "employee" table.
- EmployeeTable = &schema.Table{
- Name: "employee",
- Columns: EmployeeColumns,
- PrimaryKey: []*schema.Column{EmployeeColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "employee_organization_id",
- Unique: false,
- Columns: []*schema.Column{EmployeeColumns[17]},
- },
- },
- }
- // EmployeeConfigColumns holds the columns for the "employee_config" table.
- EmployeeConfigColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "stype", Type: field.TypeString, Comment: "类型:scene-场景 switch_in-接入方式", Default: ""},
- {Name: "title", Type: field.TypeString, Comment: "标题", Default: ""},
- {Name: "photo", Type: field.TypeString, Comment: "图片地址", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // EmployeeConfigTable holds the schema information for the "employee_config" table.
- EmployeeConfigTable = &schema.Table{
- Name: "employee_config",
- Columns: EmployeeConfigColumns,
- PrimaryKey: []*schema.Column{EmployeeConfigColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "employeeconfig_stype",
- Unique: false,
- Columns: []*schema.Column{EmployeeConfigColumns[4]},
- },
- },
- }
- // LabelColumns holds the columns for the "label" table.
- LabelColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
- {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""},
- {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1},
- {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1},
- {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // LabelTable holds the schema information for the "label" table.
- LabelTable = &schema.Table{
- Name: "label",
- Columns: LabelColumns,
- PrimaryKey: []*schema.Column{LabelColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "label_name_from_mode",
- Unique: true,
- Columns: []*schema.Column{LabelColumns[5], LabelColumns[6], LabelColumns[7]},
- },
- },
- }
- // LabelRelationshipColumns holds the columns for the "label_relationship" table.
- LabelRelationshipColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
- {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
- }
- // LabelRelationshipTable holds the schema information for the "label_relationship" table.
- LabelRelationshipTable = &schema.Table{
- Name: "label_relationship",
- Columns: LabelRelationshipColumns,
- PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "label_relationship_contact_contact_relationships",
- Columns: []*schema.Column{LabelRelationshipColumns[6]},
- RefColumns: []*schema.Column{ContactColumns[0]},
- OnDelete: schema.NoAction,
- },
- {
- Symbol: "label_relationship_label_label_relationships",
- Columns: []*schema.Column{LabelRelationshipColumns[7]},
- RefColumns: []*schema.Column{LabelColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "labelrelationship_label_id",
- Unique: false,
- Columns: []*schema.Column{LabelRelationshipColumns[7]},
- },
- {
- Name: "labelrelationship_contact_id",
- Unique: false,
- Columns: []*schema.Column{LabelRelationshipColumns[6]},
- },
- },
- }
- // MessagesColumns holds the columns for the "messages" table.
- MessagesColumns = []*schema.Column{
- {Name: "id", Type: field.TypeInt, Increment: true},
- {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
- {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
- {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
- }
- // MessagesTable holds the schema information for the "messages" table.
- MessagesTable = &schema.Table{
- Name: "messages",
- Columns: MessagesColumns,
- PrimaryKey: []*schema.Column{MessagesColumns[0]},
- }
- // MessageRecordsColumns holds the columns for the "message_records" table.
- MessageRecordsColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
- {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
- {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
- {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
- {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
- {Name: "meta", Type: field.TypeJSON, Nullable: true, Comment: "元数据"},
- {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
- {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
- {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
- {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
- {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
- }
- // MessageRecordsTable holds the schema information for the "message_records" table.
- MessageRecordsTable = &schema.Table{
- Name: "message_records",
- Columns: MessageRecordsColumns,
- PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "message_records_contact_contact_messages",
- Columns: []*schema.Column{MessageRecordsColumns[15]},
- RefColumns: []*schema.Column{ContactColumns[0]},
- OnDelete: schema.SetNull,
- },
- {
- Symbol: "message_records_sop_node_node_messages",
- Columns: []*schema.Column{MessageRecordsColumns[16]},
- RefColumns: []*schema.Column{SopNodeColumns[0]},
- OnDelete: schema.SetNull,
- },
- {
- Symbol: "message_records_sop_stage_stage_messages",
- Columns: []*schema.Column{MessageRecordsColumns[17]},
- RefColumns: []*schema.Column{SopStageColumns[0]},
- OnDelete: schema.SetNull,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "messagerecords_source_type",
- Unique: false,
- Columns: []*schema.Column{MessageRecordsColumns[13]},
- },
- },
- }
- // MsgColumns holds the columns for the "msg" table.
- MsgColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用"},
- {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
- {Name: "toid", Type: field.TypeString, Nullable: true, Comment: "接收人微信ID/群ID"},
- {Name: "msgtype", Type: field.TypeInt32, Nullable: true, Comment: "消息类型"},
- {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "消息"},
- {Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号"},
- }
- // MsgTable holds the schema information for the "msg" table.
- MsgTable = &schema.Table{
- Name: "msg",
- Columns: MsgColumns,
- PrimaryKey: []*schema.Column{MsgColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "msg_batch_no",
- Unique: false,
- Columns: []*schema.Column{MsgColumns[9]},
- },
- {
- Name: "msg_id",
- Unique: false,
- Columns: []*schema.Column{MsgColumns[0]},
- },
- {
- Name: "msg_status",
- Unique: false,
- Columns: []*schema.Column{MsgColumns[4]},
- },
- },
- }
- // ServerColumns holds the columns for the "server" table.
- ServerColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "name", Type: field.TypeString, Comment: "名称"},
- {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
- {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
- {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
- }
- // ServerTable holds the schema information for the "server" table.
- ServerTable = &schema.Table{
- Name: "server",
- Columns: ServerColumns,
- PrimaryKey: []*schema.Column{ServerColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "server_name",
- Unique: false,
- Columns: []*schema.Column{ServerColumns[5]},
- },
- {
- Name: "server_private_ip",
- Unique: false,
- Columns: []*schema.Column{ServerColumns[7]},
- },
- {
- Name: "server_public_ip",
- Unique: true,
- Columns: []*schema.Column{ServerColumns[6]},
- },
- },
- }
- // SopNodeColumns holds the columns for the "sop_node" table.
- SopNodeColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
- {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
- {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
- {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
- {Name: "no_reply_condition", Type: field.TypeUint64, Comment: "超时触发时间(分钟)", Default: 0},
- {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
- {Name: "action_label", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
- {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
- }
- // SopNodeTable holds the schema information for the "sop_node" table.
- SopNodeTable = &schema.Table{
- Name: "sop_node",
- Columns: SopNodeColumns,
- PrimaryKey: []*schema.Column{SopNodeColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "sop_node_sop_stage_stage_nodes",
- Columns: []*schema.Column{SopNodeColumns[12]},
- RefColumns: []*schema.Column{SopStageColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "sopnode_name",
- Unique: false,
- Columns: []*schema.Column{SopNodeColumns[6]},
- },
- },
- }
- // SopStageColumns holds the columns for the "sop_stage" table.
- SopStageColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
- {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
- {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
- {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
- {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
- {Name: "action_label", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
- {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
- {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
- }
- // SopStageTable holds the schema information for the "sop_stage" table.
- SopStageTable = &schema.Table{
- Name: "sop_stage",
- Columns: SopStageColumns,
- PrimaryKey: []*schema.Column{SopStageColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "sop_stage_sop_task_task_stages",
- Columns: []*schema.Column{SopStageColumns[12]},
- RefColumns: []*schema.Column{SopTaskColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "sopstage_name",
- Unique: false,
- Columns: []*schema.Column{SopStageColumns[5]},
- },
- },
- }
- // SopTaskColumns holds the columns for the "sop_task" table.
- SopTaskColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
- {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
- {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
- {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
- {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
- {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // SopTaskTable holds the schema information for the "sop_task" table.
- SopTaskTable = &schema.Table{
- Name: "sop_task",
- Columns: SopTaskColumns,
- PrimaryKey: []*schema.Column{SopTaskColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "soptask_name",
- Unique: false,
- Columns: []*schema.Column{SopTaskColumns[5]},
- },
- },
- }
- // TokenColumns holds the columns for the "token" table.
- TokenColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
- {Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
- {Name: "mac", Type: field.TypeString, Comment: "Mac地址", Default: ""},
- }
- // TokenTable holds the schema information for the "token" table.
- TokenTable = &schema.Table{
- Name: "token",
- Columns: TokenColumns,
- PrimaryKey: []*schema.Column{TokenColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "token_token",
- Unique: true,
- Columns: []*schema.Column{TokenColumns[5]},
- },
- },
- }
- // TutorialColumns holds the columns for the "tutorial" table.
- TutorialColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "index", Type: field.TypeInt, Comment: "index | 序号"},
- {Name: "title", Type: field.TypeString, Comment: "title | 标题"},
- {Name: "content", Type: field.TypeString, Comment: "content | 内容"},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
- }
- // TutorialTable holds the schema information for the "tutorial" table.
- TutorialTable = &schema.Table{
- Name: "tutorial",
- Columns: TutorialColumns,
- PrimaryKey: []*schema.Column{TutorialColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "tutorial_employee_em_tutorial",
- Columns: []*schema.Column{TutorialColumns[8]},
- RefColumns: []*schema.Column{EmployeeColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "tutorial_employee_id",
- Unique: false,
- Columns: []*schema.Column{TutorialColumns[8]},
- },
- },
- }
- // WorkExperienceColumns holds the columns for the "work_experience" table.
- WorkExperienceColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "start_date", Type: field.TypeTime, Comment: "start_date | 开始时间"},
- {Name: "end_date", Type: field.TypeTime, Comment: "end_date | 结束时间"},
- {Name: "company", Type: field.TypeString, Comment: "company | 公司名"},
- {Name: "experience", Type: field.TypeString, Size: 2147483647, Comment: "experience | 工作内容"},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
- }
- // WorkExperienceTable holds the schema information for the "work_experience" table.
- WorkExperienceTable = &schema.Table{
- Name: "work_experience",
- Columns: WorkExperienceColumns,
- PrimaryKey: []*schema.Column{WorkExperienceColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "work_experience_employee_em_work_experiences",
- Columns: []*schema.Column{WorkExperienceColumns[9]},
- RefColumns: []*schema.Column{EmployeeColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "workexperience_employee_id",
- Unique: false,
- Columns: []*schema.Column{WorkExperienceColumns[9]},
- },
- },
- }
- // WxColumns holds the columns for the "wx" table.
- WxColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
- {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
- {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
- {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
- {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
- {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
- {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
- {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
- {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
- {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
- {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
- {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
- {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
- }
- // WxTable holds the schema information for the "wx" table.
- WxTable = &schema.Table{
- Name: "wx",
- Columns: WxColumns,
- PrimaryKey: []*schema.Column{WxColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "wx_agent_wx_agent",
- Columns: []*schema.Column{WxColumns[16]},
- RefColumns: []*schema.Column{AgentColumns[0]},
- OnDelete: schema.NoAction,
- },
- {
- Symbol: "wx_server_wxs",
- Columns: []*schema.Column{WxColumns[17]},
- RefColumns: []*schema.Column{ServerColumns[0]},
- OnDelete: schema.SetNull,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "wx_server_id_port",
- Unique: true,
- Columns: []*schema.Column{WxColumns[17], WxColumns[5]},
- },
- {
- Name: "wx_wxid",
- Unique: true,
- Columns: []*schema.Column{WxColumns[8]},
- },
- {
- Name: "wx_account",
- Unique: false,
- Columns: []*schema.Column{WxColumns[9]},
- },
- {
- Name: "wx_nickname",
- Unique: false,
- Columns: []*schema.Column{WxColumns[10]},
- },
- {
- Name: "wx_tel",
- Unique: false,
- Columns: []*schema.Column{WxColumns[11]},
- },
- },
- }
- // Tables holds all the tables in the schema.
- Tables = []*schema.Table{
- AgentTable,
- BatchMsgTable,
- CategoryTable,
- ContactTable,
- EmployeeTable,
- EmployeeConfigTable,
- LabelTable,
- LabelRelationshipTable,
- MessagesTable,
- MessageRecordsTable,
- MsgTable,
- ServerTable,
- SopNodeTable,
- SopStageTable,
- SopTaskTable,
- TokenTable,
- TutorialTable,
- WorkExperienceTable,
- WxTable,
- }
- )
- func init() {
- AgentTable.Annotation = &entsql.Annotation{
- Table: "agent",
- }
- BatchMsgTable.Annotation = &entsql.Annotation{
- Table: "batch_msg",
- }
- CategoryTable.Annotation = &entsql.Annotation{
- Table: "category",
- }
- ContactTable.Annotation = &entsql.Annotation{
- Table: "contact",
- }
- EmployeeTable.Annotation = &entsql.Annotation{
- Table: "employee",
- }
- EmployeeConfigTable.Annotation = &entsql.Annotation{
- Table: "employee_config",
- }
- LabelTable.Annotation = &entsql.Annotation{
- Table: "label",
- }
- LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
- LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
- LabelRelationshipTable.Annotation = &entsql.Annotation{
- Table: "label_relationship",
- }
- MessagesTable.Annotation = &entsql.Annotation{
- Table: "messages",
- }
- MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
- MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
- MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
- MessageRecordsTable.Annotation = &entsql.Annotation{
- Table: "message_records",
- }
- MsgTable.Annotation = &entsql.Annotation{
- Table: "msg",
- }
- ServerTable.Annotation = &entsql.Annotation{
- Table: "server",
- }
- SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
- SopNodeTable.Annotation = &entsql.Annotation{
- Table: "sop_node",
- }
- SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
- SopStageTable.Annotation = &entsql.Annotation{
- Table: "sop_stage",
- }
- SopTaskTable.Annotation = &entsql.Annotation{
- Table: "sop_task",
- }
- TokenTable.Annotation = &entsql.Annotation{
- Table: "token",
- }
- TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
- TutorialTable.Annotation = &entsql.Annotation{
- Table: "tutorial",
- }
- WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
- WorkExperienceTable.Annotation = &entsql.Annotation{
- Table: "work_experience",
- }
- WxTable.ForeignKeys[0].RefTable = AgentTable
- WxTable.ForeignKeys[1].RefTable = ServerTable
- WxTable.Annotation = &entsql.Annotation{
- Table: "wx",
- }
- }
|