schema.go 72 KB

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