schema.go 75 KB

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