schema.go 84 KB

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