schema.go 80 KB

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