1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558 |
- // 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, Comment: "role | 角色设定"},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- {Name: "background", Type: field.TypeString, Nullable: true, Comment: "background | 背景介绍", Default: ""},
- {Name: "examples", Type: field.TypeString, Nullable: true, 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", Default: ""},
- {Name: "collection_id", Type: field.TypeString, Size: 255, Comment: "collection_id | 集合ID", Default: ""},
- }
- // 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]},
- },
- },
- }
- // AgentBaseColumns holds the columns for the "agent_base" table.
- AgentBaseColumns = []*schema.Column{
- {Name: "id", Type: field.TypeString, Comment: "id"},
- {Name: "q", Type: field.TypeString, Nullable: true, Comment: "q", Default: ""},
- {Name: "a", Type: field.TypeString, Nullable: true, Comment: "a", Default: ""},
- {Name: "chunk_index", Type: field.TypeUint64, Comment: "chunk_index"},
- {Name: "indexes", Type: field.TypeJSON, Nullable: true, Comment: "indexes"},
- {Name: "dataset_id", Type: field.TypeString, Nullable: true, Comment: "dataset_id", Default: ""},
- {Name: "collection_id", Type: field.TypeString, Nullable: true, Comment: "collection_id", Default: ""},
- {Name: "source_name", Type: field.TypeString, Nullable: true, Comment: "source_name", Default: ""},
- {Name: "can_write", Type: field.TypeJSON, Nullable: true, Comment: "can_write"},
- {Name: "is_owner", Type: field.TypeJSON, Nullable: true, Comment: "is_owner"},
- }
- // AgentBaseTable holds the schema information for the "agent_base" table.
- AgentBaseTable = &schema.Table{
- Name: "agent_base",
- Columns: AgentBaseColumns,
- PrimaryKey: []*schema.Column{AgentBaseColumns[0]},
- }
- // AliyunAvatarColumns holds the columns for the "aliyun_avatar" table.
- AliyunAvatarColumns = []*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: "user_id", Type: field.TypeUint64, Comment: "user_id | wx_card_user_id"},
- {Name: "biz_id", Type: field.TypeString, Comment: "biz_id | BizId"},
- {Name: "access_key_id", Type: field.TypeString, Comment: "access_key_id | AccessKeyId"},
- {Name: "access_key_secret", Type: field.TypeString, Comment: "access_key_secret | AccessKeySecret"},
- {Name: "app_id", Type: field.TypeString, Nullable: true, Comment: "app_id | AppId"},
- {Name: "tenant_id", Type: field.TypeUint64, Comment: "tenant_id | TenantId"},
- {Name: "response", Type: field.TypeString, Size: 2147483647, Comment: "response | 阿里云avatar响应"},
- {Name: "token", Type: field.TypeString, Comment: "token | Token", Default: ""},
- {Name: "session_id", Type: field.TypeString, Comment: "session_id | SessionId", Default: ""},
- }
- // AliyunAvatarTable holds the schema information for the "aliyun_avatar" table.
- AliyunAvatarTable = &schema.Table{
- Name: "aliyun_avatar",
- Columns: AliyunAvatarColumns,
- PrimaryKey: []*schema.Column{AliyunAvatarColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "aliyunavatar_user_id",
- Unique: false,
- Columns: []*schema.Column{AliyunAvatarColumns[4]},
- },
- },
- }
- // AllocAgentColumns holds the columns for the "alloc_agent" table.
- AllocAgentColumns = []*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: "user_id", Type: field.TypeString, Nullable: true, Comment: "user_id | 前台用户ID", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID", Default: 0},
- {Name: "agents", Type: field.TypeJSON, Comment: "agents | 分配的智能体IDs"},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- }
- // AllocAgentTable holds the schema information for the "alloc_agent" table.
- AllocAgentTable = &schema.Table{
- Name: "alloc_agent",
- Columns: AllocAgentColumns,
- PrimaryKey: []*schema.Column{AllocAgentColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "allocagent_organization_id",
- Unique: false,
- Columns: []*schema.Column{AllocAgentColumns[5]},
- },
- {
- Name: "allocagent_user_id",
- Unique: false,
- Columns: []*schema.Column{AllocAgentColumns[4]},
- },
- },
- }
- // 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: "tagids", Type: field.TypeString, Nullable: true, Comment: "要发送的tagids"},
- {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: "send_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"},
- {Name: "ctype", Type: field.TypeUint64, Comment: "内容类型:1-微信 2-whatsapp", Default: 1},
- {Name: "cc", Type: field.TypeString, Nullable: true, Comment: "国家区号"},
- {Name: "phone", Type: field.TypeString, Nullable: true, Comment: "手机号"},
- {Name: "template_name", Type: field.TypeString, Nullable: true, Comment: "模板名"},
- {Name: "template_code", Type: field.TypeString, Nullable: true, Comment: "模板code"},
- {Name: "lang", Type: field.TypeString, Nullable: true, Comment: "语言"},
- }
- // 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[17]},
- },
- },
- }
- // 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]},
- },
- },
- }
- // ChatRecordsColumns holds the columns for the "chat_records" table.
- ChatRecordsColumns = []*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: "content", Type: field.TypeString, Comment: "内容", Default: ""},
- {Name: "content_type", Type: field.TypeUint8, Comment: "内容类型:1-提问 2-回答", Default: 1},
- {Name: "session_id", Type: field.TypeUint64, Comment: "会话ID", Default: 0},
- {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
- {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
- {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
- }
- // ChatRecordsTable holds the schema information for the "chat_records" table.
- ChatRecordsTable = &schema.Table{
- Name: "chat_records",
- Columns: ChatRecordsColumns,
- PrimaryKey: []*schema.Column{ChatRecordsColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "chatrecords_user_id_bot_id_bot_type",
- Unique: false,
- Columns: []*schema.Column{ChatRecordsColumns[7], ChatRecordsColumns[8], ChatRecordsColumns[9]},
- },
- {
- Name: "chatrecords_session_id",
- Unique: false,
- Columns: []*schema.Column{ChatRecordsColumns[6]},
- },
- },
- }
- // ChatSessionColumns holds the columns for the "chat_session" table.
- ChatSessionColumns = []*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, Comment: "名称", Default: ""},
- {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
- {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
- {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
- }
- // ChatSessionTable holds the schema information for the "chat_session" table.
- ChatSessionTable = &schema.Table{
- Name: "chat_session",
- Columns: ChatSessionColumns,
- PrimaryKey: []*schema.Column{ChatSessionColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "chatsession_user_id_bot_id_bot_type",
- Unique: false,
- Columns: []*schema.Column{ChatSessionColumns[5], ChatSessionColumns[6], ChatSessionColumns[7]},
- },
- },
- }
- // 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, 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},
- {Name: "ctype", Type: field.TypeUint64, Comment: "内容类型:1-微信 2-whatsapp", Default: 1},
- {Name: "cage", Type: field.TypeInt, Comment: "年龄", Default: 0},
- {Name: "cname", Type: field.TypeString, Comment: "姓名", Default: ""},
- {Name: "carea", Type: field.TypeString, Comment: "地区", Default: ""},
- {Name: "cbirthday", Type: field.TypeString, Comment: "出生日期", Default: ""},
- {Name: "cbirtharea", Type: field.TypeString, Comment: "出生地", Default: ""},
- {Name: "cidcard_no", Type: field.TypeString, Comment: "身份证号", Default: ""},
- {Name: "ctitle", Type: field.TypeString, Comment: "称呼", Default: ""},
- {Name: "cc", Type: field.TypeString, Comment: "国家区号", Default: ""},
- {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
- }
- // 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]},
- },
- },
- }
- // CreditBalanceColumns holds the columns for the "credit_balance" table.
- CreditBalanceColumns = []*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: "user_id", Type: field.TypeString, Nullable: true, Comment: "user_id | 用户ID"},
- {Name: "balance", Type: field.TypeFloat32, Comment: "role | 角色设定"},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID"},
- }
- // CreditBalanceTable holds the schema information for the "credit_balance" table.
- CreditBalanceTable = &schema.Table{
- Name: "credit_balance",
- Columns: CreditBalanceColumns,
- PrimaryKey: []*schema.Column{CreditBalanceColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "creditbalance_user_id",
- Unique: false,
- Columns: []*schema.Column{CreditBalanceColumns[4]},
- },
- {
- Name: "creditbalance_organization_id",
- Unique: false,
- Columns: []*schema.Column{CreditBalanceColumns[7]},
- },
- },
- }
- // CreditUsageColumns holds the columns for the "credit_usage" table.
- CreditUsageColumns = []*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: "user_id", Type: field.TypeString, Nullable: true, Size: 255, Comment: "user_id | 用户ID"},
- {Name: "number", Type: field.TypeFloat32, Comment: "number | 积分改变量"},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- {Name: "ntype", Type: field.TypeInt, Comment: "ntype | 积分变化类型:1-消耗 2-增加", Default: 1},
- {Name: "table", Type: field.TypeString, Comment: "table | 积分变化表名", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID"},
- {Name: "nid", Type: field.TypeUint64, Comment: "nid | 积分变化关联信息ID", Default: 0},
- {Name: "reason", Type: field.TypeString, Size: 255, Comment: "reason | 积分变动原因", Default: ""},
- {Name: "operator", Type: field.TypeString, Size: 255, Comment: "operator | 积分变动人", Default: ""},
- }
- // CreditUsageTable holds the schema information for the "credit_usage" table.
- CreditUsageTable = &schema.Table{
- Name: "credit_usage",
- Columns: CreditUsageColumns,
- PrimaryKey: []*schema.Column{CreditUsageColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "creditusage_organization_id",
- Unique: false,
- Columns: []*schema.Column{CreditUsageColumns[9]},
- },
- },
- }
- // 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: 1000, Comment: "title | 标题"},
- {Name: "avatar", Type: field.TypeString, Comment: "avatar | 头像"},
- {Name: "tags", Type: field.TypeString, 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, Comment: "intro | 个人介绍", Default: ""},
- {Name: "estimate", Type: field.TypeString, Comment: "estimate | 自我评价", Default: ""},
- {Name: "skill", Type: field.TypeString, 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, Comment: "video_url | 视频地址", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
- {Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
- {Name: "api_base", Type: field.TypeString, Comment: "api_base", Default: ""},
- {Name: "api_key", Type: field.TypeString, Comment: "api_key", Default: ""},
- {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
- {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
- {Name: "chat_url", Type: field.TypeString, Comment: "聊天URL"},
- }
- // 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: "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[5]},
- RefColumns: []*schema.Column{ContactColumns[0]},
- OnDelete: schema.NoAction,
- },
- {
- Symbol: "label_relationship_label_label_relationships",
- Columns: []*schema.Column{LabelRelationshipColumns[6]},
- RefColumns: []*schema.Column{LabelColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "labelrelationship_label_id",
- Unique: false,
- Columns: []*schema.Column{LabelRelationshipColumns[6]},
- },
- {
- Name: "labelrelationship_contact_id",
- Unique: false,
- Columns: []*schema.Column{LabelRelationshipColumns[5]},
- },
- },
- }
- // LabelTaggingColumns holds the columns for the "label_tagging" table.
- LabelTaggingColumns = []*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, Comment: "机构 ID", Default: 1},
- {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
- {Name: "conditions", Type: field.TypeString, Comment: "关键词", Default: ""},
- {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
- {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
- }
- // LabelTaggingTable holds the schema information for the "label_tagging" table.
- LabelTaggingTable = &schema.Table{
- Name: "label_tagging",
- Columns: LabelTaggingColumns,
- PrimaryKey: []*schema.Column{LabelTaggingColumns[0]},
- }
- // 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: "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[14]},
- RefColumns: []*schema.Column{ContactColumns[0]},
- OnDelete: schema.SetNull,
- },
- {
- Symbol: "message_records_sop_node_node_messages",
- Columns: []*schema.Column{MessageRecordsColumns[15]},
- RefColumns: []*schema.Column{SopNodeColumns[0]},
- OnDelete: schema.SetNull,
- },
- {
- Symbol: "message_records_sop_stage_stage_messages",
- Columns: []*schema.Column{MessageRecordsColumns[16]},
- RefColumns: []*schema.Column{SopStageColumns[0]},
- OnDelete: schema.SetNull,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "messagerecords_source_type",
- Unique: false,
- Columns: []*schema.Column{MessageRecordsColumns[12]},
- },
- },
- }
- // 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: "批次号"},
- {Name: "cc", Type: field.TypeString, Comment: "国家区号", Default: ""},
- {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
- }
- // 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]},
- },
- },
- }
- // PayRechargeColumns holds the columns for the "pay_recharge" table.
- PayRechargeColumns = []*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: "user_id", Type: field.TypeString, Size: 255, Comment: "user_id | 用户ID"},
- {Name: "number", Type: field.TypeFloat32, Comment: "number | 变化积分数", Default: 0},
- {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
- {Name: "money", Type: field.TypeFloat32, Nullable: true, Comment: "money | 充值钱数", Default: 0},
- {Name: "out_trade_no", Type: field.TypeString, Nullable: true, Comment: "out_trade_no | 外部订单号", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID", Default: 0},
- }
- // PayRechargeTable holds the schema information for the "pay_recharge" table.
- PayRechargeTable = &schema.Table{
- Name: "pay_recharge",
- Columns: PayRechargeColumns,
- PrimaryKey: []*schema.Column{PayRechargeColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "payrecharge_user_id",
- Unique: false,
- Columns: []*schema.Column{PayRechargeColumns[4]},
- },
- {
- Name: "payrecharge_organization_id",
- Unique: false,
- Columns: []*schema.Column{PayRechargeColumns[9]},
- },
- },
- }
- // 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: "no_reply_unit", Type: field.TypeString, Comment: "超时触发时间单位", Default: ""},
- {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
- {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
- {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
- {Name: "action_forward", 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[15]},
- 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_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
- {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
- {Name: "action_forward", 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[14]},
- 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},
- {Name: "token", Type: field.TypeJSON, Nullable: true, Comment: "Token"},
- }
- // 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]},
- },
- {
- Name: "soptask_token",
- Unique: false,
- Columns: []*schema.Column{SopTaskColumns[12]},
- },
- },
- }
- // 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, Nullable: true, Comment: "Mac地址", Default: ""},
- {Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
- {Name: "custom_agent_base", Type: field.TypeString, Nullable: true, Comment: "定制agent服务地址", Default: ""},
- {Name: "custom_agent_key", Type: field.TypeString, Nullable: true, Comment: "定制agent服务密钥", Default: ""},
- {Name: "openai_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
- {Name: "openai_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
- {Name: "agent_id", Type: field.TypeUint64, Comment: "智能体ID", Default: 0},
- }
- // TokenTable holds the schema information for the "token" table.
- TokenTable = &schema.Table{
- Name: "token",
- Columns: TokenColumns,
- PrimaryKey: []*schema.Column{TokenColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "token_agent_token_agent",
- Columns: []*schema.Column{TokenColumns[12]},
- RefColumns: []*schema.Column{AgentColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- 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]},
- },
- },
- }
- // UsageDetailColumns holds the columns for the "usage_detail" table.
- UsageDetailColumns = []*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, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
- {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
- {Name: "receiver_id", Type: field.TypeString, Comment: "微信id或open_id", Default: ""},
- {Name: "app", Type: field.TypeInt, Nullable: true, Comment: "1 cow-basic 2 cow-agent 3 cow-sop 4 mp-card 5 mp-employee", Default: 1},
- {Name: "session_id", Type: field.TypeUint64, Nullable: true, Comment: "名片会话id", Default: 1},
- {Name: "request", Type: field.TypeString, Comment: "请求内容", Default: ""},
- {Name: "response", Type: field.TypeString, Comment: "响应内容", Default: ""},
- {Name: "original_data", Type: field.TypeJSON, Comment: "原始数据"},
- {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
- {Name: "prompt_tokens", Type: field.TypeUint64, Nullable: true, Comment: "请求token数", Default: 0},
- {Name: "completion_tokens", Type: field.TypeUint64, Nullable: true, Comment: "响应token数", Default: 0},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // UsageDetailTable holds the schema information for the "usage_detail" table.
- UsageDetailTable = &schema.Table{
- Name: "usage_detail",
- Columns: UsageDetailColumns,
- PrimaryKey: []*schema.Column{UsageDetailColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "usagedetail_bot_id",
- Unique: false,
- Columns: []*schema.Column{UsageDetailColumns[5]},
- },
- {
- Name: "usagedetail_organization_id",
- Unique: false,
- Columns: []*schema.Column{UsageDetailColumns[15]},
- },
- },
- }
- // UsageStatisticDayColumns holds the columns for the "usage_statistic_day" table.
- UsageStatisticDayColumns = []*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: "addtime", Type: field.TypeUint64, Comment: "写入年月日"},
- {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
- {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
- {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
- {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
- {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
- {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
- {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
- {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
- {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
- {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
- {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
- }
- // UsageStatisticDayTable holds the schema information for the "usage_statistic_day" table.
- UsageStatisticDayTable = &schema.Table{
- Name: "usage_statistic_day",
- Columns: UsageStatisticDayColumns,
- PrimaryKey: []*schema.Column{UsageStatisticDayColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "usagestatisticday_addtime",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticDayColumns[5]},
- },
- {
- Name: "usagestatisticday_bot_id",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticDayColumns[7]},
- },
- },
- }
- // UsageStatisticHourColumns holds the columns for the "usage_statistic_hour" table.
- UsageStatisticHourColumns = []*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: "addtime", Type: field.TypeUint64, Comment: "写入小时"},
- {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
- {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
- {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
- {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
- {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
- {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
- {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
- {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
- {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
- {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
- {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
- }
- // UsageStatisticHourTable holds the schema information for the "usage_statistic_hour" table.
- UsageStatisticHourTable = &schema.Table{
- Name: "usage_statistic_hour",
- Columns: UsageStatisticHourColumns,
- PrimaryKey: []*schema.Column{UsageStatisticHourColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "usagestatistichour_addtime",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticHourColumns[5]},
- },
- {
- Name: "usagestatistichour_bot_id",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticHourColumns[7]},
- },
- },
- }
- // UsageStatisticMonthColumns holds the columns for the "usage_statistic_month" table.
- UsageStatisticMonthColumns = []*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: "addtime", Type: field.TypeUint64, Comment: "写入年月"},
- {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
- {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
- {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
- {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
- {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
- {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
- {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
- {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
- {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
- {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
- {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
- }
- // UsageStatisticMonthTable holds the schema information for the "usage_statistic_month" table.
- UsageStatisticMonthTable = &schema.Table{
- Name: "usage_statistic_month",
- Columns: UsageStatisticMonthColumns,
- PrimaryKey: []*schema.Column{UsageStatisticMonthColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "usagestatisticmonth_addtime",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticMonthColumns[5]},
- },
- {
- Name: "usagestatisticmonth_bot_id",
- Unique: false,
- Columns: []*schema.Column{UsageStatisticMonthColumns[7]},
- },
- },
- }
- // UsageTotalColumns holds the columns for the "usage_total" table.
- UsageTotalColumns = []*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, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
- {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
- {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
- {Name: "start_index", Type: field.TypeUint64, Nullable: true, Comment: "重制后的起始usage_detail 索引", Default: 0},
- {Name: "end_index", Type: field.TypeUint64, Nullable: true, Comment: "usage_detail 索引", Default: 0},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
- }
- // UsageTotalTable holds the schema information for the "usage_total" table.
- UsageTotalTable = &schema.Table{
- Name: "usage_total",
- Columns: UsageTotalColumns,
- PrimaryKey: []*schema.Column{UsageTotalColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "usagetotal_bot_id",
- Unique: false,
- Columns: []*schema.Column{UsageTotalColumns[5]},
- },
- {
- Name: "usagetotal_organization_id",
- Unique: false,
- Columns: []*schema.Column{UsageTotalColumns[9]},
- },
- },
- }
- // WhatsappColumns holds the columns for the "whatsapp" table.
- WhatsappColumns = []*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: "wa_id", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "wa_name", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "callback", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "account", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "cc", Type: field.TypeString, Default: ""},
- {Name: "phone", Type: field.TypeString, Default: ""},
- {Name: "cc_phone", Type: field.TypeString, Default: ""},
- {Name: "phone_name", Type: field.TypeString, Default: ""},
- {Name: "phone_status", Type: field.TypeInt8, Default: 0},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
- {Name: "api_base", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "api_key", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "allow_list", Type: field.TypeJSON, Nullable: true},
- {Name: "group_allow_list", Type: field.TypeJSON, Nullable: true},
- {Name: "block_list", Type: field.TypeJSON, Nullable: true},
- {Name: "group_block_list", Type: field.TypeJSON, Nullable: true},
- {Name: "agent_id", Type: field.TypeUint64, Default: 0},
- }
- // WhatsappTable holds the schema information for the "whatsapp" table.
- WhatsappTable = &schema.Table{
- Name: "whatsapp",
- Columns: WhatsappColumns,
- PrimaryKey: []*schema.Column{WhatsappColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "whatsapp_agent_wa_agent",
- Columns: []*schema.Column{WhatsappColumns[21]},
- RefColumns: []*schema.Column{AgentColumns[0]},
- OnDelete: schema.NoAction,
- },
- },
- }
- // WhatsappChannelColumns holds the columns for the "whatsapp_channel" table.
- WhatsappChannelColumns = []*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: "ak", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "sk", Type: field.TypeString, Default: ""},
- {Name: "wa_id", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "wa_name", Type: field.TypeString, Nullable: true, Default: ""},
- {Name: "waba_id", Type: field.TypeUint64, Default: 0},
- {Name: "business_id", Type: field.TypeUint64, Default: 0},
- {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
- {Name: "verify_account", Type: field.TypeString, Default: ""},
- }
- // WhatsappChannelTable holds the schema information for the "whatsapp_channel" table.
- WhatsappChannelTable = &schema.Table{
- Name: "whatsapp_channel",
- Columns: WhatsappChannelColumns,
- PrimaryKey: []*schema.Column{WhatsappChannelColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "whatsappchannel_ak_sk",
- Unique: false,
- Columns: []*schema.Column{WhatsappChannelColumns[5], WhatsappChannelColumns[6]},
- },
- },
- }
- // 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]},
- },
- },
- }
- // WpChatroomColumns holds the columns for the "wp_chatroom" table.
- WpChatroomColumns = []*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: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
- {Name: "chatroom_id", Type: field.TypeString, Comment: "群id", Default: ""},
- {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
- {Name: "owner", Type: field.TypeString, Comment: "群主", Default: ""},
- {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
- {Name: "member_list", Type: field.TypeJSON, Comment: "群成员"},
- }
- // WpChatroomTable holds the schema information for the "wp_chatroom" table.
- WpChatroomTable = &schema.Table{
- Name: "wp_chatroom",
- Columns: WpChatroomColumns,
- PrimaryKey: []*schema.Column{WpChatroomColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "wpchatroom_wx_wxid_chatroom_id",
- Unique: false,
- Columns: []*schema.Column{WpChatroomColumns[4], WpChatroomColumns[5]},
- },
- },
- }
- // WpChatroomMemberColumns holds the columns for the "wp_chatroom_member" table.
- WpChatroomMemberColumns = []*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: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
- {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
- {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
- {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
- }
- // WpChatroomMemberTable holds the schema information for the "wp_chatroom_member" table.
- WpChatroomMemberTable = &schema.Table{
- Name: "wp_chatroom_member",
- Columns: WpChatroomMemberColumns,
- PrimaryKey: []*schema.Column{WpChatroomMemberColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "wpchatroommember_wx_wxid_wxid",
- Unique: false,
- Columns: []*schema.Column{WpChatroomMemberColumns[4], WpChatroomMemberColumns[5]},
- },
- },
- }
- // 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: "allow_list", Type: field.TypeJSON, Comment: "白名单"},
- {Name: "group_allow_list", Type: field.TypeJSON, Comment: "群白名单"},
- {Name: "block_list", Type: field.TypeJSON, Comment: "黑名单"},
- {Name: "group_block_list", Type: field.TypeJSON, Comment: "群黑名单"},
- {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
- {Name: "agent_base_wx_agent", Type: field.TypeString, Nullable: true},
- {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[20]},
- RefColumns: []*schema.Column{AgentColumns[0]},
- OnDelete: schema.NoAction,
- },
- {
- Symbol: "wx_agent_base_wx_agent",
- Columns: []*schema.Column{WxColumns[21]},
- RefColumns: []*schema.Column{AgentBaseColumns[0]},
- OnDelete: schema.SetNull,
- },
- {
- Symbol: "wx_server_wxs",
- Columns: []*schema.Column{WxColumns[22]},
- RefColumns: []*schema.Column{ServerColumns[0]},
- OnDelete: schema.SetNull,
- },
- },
- Indexes: []*schema.Index{
- {
- Name: "wx_server_id_port",
- Unique: true,
- Columns: []*schema.Column{WxColumns[22], 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]},
- },
- },
- }
- // WxCardColumns holds the columns for the "wx_card" table.
- WxCardColumns = []*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: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
- {Name: "wx_user_id", Type: field.TypeUint64, Nullable: true, Comment: "wx表ID", Default: 0},
- {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
- {Name: "logo", Type: field.TypeString, Comment: "logo", Default: ""},
- {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
- {Name: "company", Type: field.TypeString, Comment: "公司", Default: ""},
- {Name: "address", Type: field.TypeString, Comment: "地址", Default: ""},
- {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
- {Name: "official_account", Type: field.TypeString, Comment: "公众号", Default: ""},
- {Name: "wechat_account", Type: field.TypeString, Comment: "微信号", Default: ""},
- {Name: "email", Type: field.TypeString, Nullable: true, Comment: "邮箱", Default: ""},
- {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "fastgpt-base"},
- {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "fastgpt-key"},
- {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
- {Name: "intro", Type: field.TypeString, Nullable: true, Comment: "个人介绍", Default: ""},
- }
- // WxCardTable holds the schema information for the "wx_card" table.
- WxCardTable = &schema.Table{
- Name: "wx_card",
- Columns: WxCardColumns,
- PrimaryKey: []*schema.Column{WxCardColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "wxcard_user_id",
- Unique: false,
- Columns: []*schema.Column{WxCardColumns[4]},
- },
- {
- Name: "wxcard_wx_user_id",
- Unique: false,
- Columns: []*schema.Column{WxCardColumns[5]},
- },
- },
- }
- // WxCardUserColumns holds the columns for the "wx_card_user" table.
- WxCardUserColumns = []*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: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
- {Name: "account", Type: field.TypeString, Comment: "微信号", Default: ""},
- {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
- {Name: "nickname", Type: field.TypeString, Comment: "昵称", Default: ""},
- {Name: "remark", Type: field.TypeString, Comment: "备注名", Default: ""},
- {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
- {Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
- {Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
- {Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
- {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
- }
- // WxCardUserTable holds the schema information for the "wx_card_user" table.
- WxCardUserTable = &schema.Table{
- Name: "wx_card_user",
- Columns: WxCardUserColumns,
- PrimaryKey: []*schema.Column{WxCardUserColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "wxcarduser_wxid_open_id",
- Unique: false,
- Columns: []*schema.Column{WxCardUserColumns[4], WxCardUserColumns[10]},
- },
- },
- }
- // WxCardVisitColumns holds the columns for the "wx_card_visit" table.
- WxCardVisitColumns = []*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: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
- {Name: "bot_id", Type: field.TypeUint64, Comment: "被访ID", Default: 0},
- {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序 3-智能体", Default: 0},
- }
- // WxCardVisitTable holds the schema information for the "wx_card_visit" table.
- WxCardVisitTable = &schema.Table{
- Name: "wx_card_visit",
- Columns: WxCardVisitColumns,
- PrimaryKey: []*schema.Column{WxCardVisitColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "wxcardvisit_user_id",
- Unique: false,
- Columns: []*schema.Column{WxCardVisitColumns[4]},
- },
- {
- Name: "wxcardvisit_bot_id_bot_type",
- Unique: false,
- Columns: []*schema.Column{WxCardVisitColumns[5], WxCardVisitColumns[6]},
- },
- },
- }
- // Tables holds all the tables in the schema.
- Tables = []*schema.Table{
- AgentTable,
- AgentBaseTable,
- AliyunAvatarTable,
- AllocAgentTable,
- BatchMsgTable,
- CategoryTable,
- ChatRecordsTable,
- ChatSessionTable,
- ContactTable,
- CreditBalanceTable,
- CreditUsageTable,
- EmployeeTable,
- EmployeeConfigTable,
- LabelTable,
- LabelRelationshipTable,
- LabelTaggingTable,
- MessagesTable,
- MessageRecordsTable,
- MsgTable,
- PayRechargeTable,
- ServerTable,
- SopNodeTable,
- SopStageTable,
- SopTaskTable,
- TokenTable,
- TutorialTable,
- UsageDetailTable,
- UsageStatisticDayTable,
- UsageStatisticHourTable,
- UsageStatisticMonthTable,
- UsageTotalTable,
- WhatsappTable,
- WhatsappChannelTable,
- WorkExperienceTable,
- WpChatroomTable,
- WpChatroomMemberTable,
- WxTable,
- WxCardTable,
- WxCardUserTable,
- WxCardVisitTable,
- }
- )
- func init() {
- AgentTable.Annotation = &entsql.Annotation{
- Table: "agent",
- }
- AgentBaseTable.Annotation = &entsql.Annotation{
- Table: "agent_base",
- }
- AliyunAvatarTable.Annotation = &entsql.Annotation{
- Table: "aliyun_avatar",
- }
- AllocAgentTable.Annotation = &entsql.Annotation{
- Table: "alloc_agent",
- }
- BatchMsgTable.Annotation = &entsql.Annotation{
- Table: "batch_msg",
- }
- CategoryTable.Annotation = &entsql.Annotation{
- Table: "category",
- }
- ChatRecordsTable.Annotation = &entsql.Annotation{
- Table: "chat_records",
- }
- ChatSessionTable.Annotation = &entsql.Annotation{
- Table: "chat_session",
- }
- ContactTable.Annotation = &entsql.Annotation{
- Table: "contact",
- }
- CreditBalanceTable.Annotation = &entsql.Annotation{
- Table: "credit_balance",
- }
- CreditUsageTable.Annotation = &entsql.Annotation{
- Table: "credit_usage",
- }
- 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",
- }
- LabelTaggingTable.Annotation = &entsql.Annotation{
- Table: "label_tagging",
- }
- 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",
- }
- PayRechargeTable.Annotation = &entsql.Annotation{
- Table: "pay_recharge",
- }
- 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.ForeignKeys[0].RefTable = AgentTable
- TokenTable.Annotation = &entsql.Annotation{
- Table: "token",
- }
- TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
- TutorialTable.Annotation = &entsql.Annotation{
- Table: "tutorial",
- }
- UsageDetailTable.Annotation = &entsql.Annotation{
- Table: "usage_detail",
- }
- UsageStatisticDayTable.Annotation = &entsql.Annotation{
- Table: "usage_statistic_day",
- }
- UsageStatisticHourTable.Annotation = &entsql.Annotation{
- Table: "usage_statistic_hour",
- }
- UsageStatisticMonthTable.Annotation = &entsql.Annotation{
- Table: "usage_statistic_month",
- }
- UsageTotalTable.Annotation = &entsql.Annotation{
- Table: "usage_total",
- }
- WhatsappTable.ForeignKeys[0].RefTable = AgentTable
- WhatsappTable.Annotation = &entsql.Annotation{
- Table: "whatsapp",
- }
- WhatsappChannelTable.Annotation = &entsql.Annotation{
- Table: "whatsapp_channel",
- }
- WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
- WorkExperienceTable.Annotation = &entsql.Annotation{
- Table: "work_experience",
- }
- WpChatroomTable.Annotation = &entsql.Annotation{
- Table: "wp_chatroom",
- }
- WpChatroomMemberTable.Annotation = &entsql.Annotation{
- Table: "wp_chatroom_member",
- }
- WxTable.ForeignKeys[0].RefTable = AgentTable
- WxTable.ForeignKeys[1].RefTable = AgentBaseTable
- WxTable.ForeignKeys[2].RefTable = ServerTable
- WxTable.Annotation = &entsql.Annotation{
- Table: "wx",
- }
- WxCardTable.Annotation = &entsql.Annotation{
- Table: "wx_card",
- }
- WxCardUserTable.Annotation = &entsql.Annotation{
- Table: "wx_card_user",
- }
- WxCardVisitTable.Annotation = &entsql.Annotation{
- Table: "wx_card_visit",
- }
- }
|