schema.go 88 KB

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