schema.go 64 KB

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