schema.go 62 KB

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