schema.go 76 KB

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