schema.go 80 KB

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