schema.go 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339
  1. // Code generated by ent, DO NOT EDIT.
  2. package migrate
  3. import (
  4. "entgo.io/ent/dialect/entsql"
  5. "entgo.io/ent/dialect/sql/schema"
  6. "entgo.io/ent/schema/field"
  7. )
  8. var (
  9. // AgentColumns holds the columns for the "agent" table.
  10. AgentColumns = []*schema.Column{
  11. {Name: "id", Type: field.TypeUint64, Increment: true},
  12. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  13. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  14. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  15. {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
  16. {Name: "role", Type: field.TypeString, Comment: "role | 角色设定"},
  17. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  18. {Name: "background", Type: field.TypeString, Nullable: true, Comment: "background | 背景介绍", Default: ""},
  19. {Name: "examples", Type: field.TypeString, Nullable: true, Comment: "examples | 对话案例", Default: ""},
  20. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  21. {Name: "dataset_id", Type: field.TypeString, Size: 255, Comment: "dataset_id | 知识库ID", Default: ""},
  22. {Name: "collection_id", Type: field.TypeString, Size: 255, Comment: "collection_id | 集合ID", Default: ""},
  23. }
  24. // AgentTable holds the schema information for the "agent" table.
  25. AgentTable = &schema.Table{
  26. Name: "agent",
  27. Columns: AgentColumns,
  28. PrimaryKey: []*schema.Column{AgentColumns[0]},
  29. Indexes: []*schema.Index{
  30. {
  31. Name: "agent_organization_id",
  32. Unique: false,
  33. Columns: []*schema.Column{AgentColumns[9]},
  34. },
  35. },
  36. }
  37. // AgentBaseColumns holds the columns for the "agent_base" table.
  38. AgentBaseColumns = []*schema.Column{
  39. {Name: "id", Type: field.TypeString, Comment: "id"},
  40. {Name: "q", Type: field.TypeString, Nullable: true, Comment: "q", Default: ""},
  41. {Name: "a", Type: field.TypeString, Nullable: true, Comment: "a", Default: ""},
  42. {Name: "chunk_index", Type: field.TypeUint64, Comment: "chunk_index"},
  43. {Name: "indexes", Type: field.TypeJSON, Nullable: true, Comment: "indexes"},
  44. {Name: "dataset_id", Type: field.TypeString, Nullable: true, Comment: "dataset_id", Default: ""},
  45. {Name: "collection_id", Type: field.TypeString, Nullable: true, Comment: "collection_id", Default: ""},
  46. {Name: "source_name", Type: field.TypeString, Nullable: true, Comment: "source_name", Default: ""},
  47. {Name: "can_write", Type: field.TypeJSON, Nullable: true, Comment: "can_write"},
  48. {Name: "is_owner", Type: field.TypeJSON, Nullable: true, Comment: "is_owner"},
  49. }
  50. // AgentBaseTable holds the schema information for the "agent_base" table.
  51. AgentBaseTable = &schema.Table{
  52. Name: "agent_base",
  53. Columns: AgentBaseColumns,
  54. PrimaryKey: []*schema.Column{AgentBaseColumns[0]},
  55. }
  56. // AliyunAvatarColumns holds the columns for the "aliyun_avatar" table.
  57. AliyunAvatarColumns = []*schema.Column{
  58. {Name: "id", Type: field.TypeUint64, Increment: true},
  59. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  60. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  61. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  62. {Name: "user_id", Type: field.TypeUint64, Comment: "user_id | wx_card_user_id"},
  63. {Name: "biz_id", Type: field.TypeString, Comment: "biz_id | BizId"},
  64. {Name: "access_key_id", Type: field.TypeString, Comment: "access_key_id | AccessKeyId"},
  65. {Name: "access_key_secret", Type: field.TypeString, Comment: "access_key_secret | AccessKeySecret"},
  66. {Name: "app_id", Type: field.TypeString, Nullable: true, Comment: "app_id | AppId"},
  67. {Name: "tenant_id", Type: field.TypeUint64, Comment: "tenant_id | TenantId"},
  68. {Name: "response", Type: field.TypeString, Size: 2147483647, Comment: "response | 阿里云avatar响应"},
  69. {Name: "token", Type: field.TypeString, Comment: "token | Token", Default: ""},
  70. {Name: "session_id", Type: field.TypeString, Comment: "session_id | SessionId", Default: ""},
  71. }
  72. // AliyunAvatarTable holds the schema information for the "aliyun_avatar" table.
  73. AliyunAvatarTable = &schema.Table{
  74. Name: "aliyun_avatar",
  75. Columns: AliyunAvatarColumns,
  76. PrimaryKey: []*schema.Column{AliyunAvatarColumns[0]},
  77. Indexes: []*schema.Index{
  78. {
  79. Name: "aliyunavatar_user_id",
  80. Unique: false,
  81. Columns: []*schema.Column{AliyunAvatarColumns[4]},
  82. },
  83. },
  84. }
  85. // AllocAgentColumns holds the columns for the "alloc_agent" table.
  86. AllocAgentColumns = []*schema.Column{
  87. {Name: "id", Type: field.TypeUint64, Increment: true},
  88. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  89. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  90. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  91. {Name: "user_id", Type: field.TypeString, Nullable: true, Comment: "user_id | 前台用户ID", Default: ""},
  92. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID", Default: 0},
  93. {Name: "agents", Type: field.TypeJSON, Comment: "agents | 分配的智能体IDs"},
  94. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  95. }
  96. // AllocAgentTable holds the schema information for the "alloc_agent" table.
  97. AllocAgentTable = &schema.Table{
  98. Name: "alloc_agent",
  99. Columns: AllocAgentColumns,
  100. PrimaryKey: []*schema.Column{AllocAgentColumns[0]},
  101. Indexes: []*schema.Index{
  102. {
  103. Name: "allocagent_organization_id",
  104. Unique: false,
  105. Columns: []*schema.Column{AllocAgentColumns[5]},
  106. },
  107. {
  108. Name: "allocagent_user_id",
  109. Unique: false,
  110. Columns: []*schema.Column{AllocAgentColumns[4]},
  111. },
  112. },
  113. }
  114. // BatchMsgColumns holds the columns for the "batch_msg" table.
  115. BatchMsgColumns = []*schema.Column{
  116. {Name: "id", Type: field.TypeUint64, Increment: true},
  117. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  118. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  119. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  120. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "状态 0 未开始 1 开始发送 2 发送完成 3 发送中止"},
  121. {Name: "batch_no", Type: field.TypeString, Unique: true, Nullable: true, Comment: "批次号"},
  122. {Name: "task_name", Type: field.TypeString, Nullable: true, Comment: "任务名称", Default: ""},
  123. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  124. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "内容"},
  125. {Name: "tag", Type: field.TypeString, Nullable: true, Comment: "发送规则 all 全部 tag1,tag2 按tag发送"},
  126. {Name: "tagids", Type: field.TypeString, Nullable: true, Comment: "要发送的tagids"},
  127. {Name: "total", Type: field.TypeInt32, Nullable: true, Comment: "总数"},
  128. {Name: "success", Type: field.TypeInt32, Nullable: true, Comment: "成功数量"},
  129. {Name: "fail", Type: field.TypeInt32, Nullable: true, Comment: "失败数量"},
  130. {Name: "start_time", Type: field.TypeTime, Nullable: true, Comment: "开始时间"},
  131. {Name: "stop_time", Type: field.TypeTime, Nullable: true, Comment: "结束时间"},
  132. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  133. {Name: "type", Type: field.TypeInt32, Nullable: true, Comment: "发送类型 1-群发消息 2-群发朋友圈"},
  134. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  135. }
  136. // BatchMsgTable holds the schema information for the "batch_msg" table.
  137. BatchMsgTable = &schema.Table{
  138. Name: "batch_msg",
  139. Columns: BatchMsgColumns,
  140. PrimaryKey: []*schema.Column{BatchMsgColumns[0]},
  141. Indexes: []*schema.Index{
  142. {
  143. Name: "batchmsg_batch_no",
  144. Unique: true,
  145. Columns: []*schema.Column{BatchMsgColumns[5]},
  146. },
  147. {
  148. Name: "batchmsg_type",
  149. Unique: false,
  150. Columns: []*schema.Column{BatchMsgColumns[17]},
  151. },
  152. },
  153. }
  154. // CategoryColumns holds the columns for the "category" table.
  155. CategoryColumns = []*schema.Column{
  156. {Name: "id", Type: field.TypeUint64, Increment: true},
  157. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  158. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  159. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  160. {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
  161. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  162. }
  163. // CategoryTable holds the schema information for the "category" table.
  164. CategoryTable = &schema.Table{
  165. Name: "category",
  166. Columns: CategoryColumns,
  167. PrimaryKey: []*schema.Column{CategoryColumns[0]},
  168. Indexes: []*schema.Index{
  169. {
  170. Name: "category_organization_id",
  171. Unique: false,
  172. Columns: []*schema.Column{CategoryColumns[5]},
  173. },
  174. },
  175. }
  176. // ChatRecordsColumns holds the columns for the "chat_records" table.
  177. ChatRecordsColumns = []*schema.Column{
  178. {Name: "id", Type: field.TypeUint64, Increment: true},
  179. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  180. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  181. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  182. {Name: "content", Type: field.TypeString, Comment: "内容", Default: ""},
  183. {Name: "content_type", Type: field.TypeUint8, Comment: "内容类型:1-提问 2-回答", Default: 1},
  184. {Name: "session_id", Type: field.TypeUint64, Comment: "会话ID", Default: 0},
  185. {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
  186. {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
  187. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
  188. }
  189. // ChatRecordsTable holds the schema information for the "chat_records" table.
  190. ChatRecordsTable = &schema.Table{
  191. Name: "chat_records",
  192. Columns: ChatRecordsColumns,
  193. PrimaryKey: []*schema.Column{ChatRecordsColumns[0]},
  194. Indexes: []*schema.Index{
  195. {
  196. Name: "chatrecords_user_id_bot_id_bot_type",
  197. Unique: false,
  198. Columns: []*schema.Column{ChatRecordsColumns[7], ChatRecordsColumns[8], ChatRecordsColumns[9]},
  199. },
  200. {
  201. Name: "chatrecords_session_id",
  202. Unique: false,
  203. Columns: []*schema.Column{ChatRecordsColumns[6]},
  204. },
  205. },
  206. }
  207. // ChatSessionColumns holds the columns for the "chat_session" table.
  208. ChatSessionColumns = []*schema.Column{
  209. {Name: "id", Type: field.TypeUint64, Increment: true},
  210. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  211. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  212. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  213. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  214. {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
  215. {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
  216. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
  217. }
  218. // ChatSessionTable holds the schema information for the "chat_session" table.
  219. ChatSessionTable = &schema.Table{
  220. Name: "chat_session",
  221. Columns: ChatSessionColumns,
  222. PrimaryKey: []*schema.Column{ChatSessionColumns[0]},
  223. Indexes: []*schema.Index{
  224. {
  225. Name: "chatsession_user_id_bot_id_bot_type",
  226. Unique: false,
  227. Columns: []*schema.Column{ChatSessionColumns[5], ChatSessionColumns[6], ChatSessionColumns[7]},
  228. },
  229. },
  230. }
  231. // ContactColumns holds the columns for the "contact" table.
  232. ContactColumns = []*schema.Column{
  233. {Name: "id", Type: field.TypeUint64, Increment: true},
  234. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  235. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  236. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  237. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  238. {Name: "wx_wxid", Type: field.TypeString, Comment: "属主微信id", Default: ""},
  239. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "联系人类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  240. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  241. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  242. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称 群备注名称", Default: ""},
  243. {Name: "markname", Type: field.TypeString, Comment: "备注名", Default: ""},
  244. {Name: "headimg", Type: field.TypeString, Comment: "头像", Default: ""},
  245. {Name: "sex", Type: field.TypeInt, Comment: "性别 0未知 1男 2女", Default: 0},
  246. {Name: "starrole", Type: field.TypeString, Comment: "星标 65/67=星标 1/3=未星标", Default: ""},
  247. {Name: "dontseeit", Type: field.TypeInt, Comment: "不让他看我的朋友圈 0可以看 1不让看", Default: 0},
  248. {Name: "dontseeme", Type: field.TypeInt, Comment: "不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天", Default: 0},
  249. {Name: "lag", Type: field.TypeString, Comment: "所属标签id清单,多开会用逗号隔开", Default: ""},
  250. {Name: "gid", Type: field.TypeString, Comment: "群组id", Default: ""},
  251. {Name: "gname", Type: field.TypeString, Comment: "群组名称", Default: ""},
  252. {Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""},
  253. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  254. }
  255. // ContactTable holds the schema information for the "contact" table.
  256. ContactTable = &schema.Table{
  257. Name: "contact",
  258. Columns: ContactColumns,
  259. PrimaryKey: []*schema.Column{ContactColumns[0]},
  260. Indexes: []*schema.Index{
  261. {
  262. Name: "contact_wx_wxid_wxid",
  263. Unique: true,
  264. Columns: []*schema.Column{ContactColumns[5], ContactColumns[7]},
  265. },
  266. {
  267. Name: "contact_wxid",
  268. Unique: false,
  269. Columns: []*schema.Column{ContactColumns[7]},
  270. },
  271. {
  272. Name: "contact_type",
  273. Unique: false,
  274. Columns: []*schema.Column{ContactColumns[6]},
  275. },
  276. {
  277. Name: "contact_gid",
  278. Unique: false,
  279. Columns: []*schema.Column{ContactColumns[17]},
  280. },
  281. },
  282. }
  283. // EmployeeColumns holds the columns for the "employee" table.
  284. EmployeeColumns = []*schema.Column{
  285. {Name: "id", Type: field.TypeUint64, Increment: true},
  286. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  287. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  288. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  289. {Name: "title", Type: field.TypeString, Size: 1000, Comment: "title | 标题"},
  290. {Name: "avatar", Type: field.TypeString, Comment: "avatar | 头像"},
  291. {Name: "tags", Type: field.TypeString, Comment: "tags | 个人标签"},
  292. {Name: "hire_count", Type: field.TypeInt, Comment: "hire_count | 被雇佣次数", Default: 0},
  293. {Name: "service_count", Type: field.TypeInt, Comment: "service_count | 已服务次数", Default: 0},
  294. {Name: "achievement_count", Type: field.TypeInt, Comment: "achievement_count | 业绩单数", Default: 0},
  295. {Name: "intro", Type: field.TypeString, Comment: "intro | 个人介绍", Default: ""},
  296. {Name: "estimate", Type: field.TypeString, Comment: "estimate | 自我评价", Default: ""},
  297. {Name: "skill", Type: field.TypeString, Comment: "skill | 技能卡", Default: ""},
  298. {Name: "ability_type", Type: field.TypeString, Comment: "ability_type | 能力类型", Default: ""},
  299. {Name: "scene", Type: field.TypeString, Comment: "scene | 使用场景", Default: ""},
  300. {Name: "switch_in", Type: field.TypeString, Comment: "switch_in | 支持介入", Default: ""},
  301. {Name: "video_url", Type: field.TypeString, Comment: "video_url | 视频地址", Default: ""},
  302. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  303. {Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
  304. {Name: "api_base", Type: field.TypeString, Comment: "api_base", Default: ""},
  305. {Name: "api_key", Type: field.TypeString, Comment: "api_key", Default: ""},
  306. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  307. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  308. {Name: "chat_url", Type: field.TypeString, Comment: "聊天URL"},
  309. }
  310. // EmployeeTable holds the schema information for the "employee" table.
  311. EmployeeTable = &schema.Table{
  312. Name: "employee",
  313. Columns: EmployeeColumns,
  314. PrimaryKey: []*schema.Column{EmployeeColumns[0]},
  315. Indexes: []*schema.Index{
  316. {
  317. Name: "employee_organization_id",
  318. Unique: false,
  319. Columns: []*schema.Column{EmployeeColumns[17]},
  320. },
  321. },
  322. }
  323. // EmployeeConfigColumns holds the columns for the "employee_config" table.
  324. EmployeeConfigColumns = []*schema.Column{
  325. {Name: "id", Type: field.TypeUint64, Increment: true},
  326. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  327. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  328. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  329. {Name: "stype", Type: field.TypeString, Comment: "类型:scene-场景 switch_in-接入方式", Default: ""},
  330. {Name: "title", Type: field.TypeString, Comment: "标题", Default: ""},
  331. {Name: "photo", Type: field.TypeString, Comment: "图片地址", Default: ""},
  332. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  333. }
  334. // EmployeeConfigTable holds the schema information for the "employee_config" table.
  335. EmployeeConfigTable = &schema.Table{
  336. Name: "employee_config",
  337. Columns: EmployeeConfigColumns,
  338. PrimaryKey: []*schema.Column{EmployeeConfigColumns[0]},
  339. Indexes: []*schema.Index{
  340. {
  341. Name: "employeeconfig_stype",
  342. Unique: false,
  343. Columns: []*schema.Column{EmployeeConfigColumns[4]},
  344. },
  345. },
  346. }
  347. // LabelColumns holds the columns for the "label" table.
  348. LabelColumns = []*schema.Column{
  349. {Name: "id", Type: field.TypeUint64, Increment: true},
  350. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  351. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  352. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  353. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  354. {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""},
  355. {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1},
  356. {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1},
  357. {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""},
  358. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  359. }
  360. // LabelTable holds the schema information for the "label" table.
  361. LabelTable = &schema.Table{
  362. Name: "label",
  363. Columns: LabelColumns,
  364. PrimaryKey: []*schema.Column{LabelColumns[0]},
  365. Indexes: []*schema.Index{
  366. {
  367. Name: "label_name_from_mode",
  368. Unique: true,
  369. Columns: []*schema.Column{LabelColumns[5], LabelColumns[6], LabelColumns[7]},
  370. },
  371. },
  372. }
  373. // LabelRelationshipColumns holds the columns for the "label_relationship" table.
  374. LabelRelationshipColumns = []*schema.Column{
  375. {Name: "id", Type: field.TypeUint64, Increment: true},
  376. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  377. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  378. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  379. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  380. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  381. {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
  382. {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
  383. }
  384. // LabelRelationshipTable holds the schema information for the "label_relationship" table.
  385. LabelRelationshipTable = &schema.Table{
  386. Name: "label_relationship",
  387. Columns: LabelRelationshipColumns,
  388. PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
  389. ForeignKeys: []*schema.ForeignKey{
  390. {
  391. Symbol: "label_relationship_contact_contact_relationships",
  392. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  393. RefColumns: []*schema.Column{ContactColumns[0]},
  394. OnDelete: schema.NoAction,
  395. },
  396. {
  397. Symbol: "label_relationship_label_label_relationships",
  398. Columns: []*schema.Column{LabelRelationshipColumns[7]},
  399. RefColumns: []*schema.Column{LabelColumns[0]},
  400. OnDelete: schema.NoAction,
  401. },
  402. },
  403. Indexes: []*schema.Index{
  404. {
  405. Name: "labelrelationship_label_id",
  406. Unique: false,
  407. Columns: []*schema.Column{LabelRelationshipColumns[7]},
  408. },
  409. {
  410. Name: "labelrelationship_contact_id",
  411. Unique: false,
  412. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  413. },
  414. },
  415. }
  416. // MessagesColumns holds the columns for the "messages" table.
  417. MessagesColumns = []*schema.Column{
  418. {Name: "id", Type: field.TypeInt, Increment: true},
  419. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  420. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  421. {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
  422. }
  423. // MessagesTable holds the schema information for the "messages" table.
  424. MessagesTable = &schema.Table{
  425. Name: "messages",
  426. Columns: MessagesColumns,
  427. PrimaryKey: []*schema.Column{MessagesColumns[0]},
  428. }
  429. // MessageRecordsColumns holds the columns for the "message_records" table.
  430. MessageRecordsColumns = []*schema.Column{
  431. {Name: "id", Type: field.TypeUint64, Increment: true},
  432. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  433. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  434. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  435. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  436. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  437. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  438. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  439. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  440. {Name: "meta", Type: field.TypeJSON, Nullable: true, Comment: "元数据"},
  441. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  442. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  443. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  444. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  445. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  446. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  447. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  448. }
  449. // MessageRecordsTable holds the schema information for the "message_records" table.
  450. MessageRecordsTable = &schema.Table{
  451. Name: "message_records",
  452. Columns: MessageRecordsColumns,
  453. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  454. ForeignKeys: []*schema.ForeignKey{
  455. {
  456. Symbol: "message_records_contact_contact_messages",
  457. Columns: []*schema.Column{MessageRecordsColumns[14]},
  458. RefColumns: []*schema.Column{ContactColumns[0]},
  459. OnDelete: schema.SetNull,
  460. },
  461. {
  462. Symbol: "message_records_sop_node_node_messages",
  463. Columns: []*schema.Column{MessageRecordsColumns[15]},
  464. RefColumns: []*schema.Column{SopNodeColumns[0]},
  465. OnDelete: schema.SetNull,
  466. },
  467. {
  468. Symbol: "message_records_sop_stage_stage_messages",
  469. Columns: []*schema.Column{MessageRecordsColumns[16]},
  470. RefColumns: []*schema.Column{SopStageColumns[0]},
  471. OnDelete: schema.SetNull,
  472. },
  473. },
  474. Indexes: []*schema.Index{
  475. {
  476. Name: "messagerecords_source_type",
  477. Unique: false,
  478. Columns: []*schema.Column{MessageRecordsColumns[12]},
  479. },
  480. },
  481. }
  482. // MsgColumns holds the columns for the "msg" table.
  483. MsgColumns = []*schema.Column{
  484. {Name: "id", Type: field.TypeUint64, Increment: true},
  485. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  486. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  487. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  488. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用"},
  489. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  490. {Name: "toid", Type: field.TypeString, Nullable: true, Comment: "接收人微信ID/群ID"},
  491. {Name: "msgtype", Type: field.TypeInt32, Nullable: true, Comment: "消息类型"},
  492. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "消息"},
  493. {Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号"},
  494. }
  495. // MsgTable holds the schema information for the "msg" table.
  496. MsgTable = &schema.Table{
  497. Name: "msg",
  498. Columns: MsgColumns,
  499. PrimaryKey: []*schema.Column{MsgColumns[0]},
  500. Indexes: []*schema.Index{
  501. {
  502. Name: "msg_batch_no",
  503. Unique: false,
  504. Columns: []*schema.Column{MsgColumns[9]},
  505. },
  506. {
  507. Name: "msg_id",
  508. Unique: false,
  509. Columns: []*schema.Column{MsgColumns[0]},
  510. },
  511. {
  512. Name: "msg_status",
  513. Unique: false,
  514. Columns: []*schema.Column{MsgColumns[4]},
  515. },
  516. },
  517. }
  518. // ServerColumns holds the columns for the "server" table.
  519. ServerColumns = []*schema.Column{
  520. {Name: "id", Type: field.TypeUint64, Increment: true},
  521. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  522. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  523. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  524. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  525. {Name: "name", Type: field.TypeString, Comment: "名称"},
  526. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  527. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  528. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  529. }
  530. // ServerTable holds the schema information for the "server" table.
  531. ServerTable = &schema.Table{
  532. Name: "server",
  533. Columns: ServerColumns,
  534. PrimaryKey: []*schema.Column{ServerColumns[0]},
  535. Indexes: []*schema.Index{
  536. {
  537. Name: "server_name",
  538. Unique: false,
  539. Columns: []*schema.Column{ServerColumns[5]},
  540. },
  541. {
  542. Name: "server_private_ip",
  543. Unique: false,
  544. Columns: []*schema.Column{ServerColumns[7]},
  545. },
  546. {
  547. Name: "server_public_ip",
  548. Unique: true,
  549. Columns: []*schema.Column{ServerColumns[6]},
  550. },
  551. },
  552. }
  553. // SopNodeColumns holds the columns for the "sop_node" table.
  554. SopNodeColumns = []*schema.Column{
  555. {Name: "id", Type: field.TypeUint64, Increment: true},
  556. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  557. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  558. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  559. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  560. {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
  561. {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
  562. {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
  563. {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
  564. {Name: "no_reply_condition", Type: field.TypeUint64, Comment: "超时触发时间(分钟)", Default: 0},
  565. {Name: "no_reply_unit", Type: field.TypeString, Comment: "超时触发时间单位", Default: ""},
  566. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  567. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  568. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  569. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  570. {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
  571. }
  572. // SopNodeTable holds the schema information for the "sop_node" table.
  573. SopNodeTable = &schema.Table{
  574. Name: "sop_node",
  575. Columns: SopNodeColumns,
  576. PrimaryKey: []*schema.Column{SopNodeColumns[0]},
  577. ForeignKeys: []*schema.ForeignKey{
  578. {
  579. Symbol: "sop_node_sop_stage_stage_nodes",
  580. Columns: []*schema.Column{SopNodeColumns[15]},
  581. RefColumns: []*schema.Column{SopStageColumns[0]},
  582. OnDelete: schema.NoAction,
  583. },
  584. },
  585. Indexes: []*schema.Index{
  586. {
  587. Name: "sopnode_name",
  588. Unique: false,
  589. Columns: []*schema.Column{SopNodeColumns[6]},
  590. },
  591. },
  592. }
  593. // SopStageColumns holds the columns for the "sop_stage" table.
  594. SopStageColumns = []*schema.Column{
  595. {Name: "id", Type: field.TypeUint64, Increment: true},
  596. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  597. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  598. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  599. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  600. {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
  601. {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
  602. {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
  603. {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
  604. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  605. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  606. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  607. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  608. {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
  609. {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
  610. }
  611. // SopStageTable holds the schema information for the "sop_stage" table.
  612. SopStageTable = &schema.Table{
  613. Name: "sop_stage",
  614. Columns: SopStageColumns,
  615. PrimaryKey: []*schema.Column{SopStageColumns[0]},
  616. ForeignKeys: []*schema.ForeignKey{
  617. {
  618. Symbol: "sop_stage_sop_task_task_stages",
  619. Columns: []*schema.Column{SopStageColumns[14]},
  620. RefColumns: []*schema.Column{SopTaskColumns[0]},
  621. OnDelete: schema.NoAction,
  622. },
  623. },
  624. Indexes: []*schema.Index{
  625. {
  626. Name: "sopstage_name",
  627. Unique: false,
  628. Columns: []*schema.Column{SopStageColumns[5]},
  629. },
  630. },
  631. }
  632. // SopTaskColumns holds the columns for the "sop_task" table.
  633. SopTaskColumns = []*schema.Column{
  634. {Name: "id", Type: field.TypeUint64, Increment: true},
  635. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  636. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  637. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  638. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  639. {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
  640. {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
  641. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
  642. {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
  643. {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
  644. {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
  645. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  646. {Name: "token", Type: field.TypeJSON, Nullable: true, Comment: "Token"},
  647. }
  648. // SopTaskTable holds the schema information for the "sop_task" table.
  649. SopTaskTable = &schema.Table{
  650. Name: "sop_task",
  651. Columns: SopTaskColumns,
  652. PrimaryKey: []*schema.Column{SopTaskColumns[0]},
  653. Indexes: []*schema.Index{
  654. {
  655. Name: "soptask_name",
  656. Unique: false,
  657. Columns: []*schema.Column{SopTaskColumns[5]},
  658. },
  659. {
  660. Name: "soptask_token",
  661. Unique: false,
  662. Columns: []*schema.Column{SopTaskColumns[12]},
  663. },
  664. },
  665. }
  666. // TokenColumns holds the columns for the "token" table.
  667. TokenColumns = []*schema.Column{
  668. {Name: "id", Type: field.TypeUint64, Increment: true},
  669. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  670. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  671. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  672. {Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
  673. {Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
  674. {Name: "mac", Type: field.TypeString, Nullable: true, Comment: "Mac地址", Default: ""},
  675. {Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
  676. {Name: "custom_agent_base", Type: field.TypeString, Nullable: true, Comment: "定制agent服务地址", Default: ""},
  677. {Name: "custom_agent_key", Type: field.TypeString, Nullable: true, Comment: "定制agent服务密钥", Default: ""},
  678. {Name: "openai_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  679. {Name: "openai_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  680. {Name: "agent_id", Type: field.TypeUint64, Comment: "智能体ID", Default: 0},
  681. }
  682. // TokenTable holds the schema information for the "token" table.
  683. TokenTable = &schema.Table{
  684. Name: "token",
  685. Columns: TokenColumns,
  686. PrimaryKey: []*schema.Column{TokenColumns[0]},
  687. ForeignKeys: []*schema.ForeignKey{
  688. {
  689. Symbol: "token_agent_token_agent",
  690. Columns: []*schema.Column{TokenColumns[12]},
  691. RefColumns: []*schema.Column{AgentColumns[0]},
  692. OnDelete: schema.NoAction,
  693. },
  694. },
  695. Indexes: []*schema.Index{
  696. {
  697. Name: "token_token",
  698. Unique: true,
  699. Columns: []*schema.Column{TokenColumns[5]},
  700. },
  701. },
  702. }
  703. // TutorialColumns holds the columns for the "tutorial" table.
  704. TutorialColumns = []*schema.Column{
  705. {Name: "id", Type: field.TypeUint64, Increment: true},
  706. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  707. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  708. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  709. {Name: "index", Type: field.TypeInt, Comment: "index | 序号"},
  710. {Name: "title", Type: field.TypeString, Comment: "title | 标题"},
  711. {Name: "content", Type: field.TypeString, Comment: "content | 内容"},
  712. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  713. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  714. }
  715. // TutorialTable holds the schema information for the "tutorial" table.
  716. TutorialTable = &schema.Table{
  717. Name: "tutorial",
  718. Columns: TutorialColumns,
  719. PrimaryKey: []*schema.Column{TutorialColumns[0]},
  720. ForeignKeys: []*schema.ForeignKey{
  721. {
  722. Symbol: "tutorial_employee_em_tutorial",
  723. Columns: []*schema.Column{TutorialColumns[8]},
  724. RefColumns: []*schema.Column{EmployeeColumns[0]},
  725. OnDelete: schema.NoAction,
  726. },
  727. },
  728. Indexes: []*schema.Index{
  729. {
  730. Name: "tutorial_employee_id",
  731. Unique: false,
  732. Columns: []*schema.Column{TutorialColumns[8]},
  733. },
  734. },
  735. }
  736. // UsageDetailColumns holds the columns for the "usage_detail" table.
  737. UsageDetailColumns = []*schema.Column{
  738. {Name: "id", Type: field.TypeUint64, Increment: true},
  739. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  740. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  741. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  742. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  743. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  744. {Name: "receiver_id", Type: field.TypeString, Comment: "微信id或open_id", Default: ""},
  745. {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},
  746. {Name: "session_id", Type: field.TypeUint64, Nullable: true, Comment: "名片会话id", Default: 1},
  747. {Name: "request", Type: field.TypeString, Comment: "请求内容", Default: ""},
  748. {Name: "response", Type: field.TypeString, Comment: "响应内容", Default: ""},
  749. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  750. {Name: "prompt_tokens", Type: field.TypeUint64, Nullable: true, Comment: "请求token数", Default: 0},
  751. {Name: "completion_tokens", Type: field.TypeUint64, Nullable: true, Comment: "响应token数", Default: 0},
  752. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  753. }
  754. // UsageDetailTable holds the schema information for the "usage_detail" table.
  755. UsageDetailTable = &schema.Table{
  756. Name: "usage_detail",
  757. Columns: UsageDetailColumns,
  758. PrimaryKey: []*schema.Column{UsageDetailColumns[0]},
  759. Indexes: []*schema.Index{
  760. {
  761. Name: "usagedetail_bot_id",
  762. Unique: false,
  763. Columns: []*schema.Column{UsageDetailColumns[5]},
  764. },
  765. {
  766. Name: "usagedetail_organization_id",
  767. Unique: false,
  768. Columns: []*schema.Column{UsageDetailColumns[14]},
  769. },
  770. },
  771. }
  772. // UsageStatisticDayColumns holds the columns for the "usage_statistic_day" table.
  773. UsageStatisticDayColumns = []*schema.Column{
  774. {Name: "id", Type: field.TypeUint64, Increment: true},
  775. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  776. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  777. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  778. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  779. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月日"},
  780. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  781. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  782. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  783. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  784. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  785. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  786. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  787. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  788. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  789. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  790. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  791. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  792. }
  793. // UsageStatisticDayTable holds the schema information for the "usage_statistic_day" table.
  794. UsageStatisticDayTable = &schema.Table{
  795. Name: "usage_statistic_day",
  796. Columns: UsageStatisticDayColumns,
  797. PrimaryKey: []*schema.Column{UsageStatisticDayColumns[0]},
  798. Indexes: []*schema.Index{
  799. {
  800. Name: "usagestatisticday_addtime",
  801. Unique: false,
  802. Columns: []*schema.Column{UsageStatisticDayColumns[5]},
  803. },
  804. {
  805. Name: "usagestatisticday_bot_id",
  806. Unique: false,
  807. Columns: []*schema.Column{UsageStatisticDayColumns[7]},
  808. },
  809. },
  810. }
  811. // UsageStatisticHourColumns holds the columns for the "usage_statistic_hour" table.
  812. UsageStatisticHourColumns = []*schema.Column{
  813. {Name: "id", Type: field.TypeUint64, Increment: true},
  814. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  815. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  816. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  817. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  818. {Name: "addtime", Type: field.TypeUint64, Comment: "写入小时"},
  819. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  820. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  821. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  822. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  823. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  824. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  825. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  826. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  827. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  828. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  829. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  830. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  831. }
  832. // UsageStatisticHourTable holds the schema information for the "usage_statistic_hour" table.
  833. UsageStatisticHourTable = &schema.Table{
  834. Name: "usage_statistic_hour",
  835. Columns: UsageStatisticHourColumns,
  836. PrimaryKey: []*schema.Column{UsageStatisticHourColumns[0]},
  837. Indexes: []*schema.Index{
  838. {
  839. Name: "usagestatistichour_addtime",
  840. Unique: false,
  841. Columns: []*schema.Column{UsageStatisticHourColumns[5]},
  842. },
  843. {
  844. Name: "usagestatistichour_bot_id",
  845. Unique: false,
  846. Columns: []*schema.Column{UsageStatisticHourColumns[7]},
  847. },
  848. },
  849. }
  850. // UsageStatisticMonthColumns holds the columns for the "usage_statistic_month" table.
  851. UsageStatisticMonthColumns = []*schema.Column{
  852. {Name: "id", Type: field.TypeUint64, Increment: true},
  853. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  854. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  855. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  856. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  857. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月"},
  858. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  859. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  860. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  861. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  862. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  863. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  864. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  865. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  866. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  867. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  868. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  869. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  870. }
  871. // UsageStatisticMonthTable holds the schema information for the "usage_statistic_month" table.
  872. UsageStatisticMonthTable = &schema.Table{
  873. Name: "usage_statistic_month",
  874. Columns: UsageStatisticMonthColumns,
  875. PrimaryKey: []*schema.Column{UsageStatisticMonthColumns[0]},
  876. Indexes: []*schema.Index{
  877. {
  878. Name: "usagestatisticmonth_addtime",
  879. Unique: false,
  880. Columns: []*schema.Column{UsageStatisticMonthColumns[5]},
  881. },
  882. {
  883. Name: "usagestatisticmonth_bot_id",
  884. Unique: false,
  885. Columns: []*schema.Column{UsageStatisticMonthColumns[7]},
  886. },
  887. },
  888. }
  889. // UsageTotalColumns holds the columns for the "usage_total" table.
  890. UsageTotalColumns = []*schema.Column{
  891. {Name: "id", Type: field.TypeUint64, Increment: true},
  892. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  893. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  894. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  895. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  896. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  897. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  898. {Name: "start_index", Type: field.TypeUint64, Nullable: true, Comment: "重制后的起始usage_detail 索引", Default: 0},
  899. {Name: "end_index", Type: field.TypeUint64, Nullable: true, Comment: "usage_detail 索引", Default: 0},
  900. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  901. }
  902. // UsageTotalTable holds the schema information for the "usage_total" table.
  903. UsageTotalTable = &schema.Table{
  904. Name: "usage_total",
  905. Columns: UsageTotalColumns,
  906. PrimaryKey: []*schema.Column{UsageTotalColumns[0]},
  907. Indexes: []*schema.Index{
  908. {
  909. Name: "usagetotal_bot_id",
  910. Unique: false,
  911. Columns: []*schema.Column{UsageTotalColumns[5]},
  912. },
  913. {
  914. Name: "usagetotal_organization_id",
  915. Unique: false,
  916. Columns: []*schema.Column{UsageTotalColumns[9]},
  917. },
  918. },
  919. }
  920. // WorkExperienceColumns holds the columns for the "work_experience" table.
  921. WorkExperienceColumns = []*schema.Column{
  922. {Name: "id", Type: field.TypeUint64, Increment: true},
  923. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  924. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  925. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  926. {Name: "start_date", Type: field.TypeTime, Comment: "start_date | 开始时间"},
  927. {Name: "end_date", Type: field.TypeTime, Comment: "end_date | 结束时间"},
  928. {Name: "company", Type: field.TypeString, Comment: "company | 公司名"},
  929. {Name: "experience", Type: field.TypeString, Size: 2147483647, Comment: "experience | 工作内容"},
  930. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  931. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  932. }
  933. // WorkExperienceTable holds the schema information for the "work_experience" table.
  934. WorkExperienceTable = &schema.Table{
  935. Name: "work_experience",
  936. Columns: WorkExperienceColumns,
  937. PrimaryKey: []*schema.Column{WorkExperienceColumns[0]},
  938. ForeignKeys: []*schema.ForeignKey{
  939. {
  940. Symbol: "work_experience_employee_em_work_experiences",
  941. Columns: []*schema.Column{WorkExperienceColumns[9]},
  942. RefColumns: []*schema.Column{EmployeeColumns[0]},
  943. OnDelete: schema.NoAction,
  944. },
  945. },
  946. Indexes: []*schema.Index{
  947. {
  948. Name: "workexperience_employee_id",
  949. Unique: false,
  950. Columns: []*schema.Column{WorkExperienceColumns[9]},
  951. },
  952. },
  953. }
  954. // WpChatroomColumns holds the columns for the "wp_chatroom" table.
  955. WpChatroomColumns = []*schema.Column{
  956. {Name: "id", Type: field.TypeUint64, Increment: true},
  957. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  958. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  959. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  960. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  961. {Name: "chatroom_id", Type: field.TypeString, Comment: "群id", Default: ""},
  962. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  963. {Name: "owner", Type: field.TypeString, Comment: "群主", Default: ""},
  964. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  965. {Name: "member_list", Type: field.TypeJSON, Comment: "群成员"},
  966. }
  967. // WpChatroomTable holds the schema information for the "wp_chatroom" table.
  968. WpChatroomTable = &schema.Table{
  969. Name: "wp_chatroom",
  970. Columns: WpChatroomColumns,
  971. PrimaryKey: []*schema.Column{WpChatroomColumns[0]},
  972. Indexes: []*schema.Index{
  973. {
  974. Name: "wpchatroom_wx_wxid_chatroom_id",
  975. Unique: false,
  976. Columns: []*schema.Column{WpChatroomColumns[4], WpChatroomColumns[5]},
  977. },
  978. },
  979. }
  980. // WpChatroomMemberColumns holds the columns for the "wp_chatroom_member" table.
  981. WpChatroomMemberColumns = []*schema.Column{
  982. {Name: "id", Type: field.TypeUint64, Increment: true},
  983. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  984. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  985. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  986. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  987. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  988. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  989. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  990. }
  991. // WpChatroomMemberTable holds the schema information for the "wp_chatroom_member" table.
  992. WpChatroomMemberTable = &schema.Table{
  993. Name: "wp_chatroom_member",
  994. Columns: WpChatroomMemberColumns,
  995. PrimaryKey: []*schema.Column{WpChatroomMemberColumns[0]},
  996. Indexes: []*schema.Index{
  997. {
  998. Name: "wpchatroommember_wx_wxid_wxid",
  999. Unique: false,
  1000. Columns: []*schema.Column{WpChatroomMemberColumns[4], WpChatroomMemberColumns[5]},
  1001. },
  1002. },
  1003. }
  1004. // WxColumns holds the columns for the "wx" table.
  1005. WxColumns = []*schema.Column{
  1006. {Name: "id", Type: field.TypeUint64, Increment: true},
  1007. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1008. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1009. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1010. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1011. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  1012. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  1013. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  1014. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1015. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  1016. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  1017. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  1018. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  1019. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  1020. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  1021. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  1022. {Name: "allow_list", Type: field.TypeJSON, Comment: "白名单"},
  1023. {Name: "group_allow_list", Type: field.TypeJSON, Comment: "群白名单"},
  1024. {Name: "block_list", Type: field.TypeJSON, Comment: "黑名单"},
  1025. {Name: "group_block_list", Type: field.TypeJSON, Comment: "群黑名单"},
  1026. {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
  1027. {Name: "agent_base_wx_agent", Type: field.TypeString, Nullable: true},
  1028. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  1029. }
  1030. // WxTable holds the schema information for the "wx" table.
  1031. WxTable = &schema.Table{
  1032. Name: "wx",
  1033. Columns: WxColumns,
  1034. PrimaryKey: []*schema.Column{WxColumns[0]},
  1035. ForeignKeys: []*schema.ForeignKey{
  1036. {
  1037. Symbol: "wx_agent_wx_agent",
  1038. Columns: []*schema.Column{WxColumns[20]},
  1039. RefColumns: []*schema.Column{AgentColumns[0]},
  1040. OnDelete: schema.NoAction,
  1041. },
  1042. {
  1043. Symbol: "wx_agent_base_wx_agent",
  1044. Columns: []*schema.Column{WxColumns[21]},
  1045. RefColumns: []*schema.Column{AgentBaseColumns[0]},
  1046. OnDelete: schema.SetNull,
  1047. },
  1048. {
  1049. Symbol: "wx_server_wxs",
  1050. Columns: []*schema.Column{WxColumns[22]},
  1051. RefColumns: []*schema.Column{ServerColumns[0]},
  1052. OnDelete: schema.SetNull,
  1053. },
  1054. },
  1055. Indexes: []*schema.Index{
  1056. {
  1057. Name: "wx_server_id_port",
  1058. Unique: true,
  1059. Columns: []*schema.Column{WxColumns[22], WxColumns[5]},
  1060. },
  1061. {
  1062. Name: "wx_wxid",
  1063. Unique: true,
  1064. Columns: []*schema.Column{WxColumns[8]},
  1065. },
  1066. {
  1067. Name: "wx_account",
  1068. Unique: false,
  1069. Columns: []*schema.Column{WxColumns[9]},
  1070. },
  1071. {
  1072. Name: "wx_nickname",
  1073. Unique: false,
  1074. Columns: []*schema.Column{WxColumns[10]},
  1075. },
  1076. {
  1077. Name: "wx_tel",
  1078. Unique: false,
  1079. Columns: []*schema.Column{WxColumns[11]},
  1080. },
  1081. },
  1082. }
  1083. // WxCardColumns holds the columns for the "wx_card" table.
  1084. WxCardColumns = []*schema.Column{
  1085. {Name: "id", Type: field.TypeUint64, Increment: true},
  1086. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1087. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1088. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1089. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1090. {Name: "wx_user_id", Type: field.TypeUint64, Nullable: true, Comment: "wx表ID", Default: 0},
  1091. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1092. {Name: "logo", Type: field.TypeString, Comment: "logo", Default: ""},
  1093. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  1094. {Name: "company", Type: field.TypeString, Comment: "公司", Default: ""},
  1095. {Name: "address", Type: field.TypeString, Comment: "地址", Default: ""},
  1096. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1097. {Name: "official_account", Type: field.TypeString, Comment: "公众号", Default: ""},
  1098. {Name: "wechat_account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1099. {Name: "email", Type: field.TypeString, Nullable: true, Comment: "邮箱", Default: ""},
  1100. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "fastgpt-base"},
  1101. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "fastgpt-key"},
  1102. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  1103. {Name: "intro", Type: field.TypeString, Nullable: true, Comment: "个人介绍", Default: ""},
  1104. }
  1105. // WxCardTable holds the schema information for the "wx_card" table.
  1106. WxCardTable = &schema.Table{
  1107. Name: "wx_card",
  1108. Columns: WxCardColumns,
  1109. PrimaryKey: []*schema.Column{WxCardColumns[0]},
  1110. Indexes: []*schema.Index{
  1111. {
  1112. Name: "wxcard_user_id",
  1113. Unique: false,
  1114. Columns: []*schema.Column{WxCardColumns[4]},
  1115. },
  1116. {
  1117. Name: "wxcard_wx_user_id",
  1118. Unique: false,
  1119. Columns: []*schema.Column{WxCardColumns[5]},
  1120. },
  1121. },
  1122. }
  1123. // WxCardUserColumns holds the columns for the "wx_card_user" table.
  1124. WxCardUserColumns = []*schema.Column{
  1125. {Name: "id", Type: field.TypeUint64, Increment: true},
  1126. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1127. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1128. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1129. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1130. {Name: "account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1131. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1132. {Name: "nickname", Type: field.TypeString, Comment: "昵称", Default: ""},
  1133. {Name: "remark", Type: field.TypeString, Comment: "备注名", Default: ""},
  1134. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1135. {Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
  1136. {Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
  1137. {Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
  1138. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  1139. }
  1140. // WxCardUserTable holds the schema information for the "wx_card_user" table.
  1141. WxCardUserTable = &schema.Table{
  1142. Name: "wx_card_user",
  1143. Columns: WxCardUserColumns,
  1144. PrimaryKey: []*schema.Column{WxCardUserColumns[0]},
  1145. Indexes: []*schema.Index{
  1146. {
  1147. Name: "wxcarduser_wxid_open_id",
  1148. Unique: false,
  1149. Columns: []*schema.Column{WxCardUserColumns[4], WxCardUserColumns[10]},
  1150. },
  1151. },
  1152. }
  1153. // WxCardVisitColumns holds the columns for the "wx_card_visit" table.
  1154. WxCardVisitColumns = []*schema.Column{
  1155. {Name: "id", Type: field.TypeUint64, Increment: true},
  1156. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1157. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1158. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1159. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1160. {Name: "bot_id", Type: field.TypeUint64, Comment: "被访ID", Default: 0},
  1161. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序 3-智能体", Default: 0},
  1162. }
  1163. // WxCardVisitTable holds the schema information for the "wx_card_visit" table.
  1164. WxCardVisitTable = &schema.Table{
  1165. Name: "wx_card_visit",
  1166. Columns: WxCardVisitColumns,
  1167. PrimaryKey: []*schema.Column{WxCardVisitColumns[0]},
  1168. Indexes: []*schema.Index{
  1169. {
  1170. Name: "wxcardvisit_user_id",
  1171. Unique: false,
  1172. Columns: []*schema.Column{WxCardVisitColumns[4]},
  1173. },
  1174. {
  1175. Name: "wxcardvisit_bot_id_bot_type",
  1176. Unique: false,
  1177. Columns: []*schema.Column{WxCardVisitColumns[5], WxCardVisitColumns[6]},
  1178. },
  1179. },
  1180. }
  1181. // Tables holds all the tables in the schema.
  1182. Tables = []*schema.Table{
  1183. AgentTable,
  1184. AgentBaseTable,
  1185. AliyunAvatarTable,
  1186. AllocAgentTable,
  1187. BatchMsgTable,
  1188. CategoryTable,
  1189. ChatRecordsTable,
  1190. ChatSessionTable,
  1191. ContactTable,
  1192. EmployeeTable,
  1193. EmployeeConfigTable,
  1194. LabelTable,
  1195. LabelRelationshipTable,
  1196. MessagesTable,
  1197. MessageRecordsTable,
  1198. MsgTable,
  1199. ServerTable,
  1200. SopNodeTable,
  1201. SopStageTable,
  1202. SopTaskTable,
  1203. TokenTable,
  1204. TutorialTable,
  1205. UsageDetailTable,
  1206. UsageStatisticDayTable,
  1207. UsageStatisticHourTable,
  1208. UsageStatisticMonthTable,
  1209. UsageTotalTable,
  1210. WorkExperienceTable,
  1211. WpChatroomTable,
  1212. WpChatroomMemberTable,
  1213. WxTable,
  1214. WxCardTable,
  1215. WxCardUserTable,
  1216. WxCardVisitTable,
  1217. }
  1218. )
  1219. func init() {
  1220. AgentTable.Annotation = &entsql.Annotation{
  1221. Table: "agent",
  1222. }
  1223. AgentBaseTable.Annotation = &entsql.Annotation{
  1224. Table: "agent_base",
  1225. }
  1226. AliyunAvatarTable.Annotation = &entsql.Annotation{
  1227. Table: "aliyun_avatar",
  1228. }
  1229. AllocAgentTable.Annotation = &entsql.Annotation{
  1230. Table: "alloc_agent",
  1231. }
  1232. BatchMsgTable.Annotation = &entsql.Annotation{
  1233. Table: "batch_msg",
  1234. }
  1235. CategoryTable.Annotation = &entsql.Annotation{
  1236. Table: "category",
  1237. }
  1238. ChatRecordsTable.Annotation = &entsql.Annotation{
  1239. Table: "chat_records",
  1240. }
  1241. ChatSessionTable.Annotation = &entsql.Annotation{
  1242. Table: "chat_session",
  1243. }
  1244. ContactTable.Annotation = &entsql.Annotation{
  1245. Table: "contact",
  1246. }
  1247. EmployeeTable.Annotation = &entsql.Annotation{
  1248. Table: "employee",
  1249. }
  1250. EmployeeConfigTable.Annotation = &entsql.Annotation{
  1251. Table: "employee_config",
  1252. }
  1253. LabelTable.Annotation = &entsql.Annotation{
  1254. Table: "label",
  1255. }
  1256. LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
  1257. LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
  1258. LabelRelationshipTable.Annotation = &entsql.Annotation{
  1259. Table: "label_relationship",
  1260. }
  1261. MessagesTable.Annotation = &entsql.Annotation{
  1262. Table: "messages",
  1263. }
  1264. MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
  1265. MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
  1266. MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
  1267. MessageRecordsTable.Annotation = &entsql.Annotation{
  1268. Table: "message_records",
  1269. }
  1270. MsgTable.Annotation = &entsql.Annotation{
  1271. Table: "msg",
  1272. }
  1273. ServerTable.Annotation = &entsql.Annotation{
  1274. Table: "server",
  1275. }
  1276. SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
  1277. SopNodeTable.Annotation = &entsql.Annotation{
  1278. Table: "sop_node",
  1279. }
  1280. SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
  1281. SopStageTable.Annotation = &entsql.Annotation{
  1282. Table: "sop_stage",
  1283. }
  1284. SopTaskTable.Annotation = &entsql.Annotation{
  1285. Table: "sop_task",
  1286. }
  1287. TokenTable.ForeignKeys[0].RefTable = AgentTable
  1288. TokenTable.Annotation = &entsql.Annotation{
  1289. Table: "token",
  1290. }
  1291. TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
  1292. TutorialTable.Annotation = &entsql.Annotation{
  1293. Table: "tutorial",
  1294. }
  1295. UsageDetailTable.Annotation = &entsql.Annotation{
  1296. Table: "usage_detail",
  1297. }
  1298. UsageStatisticDayTable.Annotation = &entsql.Annotation{
  1299. Table: "usage_statistic_day",
  1300. }
  1301. UsageStatisticHourTable.Annotation = &entsql.Annotation{
  1302. Table: "usage_statistic_hour",
  1303. }
  1304. UsageStatisticMonthTable.Annotation = &entsql.Annotation{
  1305. Table: "usage_statistic_month",
  1306. }
  1307. UsageTotalTable.Annotation = &entsql.Annotation{
  1308. Table: "usage_total",
  1309. }
  1310. WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
  1311. WorkExperienceTable.Annotation = &entsql.Annotation{
  1312. Table: "work_experience",
  1313. }
  1314. WpChatroomTable.Annotation = &entsql.Annotation{
  1315. Table: "wp_chatroom",
  1316. }
  1317. WpChatroomMemberTable.Annotation = &entsql.Annotation{
  1318. Table: "wp_chatroom_member",
  1319. }
  1320. WxTable.ForeignKeys[0].RefTable = AgentTable
  1321. WxTable.ForeignKeys[1].RefTable = AgentBaseTable
  1322. WxTable.ForeignKeys[2].RefTable = ServerTable
  1323. WxTable.Annotation = &entsql.Annotation{
  1324. Table: "wx",
  1325. }
  1326. WxCardTable.Annotation = &entsql.Annotation{
  1327. Table: "wx_card",
  1328. }
  1329. WxCardUserTable.Annotation = &entsql.Annotation{
  1330. Table: "wx_card_user",
  1331. }
  1332. WxCardVisitTable.Annotation = &entsql.Annotation{
  1333. Table: "wx_card_visit",
  1334. }
  1335. }