schema.go 69 KB

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