schema.go 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328
  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: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  351. {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
  352. {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
  353. }
  354. // LabelRelationshipTable holds the schema information for the "label_relationship" table.
  355. LabelRelationshipTable = &schema.Table{
  356. Name: "label_relationship",
  357. Columns: LabelRelationshipColumns,
  358. PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
  359. ForeignKeys: []*schema.ForeignKey{
  360. {
  361. Symbol: "label_relationship_contact_contact_relationships",
  362. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  363. RefColumns: []*schema.Column{ContactColumns[0]},
  364. OnDelete: schema.NoAction,
  365. },
  366. {
  367. Symbol: "label_relationship_label_label_relationships",
  368. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  369. RefColumns: []*schema.Column{LabelColumns[0]},
  370. OnDelete: schema.NoAction,
  371. },
  372. },
  373. Indexes: []*schema.Index{
  374. {
  375. Name: "labelrelationship_label_id",
  376. Unique: false,
  377. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  378. },
  379. {
  380. Name: "labelrelationship_contact_id",
  381. Unique: false,
  382. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  383. },
  384. },
  385. }
  386. // LabelTaggingColumns holds the columns for the "label_tagging" table.
  387. LabelTaggingColumns = []*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: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  392. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  393. {Name: "organization_id", Type: field.TypeUint64, Comment: "机构 ID", Default: 1},
  394. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  395. {Name: "conditions", Type: field.TypeString, Comment: "关键词", Default: ""},
  396. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  397. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  398. }
  399. // LabelTaggingTable holds the schema information for the "label_tagging" table.
  400. LabelTaggingTable = &schema.Table{
  401. Name: "label_tagging",
  402. Columns: LabelTaggingColumns,
  403. PrimaryKey: []*schema.Column{LabelTaggingColumns[0]},
  404. }
  405. // MessagesColumns holds the columns for the "messages" table.
  406. MessagesColumns = []*schema.Column{
  407. {Name: "id", Type: field.TypeInt, Increment: true},
  408. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  409. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  410. {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
  411. }
  412. // MessagesTable holds the schema information for the "messages" table.
  413. MessagesTable = &schema.Table{
  414. Name: "messages",
  415. Columns: MessagesColumns,
  416. PrimaryKey: []*schema.Column{MessagesColumns[0]},
  417. }
  418. // MessageRecordsColumns holds the columns for the "message_records" table.
  419. MessageRecordsColumns = []*schema.Column{
  420. {Name: "id", Type: field.TypeUint64, Increment: true},
  421. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  422. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  423. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  424. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  425. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  426. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  427. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  428. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  429. {Name: "meta", Type: field.TypeJSON, Nullable: true, Comment: "元数据"},
  430. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  431. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  432. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  433. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  434. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  435. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  436. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  437. }
  438. // MessageRecordsTable holds the schema information for the "message_records" table.
  439. MessageRecordsTable = &schema.Table{
  440. Name: "message_records",
  441. Columns: MessageRecordsColumns,
  442. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  443. ForeignKeys: []*schema.ForeignKey{
  444. {
  445. Symbol: "message_records_contact_contact_messages",
  446. Columns: []*schema.Column{MessageRecordsColumns[14]},
  447. RefColumns: []*schema.Column{ContactColumns[0]},
  448. OnDelete: schema.SetNull,
  449. },
  450. {
  451. Symbol: "message_records_sop_node_node_messages",
  452. Columns: []*schema.Column{MessageRecordsColumns[15]},
  453. RefColumns: []*schema.Column{SopNodeColumns[0]},
  454. OnDelete: schema.SetNull,
  455. },
  456. {
  457. Symbol: "message_records_sop_stage_stage_messages",
  458. Columns: []*schema.Column{MessageRecordsColumns[16]},
  459. RefColumns: []*schema.Column{SopStageColumns[0]},
  460. OnDelete: schema.SetNull,
  461. },
  462. },
  463. Indexes: []*schema.Index{
  464. {
  465. Name: "messagerecords_source_type",
  466. Unique: false,
  467. Columns: []*schema.Column{MessageRecordsColumns[12]},
  468. },
  469. },
  470. }
  471. // MsgColumns holds the columns for the "msg" table.
  472. MsgColumns = []*schema.Column{
  473. {Name: "id", Type: field.TypeUint64, Increment: true},
  474. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  475. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  476. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  477. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用"},
  478. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  479. {Name: "toid", Type: field.TypeString, Nullable: true, Comment: "接收人微信ID/群ID"},
  480. {Name: "msgtype", Type: field.TypeInt32, Nullable: true, Comment: "消息类型"},
  481. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "消息"},
  482. {Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号"},
  483. }
  484. // MsgTable holds the schema information for the "msg" table.
  485. MsgTable = &schema.Table{
  486. Name: "msg",
  487. Columns: MsgColumns,
  488. PrimaryKey: []*schema.Column{MsgColumns[0]},
  489. Indexes: []*schema.Index{
  490. {
  491. Name: "msg_batch_no",
  492. Unique: false,
  493. Columns: []*schema.Column{MsgColumns[9]},
  494. },
  495. {
  496. Name: "msg_id",
  497. Unique: false,
  498. Columns: []*schema.Column{MsgColumns[0]},
  499. },
  500. {
  501. Name: "msg_status",
  502. Unique: false,
  503. Columns: []*schema.Column{MsgColumns[4]},
  504. },
  505. },
  506. }
  507. // ServerColumns holds the columns for the "server" table.
  508. ServerColumns = []*schema.Column{
  509. {Name: "id", Type: field.TypeUint64, Increment: true},
  510. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  511. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  512. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  513. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  514. {Name: "name", Type: field.TypeString, Comment: "名称"},
  515. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  516. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  517. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  518. }
  519. // ServerTable holds the schema information for the "server" table.
  520. ServerTable = &schema.Table{
  521. Name: "server",
  522. Columns: ServerColumns,
  523. PrimaryKey: []*schema.Column{ServerColumns[0]},
  524. Indexes: []*schema.Index{
  525. {
  526. Name: "server_name",
  527. Unique: false,
  528. Columns: []*schema.Column{ServerColumns[5]},
  529. },
  530. {
  531. Name: "server_private_ip",
  532. Unique: false,
  533. Columns: []*schema.Column{ServerColumns[7]},
  534. },
  535. {
  536. Name: "server_public_ip",
  537. Unique: true,
  538. Columns: []*schema.Column{ServerColumns[6]},
  539. },
  540. },
  541. }
  542. // SopNodeColumns holds the columns for the "sop_node" table.
  543. SopNodeColumns = []*schema.Column{
  544. {Name: "id", Type: field.TypeUint64, Increment: true},
  545. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  546. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  547. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  548. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  549. {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
  550. {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
  551. {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
  552. {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
  553. {Name: "no_reply_condition", Type: field.TypeUint64, Comment: "超时触发时间(分钟)", Default: 0},
  554. {Name: "no_reply_unit", Type: field.TypeString, Comment: "超时触发时间单位", Default: ""},
  555. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  556. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  557. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  558. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  559. {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
  560. }
  561. // SopNodeTable holds the schema information for the "sop_node" table.
  562. SopNodeTable = &schema.Table{
  563. Name: "sop_node",
  564. Columns: SopNodeColumns,
  565. PrimaryKey: []*schema.Column{SopNodeColumns[0]},
  566. ForeignKeys: []*schema.ForeignKey{
  567. {
  568. Symbol: "sop_node_sop_stage_stage_nodes",
  569. Columns: []*schema.Column{SopNodeColumns[15]},
  570. RefColumns: []*schema.Column{SopStageColumns[0]},
  571. OnDelete: schema.NoAction,
  572. },
  573. },
  574. Indexes: []*schema.Index{
  575. {
  576. Name: "sopnode_name",
  577. Unique: false,
  578. Columns: []*schema.Column{SopNodeColumns[6]},
  579. },
  580. },
  581. }
  582. // SopStageColumns holds the columns for the "sop_stage" table.
  583. SopStageColumns = []*schema.Column{
  584. {Name: "id", Type: field.TypeUint64, Increment: true},
  585. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  586. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  587. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  588. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  589. {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
  590. {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
  591. {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
  592. {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
  593. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  594. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  595. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  596. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  597. {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
  598. {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
  599. }
  600. // SopStageTable holds the schema information for the "sop_stage" table.
  601. SopStageTable = &schema.Table{
  602. Name: "sop_stage",
  603. Columns: SopStageColumns,
  604. PrimaryKey: []*schema.Column{SopStageColumns[0]},
  605. ForeignKeys: []*schema.ForeignKey{
  606. {
  607. Symbol: "sop_stage_sop_task_task_stages",
  608. Columns: []*schema.Column{SopStageColumns[14]},
  609. RefColumns: []*schema.Column{SopTaskColumns[0]},
  610. OnDelete: schema.NoAction,
  611. },
  612. },
  613. Indexes: []*schema.Index{
  614. {
  615. Name: "sopstage_name",
  616. Unique: false,
  617. Columns: []*schema.Column{SopStageColumns[5]},
  618. },
  619. },
  620. }
  621. // SopTaskColumns holds the columns for the "sop_task" table.
  622. SopTaskColumns = []*schema.Column{
  623. {Name: "id", Type: field.TypeUint64, Increment: true},
  624. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  625. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  626. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  627. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  628. {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
  629. {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
  630. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
  631. {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
  632. {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
  633. {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
  634. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  635. {Name: "token", Type: field.TypeJSON, Nullable: true, Comment: "Token"},
  636. }
  637. // SopTaskTable holds the schema information for the "sop_task" table.
  638. SopTaskTable = &schema.Table{
  639. Name: "sop_task",
  640. Columns: SopTaskColumns,
  641. PrimaryKey: []*schema.Column{SopTaskColumns[0]},
  642. Indexes: []*schema.Index{
  643. {
  644. Name: "soptask_name",
  645. Unique: false,
  646. Columns: []*schema.Column{SopTaskColumns[5]},
  647. },
  648. {
  649. Name: "soptask_token",
  650. Unique: false,
  651. Columns: []*schema.Column{SopTaskColumns[12]},
  652. },
  653. },
  654. }
  655. // TokenColumns holds the columns for the "token" table.
  656. TokenColumns = []*schema.Column{
  657. {Name: "id", Type: field.TypeUint64, Increment: true},
  658. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  659. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  660. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  661. {Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
  662. {Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
  663. {Name: "mac", Type: field.TypeString, Nullable: true, Comment: "Mac地址", Default: ""},
  664. {Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
  665. {Name: "custom_agent_base", Type: field.TypeString, Nullable: true, Comment: "定制agent服务地址", Default: ""},
  666. {Name: "custom_agent_key", Type: field.TypeString, Nullable: true, Comment: "定制agent服务密钥", Default: ""},
  667. {Name: "openai_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  668. {Name: "openai_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  669. {Name: "agent_id", Type: field.TypeUint64, Comment: "智能体ID", Default: 0},
  670. }
  671. // TokenTable holds the schema information for the "token" table.
  672. TokenTable = &schema.Table{
  673. Name: "token",
  674. Columns: TokenColumns,
  675. PrimaryKey: []*schema.Column{TokenColumns[0]},
  676. ForeignKeys: []*schema.ForeignKey{
  677. {
  678. Symbol: "token_agent_token_agent",
  679. Columns: []*schema.Column{TokenColumns[12]},
  680. RefColumns: []*schema.Column{AgentColumns[0]},
  681. OnDelete: schema.NoAction,
  682. },
  683. },
  684. Indexes: []*schema.Index{
  685. {
  686. Name: "token_token",
  687. Unique: true,
  688. Columns: []*schema.Column{TokenColumns[5]},
  689. },
  690. },
  691. }
  692. // TutorialColumns holds the columns for the "tutorial" table.
  693. TutorialColumns = []*schema.Column{
  694. {Name: "id", Type: field.TypeUint64, Increment: true},
  695. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  696. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  697. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  698. {Name: "index", Type: field.TypeInt, Comment: "index | 序号"},
  699. {Name: "title", Type: field.TypeString, Comment: "title | 标题"},
  700. {Name: "content", Type: field.TypeString, Comment: "content | 内容"},
  701. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  702. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  703. }
  704. // TutorialTable holds the schema information for the "tutorial" table.
  705. TutorialTable = &schema.Table{
  706. Name: "tutorial",
  707. Columns: TutorialColumns,
  708. PrimaryKey: []*schema.Column{TutorialColumns[0]},
  709. ForeignKeys: []*schema.ForeignKey{
  710. {
  711. Symbol: "tutorial_employee_em_tutorial",
  712. Columns: []*schema.Column{TutorialColumns[8]},
  713. RefColumns: []*schema.Column{EmployeeColumns[0]},
  714. OnDelete: schema.NoAction,
  715. },
  716. },
  717. Indexes: []*schema.Index{
  718. {
  719. Name: "tutorial_employee_id",
  720. Unique: false,
  721. Columns: []*schema.Column{TutorialColumns[8]},
  722. },
  723. },
  724. }
  725. // UsageDetailColumns holds the columns for the "usage_detail" table.
  726. UsageDetailColumns = []*schema.Column{
  727. {Name: "id", Type: field.TypeUint64, Increment: true},
  728. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  729. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  730. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  731. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  732. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  733. {Name: "receiver_id", Type: field.TypeString, Comment: "微信id或open_id", Default: ""},
  734. {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},
  735. {Name: "session_id", Type: field.TypeUint64, Nullable: true, Comment: "名片会话id", Default: 1},
  736. {Name: "request", Type: field.TypeString, Comment: "请求内容", Default: ""},
  737. {Name: "response", Type: field.TypeString, Comment: "响应内容", Default: ""},
  738. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  739. {Name: "prompt_tokens", Type: field.TypeUint64, Nullable: true, Comment: "请求token数", Default: 0},
  740. {Name: "completion_tokens", Type: field.TypeUint64, Nullable: true, Comment: "响应token数", Default: 0},
  741. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  742. }
  743. // UsageDetailTable holds the schema information for the "usage_detail" table.
  744. UsageDetailTable = &schema.Table{
  745. Name: "usage_detail",
  746. Columns: UsageDetailColumns,
  747. PrimaryKey: []*schema.Column{UsageDetailColumns[0]},
  748. Indexes: []*schema.Index{
  749. {
  750. Name: "usagedetail_bot_id",
  751. Unique: false,
  752. Columns: []*schema.Column{UsageDetailColumns[5]},
  753. },
  754. {
  755. Name: "usagedetail_organization_id",
  756. Unique: false,
  757. Columns: []*schema.Column{UsageDetailColumns[14]},
  758. },
  759. },
  760. }
  761. // UsageStatisticDayColumns holds the columns for the "usage_statistic_day" table.
  762. UsageStatisticDayColumns = []*schema.Column{
  763. {Name: "id", Type: field.TypeUint64, Increment: true},
  764. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  765. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  766. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  767. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  768. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月日"},
  769. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  770. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  771. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  772. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  773. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  774. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  775. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  776. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  777. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  778. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  779. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  780. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  781. }
  782. // UsageStatisticDayTable holds the schema information for the "usage_statistic_day" table.
  783. UsageStatisticDayTable = &schema.Table{
  784. Name: "usage_statistic_day",
  785. Columns: UsageStatisticDayColumns,
  786. PrimaryKey: []*schema.Column{UsageStatisticDayColumns[0]},
  787. Indexes: []*schema.Index{
  788. {
  789. Name: "usagestatisticday_addtime",
  790. Unique: false,
  791. Columns: []*schema.Column{UsageStatisticDayColumns[5]},
  792. },
  793. {
  794. Name: "usagestatisticday_bot_id",
  795. Unique: false,
  796. Columns: []*schema.Column{UsageStatisticDayColumns[7]},
  797. },
  798. },
  799. }
  800. // UsageStatisticHourColumns holds the columns for the "usage_statistic_hour" table.
  801. UsageStatisticHourColumns = []*schema.Column{
  802. {Name: "id", Type: field.TypeUint64, Increment: true},
  803. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  804. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  805. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  806. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  807. {Name: "addtime", Type: field.TypeUint64, Comment: "写入小时"},
  808. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  809. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  810. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  811. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  812. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  813. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  814. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  815. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  816. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  817. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  818. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  819. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  820. }
  821. // UsageStatisticHourTable holds the schema information for the "usage_statistic_hour" table.
  822. UsageStatisticHourTable = &schema.Table{
  823. Name: "usage_statistic_hour",
  824. Columns: UsageStatisticHourColumns,
  825. PrimaryKey: []*schema.Column{UsageStatisticHourColumns[0]},
  826. Indexes: []*schema.Index{
  827. {
  828. Name: "usagestatistichour_addtime",
  829. Unique: false,
  830. Columns: []*schema.Column{UsageStatisticHourColumns[5]},
  831. },
  832. {
  833. Name: "usagestatistichour_bot_id",
  834. Unique: false,
  835. Columns: []*schema.Column{UsageStatisticHourColumns[7]},
  836. },
  837. },
  838. }
  839. // UsageStatisticMonthColumns holds the columns for the "usage_statistic_month" table.
  840. UsageStatisticMonthColumns = []*schema.Column{
  841. {Name: "id", Type: field.TypeUint64, Increment: true},
  842. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  843. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  844. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  845. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  846. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月"},
  847. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  848. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  849. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  850. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  851. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  852. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  853. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  854. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  855. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  856. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  857. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  858. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  859. }
  860. // UsageStatisticMonthTable holds the schema information for the "usage_statistic_month" table.
  861. UsageStatisticMonthTable = &schema.Table{
  862. Name: "usage_statistic_month",
  863. Columns: UsageStatisticMonthColumns,
  864. PrimaryKey: []*schema.Column{UsageStatisticMonthColumns[0]},
  865. Indexes: []*schema.Index{
  866. {
  867. Name: "usagestatisticmonth_addtime",
  868. Unique: false,
  869. Columns: []*schema.Column{UsageStatisticMonthColumns[5]},
  870. },
  871. {
  872. Name: "usagestatisticmonth_bot_id",
  873. Unique: false,
  874. Columns: []*schema.Column{UsageStatisticMonthColumns[7]},
  875. },
  876. },
  877. }
  878. // UsageTotalColumns holds the columns for the "usage_total" table.
  879. UsageTotalColumns = []*schema.Column{
  880. {Name: "id", Type: field.TypeUint64, Increment: true},
  881. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  882. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  883. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  884. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  885. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  886. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  887. {Name: "start_index", Type: field.TypeUint64, Nullable: true, Comment: "重制后的起始usage_detail 索引", Default: 0},
  888. {Name: "end_index", Type: field.TypeUint64, Nullable: true, Comment: "usage_detail 索引", Default: 0},
  889. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  890. }
  891. // UsageTotalTable holds the schema information for the "usage_total" table.
  892. UsageTotalTable = &schema.Table{
  893. Name: "usage_total",
  894. Columns: UsageTotalColumns,
  895. PrimaryKey: []*schema.Column{UsageTotalColumns[0]},
  896. Indexes: []*schema.Index{
  897. {
  898. Name: "usagetotal_bot_id",
  899. Unique: false,
  900. Columns: []*schema.Column{UsageTotalColumns[5]},
  901. },
  902. {
  903. Name: "usagetotal_organization_id",
  904. Unique: false,
  905. Columns: []*schema.Column{UsageTotalColumns[9]},
  906. },
  907. },
  908. }
  909. // WorkExperienceColumns holds the columns for the "work_experience" table.
  910. WorkExperienceColumns = []*schema.Column{
  911. {Name: "id", Type: field.TypeUint64, Increment: true},
  912. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  913. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  914. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  915. {Name: "start_date", Type: field.TypeTime, Comment: "start_date | 开始时间"},
  916. {Name: "end_date", Type: field.TypeTime, Comment: "end_date | 结束时间"},
  917. {Name: "company", Type: field.TypeString, Comment: "company | 公司名"},
  918. {Name: "experience", Type: field.TypeString, Size: 2147483647, Comment: "experience | 工作内容"},
  919. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  920. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  921. }
  922. // WorkExperienceTable holds the schema information for the "work_experience" table.
  923. WorkExperienceTable = &schema.Table{
  924. Name: "work_experience",
  925. Columns: WorkExperienceColumns,
  926. PrimaryKey: []*schema.Column{WorkExperienceColumns[0]},
  927. ForeignKeys: []*schema.ForeignKey{
  928. {
  929. Symbol: "work_experience_employee_em_work_experiences",
  930. Columns: []*schema.Column{WorkExperienceColumns[9]},
  931. RefColumns: []*schema.Column{EmployeeColumns[0]},
  932. OnDelete: schema.NoAction,
  933. },
  934. },
  935. Indexes: []*schema.Index{
  936. {
  937. Name: "workexperience_employee_id",
  938. Unique: false,
  939. Columns: []*schema.Column{WorkExperienceColumns[9]},
  940. },
  941. },
  942. }
  943. // WpChatroomColumns holds the columns for the "wp_chatroom" table.
  944. WpChatroomColumns = []*schema.Column{
  945. {Name: "id", Type: field.TypeUint64, Increment: true},
  946. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  947. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  948. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  949. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  950. {Name: "chatroom_id", Type: field.TypeString, Comment: "群id", Default: ""},
  951. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  952. {Name: "owner", Type: field.TypeString, Comment: "群主", Default: ""},
  953. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  954. {Name: "member_list", Type: field.TypeJSON, Comment: "群成员"},
  955. }
  956. // WpChatroomTable holds the schema information for the "wp_chatroom" table.
  957. WpChatroomTable = &schema.Table{
  958. Name: "wp_chatroom",
  959. Columns: WpChatroomColumns,
  960. PrimaryKey: []*schema.Column{WpChatroomColumns[0]},
  961. Indexes: []*schema.Index{
  962. {
  963. Name: "wpchatroom_wx_wxid_chatroom_id",
  964. Unique: false,
  965. Columns: []*schema.Column{WpChatroomColumns[4], WpChatroomColumns[5]},
  966. },
  967. },
  968. }
  969. // WpChatroomMemberColumns holds the columns for the "wp_chatroom_member" table.
  970. WpChatroomMemberColumns = []*schema.Column{
  971. {Name: "id", Type: field.TypeUint64, Increment: true},
  972. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  973. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  974. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  975. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  976. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  977. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  978. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  979. }
  980. // WpChatroomMemberTable holds the schema information for the "wp_chatroom_member" table.
  981. WpChatroomMemberTable = &schema.Table{
  982. Name: "wp_chatroom_member",
  983. Columns: WpChatroomMemberColumns,
  984. PrimaryKey: []*schema.Column{WpChatroomMemberColumns[0]},
  985. Indexes: []*schema.Index{
  986. {
  987. Name: "wpchatroommember_wx_wxid_wxid",
  988. Unique: false,
  989. Columns: []*schema.Column{WpChatroomMemberColumns[4], WpChatroomMemberColumns[5]},
  990. },
  991. },
  992. }
  993. // WxColumns holds the columns for the "wx" table.
  994. WxColumns = []*schema.Column{
  995. {Name: "id", Type: field.TypeUint64, Increment: true},
  996. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  997. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  998. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  999. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1000. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  1001. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  1002. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  1003. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1004. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  1005. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  1006. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  1007. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  1008. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  1009. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  1010. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  1011. {Name: "allow_list", Type: field.TypeJSON, Comment: "白名单"},
  1012. {Name: "group_allow_list", Type: field.TypeJSON, Comment: "群白名单"},
  1013. {Name: "block_list", Type: field.TypeJSON, Comment: "黑名单"},
  1014. {Name: "group_block_list", Type: field.TypeJSON, Comment: "群黑名单"},
  1015. {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
  1016. {Name: "agent_base_wx_agent", Type: field.TypeString, Nullable: true},
  1017. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  1018. }
  1019. // WxTable holds the schema information for the "wx" table.
  1020. WxTable = &schema.Table{
  1021. Name: "wx",
  1022. Columns: WxColumns,
  1023. PrimaryKey: []*schema.Column{WxColumns[0]},
  1024. ForeignKeys: []*schema.ForeignKey{
  1025. {
  1026. Symbol: "wx_agent_wx_agent",
  1027. Columns: []*schema.Column{WxColumns[20]},
  1028. RefColumns: []*schema.Column{AgentColumns[0]},
  1029. OnDelete: schema.NoAction,
  1030. },
  1031. {
  1032. Symbol: "wx_agent_base_wx_agent",
  1033. Columns: []*schema.Column{WxColumns[21]},
  1034. RefColumns: []*schema.Column{AgentBaseColumns[0]},
  1035. OnDelete: schema.SetNull,
  1036. },
  1037. {
  1038. Symbol: "wx_server_wxs",
  1039. Columns: []*schema.Column{WxColumns[22]},
  1040. RefColumns: []*schema.Column{ServerColumns[0]},
  1041. OnDelete: schema.SetNull,
  1042. },
  1043. },
  1044. Indexes: []*schema.Index{
  1045. {
  1046. Name: "wx_server_id_port",
  1047. Unique: true,
  1048. Columns: []*schema.Column{WxColumns[22], WxColumns[5]},
  1049. },
  1050. {
  1051. Name: "wx_wxid",
  1052. Unique: true,
  1053. Columns: []*schema.Column{WxColumns[8]},
  1054. },
  1055. {
  1056. Name: "wx_account",
  1057. Unique: false,
  1058. Columns: []*schema.Column{WxColumns[9]},
  1059. },
  1060. {
  1061. Name: "wx_nickname",
  1062. Unique: false,
  1063. Columns: []*schema.Column{WxColumns[10]},
  1064. },
  1065. {
  1066. Name: "wx_tel",
  1067. Unique: false,
  1068. Columns: []*schema.Column{WxColumns[11]},
  1069. },
  1070. },
  1071. }
  1072. // WxCardColumns holds the columns for the "wx_card" table.
  1073. WxCardColumns = []*schema.Column{
  1074. {Name: "id", Type: field.TypeUint64, Increment: true},
  1075. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1076. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1077. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1078. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1079. {Name: "wx_user_id", Type: field.TypeUint64, Nullable: true, Comment: "wx表ID", Default: 0},
  1080. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1081. {Name: "logo", Type: field.TypeString, Comment: "logo", Default: ""},
  1082. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  1083. {Name: "company", Type: field.TypeString, Comment: "公司", Default: ""},
  1084. {Name: "address", Type: field.TypeString, Comment: "地址", Default: ""},
  1085. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1086. {Name: "official_account", Type: field.TypeString, Comment: "公众号", Default: ""},
  1087. {Name: "wechat_account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1088. {Name: "email", Type: field.TypeString, Nullable: true, Comment: "邮箱", Default: ""},
  1089. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "fastgpt-base"},
  1090. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "fastgpt-key"},
  1091. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  1092. {Name: "intro", Type: field.TypeString, Nullable: true, Comment: "个人介绍", Default: ""},
  1093. }
  1094. // WxCardTable holds the schema information for the "wx_card" table.
  1095. WxCardTable = &schema.Table{
  1096. Name: "wx_card",
  1097. Columns: WxCardColumns,
  1098. PrimaryKey: []*schema.Column{WxCardColumns[0]},
  1099. Indexes: []*schema.Index{
  1100. {
  1101. Name: "wxcard_user_id",
  1102. Unique: false,
  1103. Columns: []*schema.Column{WxCardColumns[4]},
  1104. },
  1105. {
  1106. Name: "wxcard_wx_user_id",
  1107. Unique: false,
  1108. Columns: []*schema.Column{WxCardColumns[5]},
  1109. },
  1110. },
  1111. }
  1112. // WxCardUserColumns holds the columns for the "wx_card_user" table.
  1113. WxCardUserColumns = []*schema.Column{
  1114. {Name: "id", Type: field.TypeUint64, Increment: true},
  1115. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1116. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1117. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1118. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1119. {Name: "account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1120. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1121. {Name: "nickname", Type: field.TypeString, Comment: "昵称", Default: ""},
  1122. {Name: "remark", Type: field.TypeString, Comment: "备注名", Default: ""},
  1123. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1124. {Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
  1125. {Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
  1126. {Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
  1127. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  1128. }
  1129. // WxCardUserTable holds the schema information for the "wx_card_user" table.
  1130. WxCardUserTable = &schema.Table{
  1131. Name: "wx_card_user",
  1132. Columns: WxCardUserColumns,
  1133. PrimaryKey: []*schema.Column{WxCardUserColumns[0]},
  1134. Indexes: []*schema.Index{
  1135. {
  1136. Name: "wxcarduser_wxid_open_id",
  1137. Unique: false,
  1138. Columns: []*schema.Column{WxCardUserColumns[4], WxCardUserColumns[10]},
  1139. },
  1140. },
  1141. }
  1142. // WxCardVisitColumns holds the columns for the "wx_card_visit" table.
  1143. WxCardVisitColumns = []*schema.Column{
  1144. {Name: "id", Type: field.TypeUint64, Increment: true},
  1145. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1146. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1147. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1148. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1149. {Name: "bot_id", Type: field.TypeUint64, Comment: "被访ID", Default: 0},
  1150. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序 3-智能体", Default: 0},
  1151. }
  1152. // WxCardVisitTable holds the schema information for the "wx_card_visit" table.
  1153. WxCardVisitTable = &schema.Table{
  1154. Name: "wx_card_visit",
  1155. Columns: WxCardVisitColumns,
  1156. PrimaryKey: []*schema.Column{WxCardVisitColumns[0]},
  1157. Indexes: []*schema.Index{
  1158. {
  1159. Name: "wxcardvisit_user_id",
  1160. Unique: false,
  1161. Columns: []*schema.Column{WxCardVisitColumns[4]},
  1162. },
  1163. {
  1164. Name: "wxcardvisit_bot_id_bot_type",
  1165. Unique: false,
  1166. Columns: []*schema.Column{WxCardVisitColumns[5], WxCardVisitColumns[6]},
  1167. },
  1168. },
  1169. }
  1170. // Tables holds all the tables in the schema.
  1171. Tables = []*schema.Table{
  1172. AgentTable,
  1173. AgentBaseTable,
  1174. AliyunAvatarTable,
  1175. BatchMsgTable,
  1176. CategoryTable,
  1177. ChatRecordsTable,
  1178. ChatSessionTable,
  1179. ContactTable,
  1180. EmployeeTable,
  1181. EmployeeConfigTable,
  1182. LabelTable,
  1183. LabelRelationshipTable,
  1184. LabelTaggingTable,
  1185. MessagesTable,
  1186. MessageRecordsTable,
  1187. MsgTable,
  1188. ServerTable,
  1189. SopNodeTable,
  1190. SopStageTable,
  1191. SopTaskTable,
  1192. TokenTable,
  1193. TutorialTable,
  1194. UsageDetailTable,
  1195. UsageStatisticDayTable,
  1196. UsageStatisticHourTable,
  1197. UsageStatisticMonthTable,
  1198. UsageTotalTable,
  1199. WorkExperienceTable,
  1200. WpChatroomTable,
  1201. WpChatroomMemberTable,
  1202. WxTable,
  1203. WxCardTable,
  1204. WxCardUserTable,
  1205. WxCardVisitTable,
  1206. }
  1207. )
  1208. func init() {
  1209. AgentTable.Annotation = &entsql.Annotation{
  1210. Table: "agent",
  1211. }
  1212. AgentBaseTable.Annotation = &entsql.Annotation{
  1213. Table: "agent_base",
  1214. }
  1215. AliyunAvatarTable.Annotation = &entsql.Annotation{
  1216. Table: "aliyun_avatar",
  1217. }
  1218. BatchMsgTable.Annotation = &entsql.Annotation{
  1219. Table: "batch_msg",
  1220. }
  1221. CategoryTable.Annotation = &entsql.Annotation{
  1222. Table: "category",
  1223. }
  1224. ChatRecordsTable.Annotation = &entsql.Annotation{
  1225. Table: "chat_records",
  1226. }
  1227. ChatSessionTable.Annotation = &entsql.Annotation{
  1228. Table: "chat_session",
  1229. }
  1230. ContactTable.Annotation = &entsql.Annotation{
  1231. Table: "contact",
  1232. }
  1233. EmployeeTable.Annotation = &entsql.Annotation{
  1234. Table: "employee",
  1235. }
  1236. EmployeeConfigTable.Annotation = &entsql.Annotation{
  1237. Table: "employee_config",
  1238. }
  1239. LabelTable.Annotation = &entsql.Annotation{
  1240. Table: "label",
  1241. }
  1242. LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
  1243. LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
  1244. LabelRelationshipTable.Annotation = &entsql.Annotation{
  1245. Table: "label_relationship",
  1246. }
  1247. LabelTaggingTable.Annotation = &entsql.Annotation{
  1248. Table: "label_tagging",
  1249. }
  1250. MessagesTable.Annotation = &entsql.Annotation{
  1251. Table: "messages",
  1252. }
  1253. MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
  1254. MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
  1255. MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
  1256. MessageRecordsTable.Annotation = &entsql.Annotation{
  1257. Table: "message_records",
  1258. }
  1259. MsgTable.Annotation = &entsql.Annotation{
  1260. Table: "msg",
  1261. }
  1262. ServerTable.Annotation = &entsql.Annotation{
  1263. Table: "server",
  1264. }
  1265. SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
  1266. SopNodeTable.Annotation = &entsql.Annotation{
  1267. Table: "sop_node",
  1268. }
  1269. SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
  1270. SopStageTable.Annotation = &entsql.Annotation{
  1271. Table: "sop_stage",
  1272. }
  1273. SopTaskTable.Annotation = &entsql.Annotation{
  1274. Table: "sop_task",
  1275. }
  1276. TokenTable.ForeignKeys[0].RefTable = AgentTable
  1277. TokenTable.Annotation = &entsql.Annotation{
  1278. Table: "token",
  1279. }
  1280. TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
  1281. TutorialTable.Annotation = &entsql.Annotation{
  1282. Table: "tutorial",
  1283. }
  1284. UsageDetailTable.Annotation = &entsql.Annotation{
  1285. Table: "usage_detail",
  1286. }
  1287. UsageStatisticDayTable.Annotation = &entsql.Annotation{
  1288. Table: "usage_statistic_day",
  1289. }
  1290. UsageStatisticHourTable.Annotation = &entsql.Annotation{
  1291. Table: "usage_statistic_hour",
  1292. }
  1293. UsageStatisticMonthTable.Annotation = &entsql.Annotation{
  1294. Table: "usage_statistic_month",
  1295. }
  1296. UsageTotalTable.Annotation = &entsql.Annotation{
  1297. Table: "usage_total",
  1298. }
  1299. WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
  1300. WorkExperienceTable.Annotation = &entsql.Annotation{
  1301. Table: "work_experience",
  1302. }
  1303. WpChatroomTable.Annotation = &entsql.Annotation{
  1304. Table: "wp_chatroom",
  1305. }
  1306. WpChatroomMemberTable.Annotation = &entsql.Annotation{
  1307. Table: "wp_chatroom_member",
  1308. }
  1309. WxTable.ForeignKeys[0].RefTable = AgentTable
  1310. WxTable.ForeignKeys[1].RefTable = AgentBaseTable
  1311. WxTable.ForeignKeys[2].RefTable = ServerTable
  1312. WxTable.Annotation = &entsql.Annotation{
  1313. Table: "wx",
  1314. }
  1315. WxCardTable.Annotation = &entsql.Annotation{
  1316. Table: "wx_card",
  1317. }
  1318. WxCardUserTable.Annotation = &entsql.Annotation{
  1319. Table: "wx_card_user",
  1320. }
  1321. WxCardVisitTable.Annotation = &entsql.Annotation{
  1322. Table: "wx_card_visit",
  1323. }
  1324. }