schema.go 84 KB

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