schema.go 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604
  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. // CreditBalanceColumns holds the columns for the "credit_balance" table.
  340. CreditBalanceColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  345. {Name: "user_id", Type: field.TypeString, Nullable: true, Comment: "user_id | 用户ID"},
  346. {Name: "balance", Type: field.TypeFloat32, Comment: "role | 角色设定"},
  347. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  348. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID"},
  349. }
  350. // CreditBalanceTable holds the schema information for the "credit_balance" table.
  351. CreditBalanceTable = &schema.Table{
  352. Name: "credit_balance",
  353. Columns: CreditBalanceColumns,
  354. PrimaryKey: []*schema.Column{CreditBalanceColumns[0]},
  355. Indexes: []*schema.Index{
  356. {
  357. Name: "creditbalance_user_id",
  358. Unique: false,
  359. Columns: []*schema.Column{CreditBalanceColumns[4]},
  360. },
  361. {
  362. Name: "creditbalance_organization_id",
  363. Unique: false,
  364. Columns: []*schema.Column{CreditBalanceColumns[7]},
  365. },
  366. },
  367. }
  368. // CreditUsageColumns holds the columns for the "credit_usage" table.
  369. CreditUsageColumns = []*schema.Column{
  370. {Name: "id", Type: field.TypeUint64, Increment: true},
  371. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  372. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  373. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  374. {Name: "user_id", Type: field.TypeString, Nullable: true, Size: 255, Comment: "user_id | 用户ID"},
  375. {Name: "number", Type: field.TypeFloat32, Comment: "number | 积分改变量"},
  376. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  377. {Name: "ntype", Type: field.TypeInt, Comment: "ntype | 积分变化类型:1-消耗 2-增加", Default: 1},
  378. {Name: "table", Type: field.TypeString, Comment: "table | 积分变化表名", Default: ""},
  379. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "organization_id | 租户ID"},
  380. {Name: "nid", Type: field.TypeUint64, Comment: "nid | 积分变化关联信息ID", Default: 0},
  381. {Name: "reason", Type: field.TypeString, Size: 255, Comment: "reason | 积分变动原因", Default: ""},
  382. {Name: "operator", Type: field.TypeString, Size: 255, Comment: "operator | 积分变动人", Default: ""},
  383. }
  384. // CreditUsageTable holds the schema information for the "credit_usage" table.
  385. CreditUsageTable = &schema.Table{
  386. Name: "credit_usage",
  387. Columns: CreditUsageColumns,
  388. PrimaryKey: []*schema.Column{CreditUsageColumns[0]},
  389. Indexes: []*schema.Index{
  390. {
  391. Name: "creditusage_organization_id",
  392. Unique: false,
  393. Columns: []*schema.Column{CreditUsageColumns[9]},
  394. },
  395. },
  396. }
  397. // EmployeeColumns holds the columns for the "employee" table.
  398. EmployeeColumns = []*schema.Column{
  399. {Name: "id", Type: field.TypeUint64, Increment: true},
  400. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  401. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  402. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  403. {Name: "title", Type: field.TypeString, Size: 1000, Comment: "title | 标题"},
  404. {Name: "avatar", Type: field.TypeString, Comment: "avatar | 头像"},
  405. {Name: "tags", Type: field.TypeString, Comment: "tags | 个人标签"},
  406. {Name: "hire_count", Type: field.TypeInt, Comment: "hire_count | 被雇佣次数", Default: 0},
  407. {Name: "service_count", Type: field.TypeInt, Comment: "service_count | 已服务次数", Default: 0},
  408. {Name: "achievement_count", Type: field.TypeInt, Comment: "achievement_count | 业绩单数", Default: 0},
  409. {Name: "intro", Type: field.TypeString, Comment: "intro | 个人介绍", Default: ""},
  410. {Name: "estimate", Type: field.TypeString, Comment: "estimate | 自我评价", Default: ""},
  411. {Name: "skill", Type: field.TypeString, Comment: "skill | 技能卡", Default: ""},
  412. {Name: "ability_type", Type: field.TypeString, Comment: "ability_type | 能力类型", Default: ""},
  413. {Name: "scene", Type: field.TypeString, Comment: "scene | 使用场景", Default: ""},
  414. {Name: "switch_in", Type: field.TypeString, Comment: "switch_in | 支持介入", Default: ""},
  415. {Name: "video_url", Type: field.TypeString, Comment: "video_url | 视频地址", Default: ""},
  416. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  417. {Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
  418. {Name: "api_base", Type: field.TypeString, Comment: "api_base", Default: ""},
  419. {Name: "api_key", Type: field.TypeString, Comment: "api_key", Default: ""},
  420. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  421. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  422. {Name: "chat_url", Type: field.TypeString, Comment: "聊天URL"},
  423. }
  424. // EmployeeTable holds the schema information for the "employee" table.
  425. EmployeeTable = &schema.Table{
  426. Name: "employee",
  427. Columns: EmployeeColumns,
  428. PrimaryKey: []*schema.Column{EmployeeColumns[0]},
  429. Indexes: []*schema.Index{
  430. {
  431. Name: "employee_organization_id",
  432. Unique: false,
  433. Columns: []*schema.Column{EmployeeColumns[17]},
  434. },
  435. },
  436. }
  437. // EmployeeConfigColumns holds the columns for the "employee_config" table.
  438. EmployeeConfigColumns = []*schema.Column{
  439. {Name: "id", Type: field.TypeUint64, Increment: true},
  440. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  441. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  442. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  443. {Name: "stype", Type: field.TypeString, Comment: "类型:scene-场景 switch_in-接入方式", Default: ""},
  444. {Name: "title", Type: field.TypeString, Comment: "标题", Default: ""},
  445. {Name: "photo", Type: field.TypeString, Comment: "图片地址", Default: ""},
  446. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  447. }
  448. // EmployeeConfigTable holds the schema information for the "employee_config" table.
  449. EmployeeConfigTable = &schema.Table{
  450. Name: "employee_config",
  451. Columns: EmployeeConfigColumns,
  452. PrimaryKey: []*schema.Column{EmployeeConfigColumns[0]},
  453. Indexes: []*schema.Index{
  454. {
  455. Name: "employeeconfig_stype",
  456. Unique: false,
  457. Columns: []*schema.Column{EmployeeConfigColumns[4]},
  458. },
  459. },
  460. }
  461. // LabelColumns holds the columns for the "label" table.
  462. LabelColumns = []*schema.Column{
  463. {Name: "id", Type: field.TypeUint64, Increment: true},
  464. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  465. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  466. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  467. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  468. {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""},
  469. {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1},
  470. {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1},
  471. {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""},
  472. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  473. }
  474. // LabelTable holds the schema information for the "label" table.
  475. LabelTable = &schema.Table{
  476. Name: "label",
  477. Columns: LabelColumns,
  478. PrimaryKey: []*schema.Column{LabelColumns[0]},
  479. Indexes: []*schema.Index{
  480. {
  481. Name: "label_name_from_mode",
  482. Unique: true,
  483. Columns: []*schema.Column{LabelColumns[5], LabelColumns[6], LabelColumns[7]},
  484. },
  485. },
  486. }
  487. // LabelRelationshipColumns holds the columns for the "label_relationship" table.
  488. LabelRelationshipColumns = []*schema.Column{
  489. {Name: "id", Type: field.TypeUint64, Increment: true},
  490. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  491. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  492. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  493. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  494. {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
  495. {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
  496. }
  497. // LabelRelationshipTable holds the schema information for the "label_relationship" table.
  498. LabelRelationshipTable = &schema.Table{
  499. Name: "label_relationship",
  500. Columns: LabelRelationshipColumns,
  501. PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
  502. ForeignKeys: []*schema.ForeignKey{
  503. {
  504. Symbol: "label_relationship_contact_contact_relationships",
  505. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  506. RefColumns: []*schema.Column{ContactColumns[0]},
  507. OnDelete: schema.NoAction,
  508. },
  509. {
  510. Symbol: "label_relationship_label_label_relationships",
  511. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  512. RefColumns: []*schema.Column{LabelColumns[0]},
  513. OnDelete: schema.NoAction,
  514. },
  515. },
  516. Indexes: []*schema.Index{
  517. {
  518. Name: "labelrelationship_label_id",
  519. Unique: false,
  520. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  521. },
  522. {
  523. Name: "labelrelationship_contact_id",
  524. Unique: false,
  525. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  526. },
  527. },
  528. }
  529. // LabelTaggingColumns holds the columns for the "label_tagging" table.
  530. LabelTaggingColumns = []*schema.Column{
  531. {Name: "id", Type: field.TypeUint64, Increment: true},
  532. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  533. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  534. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  535. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  536. {Name: "organization_id", Type: field.TypeUint64, Comment: "机构 ID", Default: 1},
  537. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  538. {Name: "conditions", Type: field.TypeString, Comment: "关键词", Default: ""},
  539. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  540. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  541. }
  542. // LabelTaggingTable holds the schema information for the "label_tagging" table.
  543. LabelTaggingTable = &schema.Table{
  544. Name: "label_tagging",
  545. Columns: LabelTaggingColumns,
  546. PrimaryKey: []*schema.Column{LabelTaggingColumns[0]},
  547. }
  548. // MessagesColumns holds the columns for the "messages" table.
  549. MessagesColumns = []*schema.Column{
  550. {Name: "id", Type: field.TypeInt, Increment: true},
  551. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  552. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  553. {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
  554. }
  555. // MessagesTable holds the schema information for the "messages" table.
  556. MessagesTable = &schema.Table{
  557. Name: "messages",
  558. Columns: MessagesColumns,
  559. PrimaryKey: []*schema.Column{MessagesColumns[0]},
  560. }
  561. // MessageRecordsColumns holds the columns for the "message_records" table.
  562. MessageRecordsColumns = []*schema.Column{
  563. {Name: "id", Type: field.TypeUint64, Increment: true},
  564. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  565. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  566. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  567. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  568. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  569. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  570. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  571. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  572. {Name: "meta", Type: field.TypeJSON, Nullable: true, Comment: "元数据"},
  573. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  574. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  575. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  576. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  577. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  578. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  579. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  580. }
  581. // MessageRecordsTable holds the schema information for the "message_records" table.
  582. MessageRecordsTable = &schema.Table{
  583. Name: "message_records",
  584. Columns: MessageRecordsColumns,
  585. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  586. ForeignKeys: []*schema.ForeignKey{
  587. {
  588. Symbol: "message_records_contact_contact_messages",
  589. Columns: []*schema.Column{MessageRecordsColumns[14]},
  590. RefColumns: []*schema.Column{ContactColumns[0]},
  591. OnDelete: schema.SetNull,
  592. },
  593. {
  594. Symbol: "message_records_sop_node_node_messages",
  595. Columns: []*schema.Column{MessageRecordsColumns[15]},
  596. RefColumns: []*schema.Column{SopNodeColumns[0]},
  597. OnDelete: schema.SetNull,
  598. },
  599. {
  600. Symbol: "message_records_sop_stage_stage_messages",
  601. Columns: []*schema.Column{MessageRecordsColumns[16]},
  602. RefColumns: []*schema.Column{SopStageColumns[0]},
  603. OnDelete: schema.SetNull,
  604. },
  605. },
  606. Indexes: []*schema.Index{
  607. {
  608. Name: "messagerecords_source_type",
  609. Unique: false,
  610. Columns: []*schema.Column{MessageRecordsColumns[12]},
  611. },
  612. },
  613. }
  614. // MsgColumns holds the columns for the "msg" table.
  615. MsgColumns = []*schema.Column{
  616. {Name: "id", Type: field.TypeUint64, Increment: true},
  617. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  618. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  619. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  620. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用"},
  621. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  622. {Name: "toid", Type: field.TypeString, Nullable: true, Comment: "接收人微信ID/群ID"},
  623. {Name: "msgtype", Type: field.TypeInt32, Nullable: true, Comment: "消息类型"},
  624. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "消息"},
  625. {Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号"},
  626. {Name: "cc", Type: field.TypeString, Comment: "国家区号", Default: ""},
  627. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  628. }
  629. // MsgTable holds the schema information for the "msg" table.
  630. MsgTable = &schema.Table{
  631. Name: "msg",
  632. Columns: MsgColumns,
  633. PrimaryKey: []*schema.Column{MsgColumns[0]},
  634. Indexes: []*schema.Index{
  635. {
  636. Name: "msg_batch_no",
  637. Unique: false,
  638. Columns: []*schema.Column{MsgColumns[9]},
  639. },
  640. {
  641. Name: "msg_id",
  642. Unique: false,
  643. Columns: []*schema.Column{MsgColumns[0]},
  644. },
  645. {
  646. Name: "msg_status",
  647. Unique: false,
  648. Columns: []*schema.Column{MsgColumns[4]},
  649. },
  650. },
  651. }
  652. // PayRechargeColumns holds the columns for the "pay_recharge" table.
  653. PayRechargeColumns = []*schema.Column{
  654. {Name: "id", Type: field.TypeUint64, Increment: true},
  655. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  656. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  657. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  658. {Name: "user_id", Type: field.TypeString, Size: 255, Comment: "user_id | 用户ID"},
  659. {Name: "number", Type: field.TypeFloat32, Comment: "number | 变化积分数", Default: 0},
  660. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  661. {Name: "money", Type: field.TypeFloat32, Nullable: true, Comment: "money | 充值钱数", Default: 0},
  662. {Name: "out_trade_no", Type: field.TypeString, Nullable: true, Comment: "out_trade_no | 外部订单号", Default: ""},
  663. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID", Default: 0},
  664. }
  665. // PayRechargeTable holds the schema information for the "pay_recharge" table.
  666. PayRechargeTable = &schema.Table{
  667. Name: "pay_recharge",
  668. Columns: PayRechargeColumns,
  669. PrimaryKey: []*schema.Column{PayRechargeColumns[0]},
  670. Indexes: []*schema.Index{
  671. {
  672. Name: "payrecharge_user_id",
  673. Unique: false,
  674. Columns: []*schema.Column{PayRechargeColumns[4]},
  675. },
  676. {
  677. Name: "payrecharge_organization_id",
  678. Unique: false,
  679. Columns: []*schema.Column{PayRechargeColumns[9]},
  680. },
  681. },
  682. }
  683. // ServerColumns holds the columns for the "server" table.
  684. ServerColumns = []*schema.Column{
  685. {Name: "id", Type: field.TypeUint64, Increment: true},
  686. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  687. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  688. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  689. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  690. {Name: "name", Type: field.TypeString, Comment: "名称"},
  691. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  692. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  693. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  694. }
  695. // ServerTable holds the schema information for the "server" table.
  696. ServerTable = &schema.Table{
  697. Name: "server",
  698. Columns: ServerColumns,
  699. PrimaryKey: []*schema.Column{ServerColumns[0]},
  700. Indexes: []*schema.Index{
  701. {
  702. Name: "server_name",
  703. Unique: false,
  704. Columns: []*schema.Column{ServerColumns[5]},
  705. },
  706. {
  707. Name: "server_private_ip",
  708. Unique: false,
  709. Columns: []*schema.Column{ServerColumns[7]},
  710. },
  711. {
  712. Name: "server_public_ip",
  713. Unique: true,
  714. Columns: []*schema.Column{ServerColumns[6]},
  715. },
  716. },
  717. }
  718. // SopNodeColumns holds the columns for the "sop_node" table.
  719. SopNodeColumns = []*schema.Column{
  720. {Name: "id", Type: field.TypeUint64, Increment: true},
  721. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  722. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  723. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  724. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  725. {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
  726. {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
  727. {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
  728. {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
  729. {Name: "no_reply_condition", Type: field.TypeUint64, Comment: "超时触发时间(分钟)", Default: 0},
  730. {Name: "no_reply_unit", Type: field.TypeString, Comment: "超时触发时间单位", Default: ""},
  731. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  732. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  733. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  734. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  735. {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
  736. }
  737. // SopNodeTable holds the schema information for the "sop_node" table.
  738. SopNodeTable = &schema.Table{
  739. Name: "sop_node",
  740. Columns: SopNodeColumns,
  741. PrimaryKey: []*schema.Column{SopNodeColumns[0]},
  742. ForeignKeys: []*schema.ForeignKey{
  743. {
  744. Symbol: "sop_node_sop_stage_stage_nodes",
  745. Columns: []*schema.Column{SopNodeColumns[15]},
  746. RefColumns: []*schema.Column{SopStageColumns[0]},
  747. OnDelete: schema.NoAction,
  748. },
  749. },
  750. Indexes: []*schema.Index{
  751. {
  752. Name: "sopnode_name",
  753. Unique: false,
  754. Columns: []*schema.Column{SopNodeColumns[6]},
  755. },
  756. },
  757. }
  758. // SopStageColumns holds the columns for the "sop_stage" table.
  759. SopStageColumns = []*schema.Column{
  760. {Name: "id", Type: field.TypeUint64, Increment: true},
  761. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  762. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  763. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  764. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  765. {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
  766. {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
  767. {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
  768. {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
  769. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  770. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  771. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  772. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  773. {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
  774. {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
  775. }
  776. // SopStageTable holds the schema information for the "sop_stage" table.
  777. SopStageTable = &schema.Table{
  778. Name: "sop_stage",
  779. Columns: SopStageColumns,
  780. PrimaryKey: []*schema.Column{SopStageColumns[0]},
  781. ForeignKeys: []*schema.ForeignKey{
  782. {
  783. Symbol: "sop_stage_sop_task_task_stages",
  784. Columns: []*schema.Column{SopStageColumns[14]},
  785. RefColumns: []*schema.Column{SopTaskColumns[0]},
  786. OnDelete: schema.NoAction,
  787. },
  788. },
  789. Indexes: []*schema.Index{
  790. {
  791. Name: "sopstage_name",
  792. Unique: false,
  793. Columns: []*schema.Column{SopStageColumns[5]},
  794. },
  795. },
  796. }
  797. // SopTaskColumns holds the columns for the "sop_task" table.
  798. SopTaskColumns = []*schema.Column{
  799. {Name: "id", Type: field.TypeUint64, Increment: true},
  800. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  801. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  802. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  803. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  804. {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
  805. {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
  806. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
  807. {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
  808. {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
  809. {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
  810. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  811. {Name: "token", Type: field.TypeJSON, Nullable: true, Comment: "Token"},
  812. }
  813. // SopTaskTable holds the schema information for the "sop_task" table.
  814. SopTaskTable = &schema.Table{
  815. Name: "sop_task",
  816. Columns: SopTaskColumns,
  817. PrimaryKey: []*schema.Column{SopTaskColumns[0]},
  818. Indexes: []*schema.Index{
  819. {
  820. Name: "soptask_name",
  821. Unique: false,
  822. Columns: []*schema.Column{SopTaskColumns[5]},
  823. },
  824. {
  825. Name: "soptask_token",
  826. Unique: false,
  827. Columns: []*schema.Column{SopTaskColumns[12]},
  828. },
  829. },
  830. }
  831. // TokenColumns holds the columns for the "token" table.
  832. TokenColumns = []*schema.Column{
  833. {Name: "id", Type: field.TypeUint64, Increment: true},
  834. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  835. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  836. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  837. {Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
  838. {Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
  839. {Name: "mac", Type: field.TypeString, Nullable: true, Comment: "Mac地址", Default: ""},
  840. {Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
  841. {Name: "custom_agent_base", Type: field.TypeString, Nullable: true, Comment: "定制agent服务地址", Default: ""},
  842. {Name: "custom_agent_key", Type: field.TypeString, Nullable: true, Comment: "定制agent服务密钥", Default: ""},
  843. {Name: "openai_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  844. {Name: "openai_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  845. {Name: "agent_id", Type: field.TypeUint64, Comment: "智能体ID", Default: 0},
  846. }
  847. // TokenTable holds the schema information for the "token" table.
  848. TokenTable = &schema.Table{
  849. Name: "token",
  850. Columns: TokenColumns,
  851. PrimaryKey: []*schema.Column{TokenColumns[0]},
  852. ForeignKeys: []*schema.ForeignKey{
  853. {
  854. Symbol: "token_agent_token_agent",
  855. Columns: []*schema.Column{TokenColumns[12]},
  856. RefColumns: []*schema.Column{AgentColumns[0]},
  857. OnDelete: schema.NoAction,
  858. },
  859. },
  860. Indexes: []*schema.Index{
  861. {
  862. Name: "token_token",
  863. Unique: true,
  864. Columns: []*schema.Column{TokenColumns[5]},
  865. },
  866. },
  867. }
  868. // TutorialColumns holds the columns for the "tutorial" table.
  869. TutorialColumns = []*schema.Column{
  870. {Name: "id", Type: field.TypeUint64, Increment: true},
  871. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  872. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  873. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  874. {Name: "index", Type: field.TypeInt, Comment: "index | 序号"},
  875. {Name: "title", Type: field.TypeString, Comment: "title | 标题"},
  876. {Name: "content", Type: field.TypeString, Comment: "content | 内容"},
  877. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  878. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  879. }
  880. // TutorialTable holds the schema information for the "tutorial" table.
  881. TutorialTable = &schema.Table{
  882. Name: "tutorial",
  883. Columns: TutorialColumns,
  884. PrimaryKey: []*schema.Column{TutorialColumns[0]},
  885. ForeignKeys: []*schema.ForeignKey{
  886. {
  887. Symbol: "tutorial_employee_em_tutorial",
  888. Columns: []*schema.Column{TutorialColumns[8]},
  889. RefColumns: []*schema.Column{EmployeeColumns[0]},
  890. OnDelete: schema.NoAction,
  891. },
  892. },
  893. Indexes: []*schema.Index{
  894. {
  895. Name: "tutorial_employee_id",
  896. Unique: false,
  897. Columns: []*schema.Column{TutorialColumns[8]},
  898. },
  899. },
  900. }
  901. // UsageDetailColumns holds the columns for the "usage_detail" table.
  902. UsageDetailColumns = []*schema.Column{
  903. {Name: "id", Type: field.TypeUint64, Increment: true},
  904. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  905. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  906. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  907. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  908. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  909. {Name: "receiver_id", Type: field.TypeString, Comment: "微信id或open_id", Default: ""},
  910. {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},
  911. {Name: "session_id", Type: field.TypeUint64, Nullable: true, Comment: "名片会话id", Default: 1},
  912. {Name: "request", Type: field.TypeString, Comment: "请求内容", Default: ""},
  913. {Name: "response", Type: field.TypeString, Comment: "响应内容", Default: ""},
  914. {Name: "original_data", Type: field.TypeJSON, Comment: "原始数据"},
  915. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  916. {Name: "prompt_tokens", Type: field.TypeUint64, Nullable: true, Comment: "请求token数", Default: 0},
  917. {Name: "completion_tokens", Type: field.TypeUint64, Nullable: true, Comment: "响应token数", Default: 0},
  918. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  919. }
  920. // UsageDetailTable holds the schema information for the "usage_detail" table.
  921. UsageDetailTable = &schema.Table{
  922. Name: "usage_detail",
  923. Columns: UsageDetailColumns,
  924. PrimaryKey: []*schema.Column{UsageDetailColumns[0]},
  925. Indexes: []*schema.Index{
  926. {
  927. Name: "usagedetail_bot_id",
  928. Unique: false,
  929. Columns: []*schema.Column{UsageDetailColumns[5]},
  930. },
  931. {
  932. Name: "usagedetail_organization_id",
  933. Unique: false,
  934. Columns: []*schema.Column{UsageDetailColumns[15]},
  935. },
  936. },
  937. }
  938. // UsageStatisticDayColumns holds the columns for the "usage_statistic_day" table.
  939. UsageStatisticDayColumns = []*schema.Column{
  940. {Name: "id", Type: field.TypeUint64, Increment: true},
  941. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  942. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  943. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  944. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  945. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月日"},
  946. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  947. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  948. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  949. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  950. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  951. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  952. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  953. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  954. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  955. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  956. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  957. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  958. }
  959. // UsageStatisticDayTable holds the schema information for the "usage_statistic_day" table.
  960. UsageStatisticDayTable = &schema.Table{
  961. Name: "usage_statistic_day",
  962. Columns: UsageStatisticDayColumns,
  963. PrimaryKey: []*schema.Column{UsageStatisticDayColumns[0]},
  964. Indexes: []*schema.Index{
  965. {
  966. Name: "usagestatisticday_addtime",
  967. Unique: false,
  968. Columns: []*schema.Column{UsageStatisticDayColumns[5]},
  969. },
  970. {
  971. Name: "usagestatisticday_bot_id",
  972. Unique: false,
  973. Columns: []*schema.Column{UsageStatisticDayColumns[7]},
  974. },
  975. },
  976. }
  977. // UsageStatisticHourColumns holds the columns for the "usage_statistic_hour" table.
  978. UsageStatisticHourColumns = []*schema.Column{
  979. {Name: "id", Type: field.TypeUint64, Increment: true},
  980. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  981. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  982. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  983. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  984. {Name: "addtime", Type: field.TypeUint64, Comment: "写入小时"},
  985. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  986. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  987. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  988. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  989. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  990. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  991. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  992. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  993. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  994. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  995. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  996. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  997. }
  998. // UsageStatisticHourTable holds the schema information for the "usage_statistic_hour" table.
  999. UsageStatisticHourTable = &schema.Table{
  1000. Name: "usage_statistic_hour",
  1001. Columns: UsageStatisticHourColumns,
  1002. PrimaryKey: []*schema.Column{UsageStatisticHourColumns[0]},
  1003. Indexes: []*schema.Index{
  1004. {
  1005. Name: "usagestatistichour_addtime",
  1006. Unique: false,
  1007. Columns: []*schema.Column{UsageStatisticHourColumns[5]},
  1008. },
  1009. {
  1010. Name: "usagestatistichour_bot_id",
  1011. Unique: false,
  1012. Columns: []*schema.Column{UsageStatisticHourColumns[7]},
  1013. },
  1014. },
  1015. }
  1016. // UsageStatisticMonthColumns holds the columns for the "usage_statistic_month" table.
  1017. UsageStatisticMonthColumns = []*schema.Column{
  1018. {Name: "id", Type: field.TypeUint64, Increment: true},
  1019. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1020. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1021. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1022. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1023. {Name: "addtime", Type: field.TypeUint64, Comment: "写入年月"},
  1024. {Name: "type", Type: field.TypeInt, Comment: "1-微信 2-名片"},
  1025. {Name: "bot_id", Type: field.TypeString, Nullable: true, Comment: "微信或名片id"},
  1026. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构ID"},
  1027. {Name: "ai_response", Type: field.TypeUint64, Comment: "AI回复次数"},
  1028. {Name: "sop_run", Type: field.TypeUint64, Comment: "SOP运行次数"},
  1029. {Name: "total_friend", Type: field.TypeUint64, Comment: "好友总数"},
  1030. {Name: "total_group", Type: field.TypeUint64, Comment: "群总数"},
  1031. {Name: "account_balance", Type: field.TypeUint64, Comment: "账户余额(单位:分)"},
  1032. {Name: "consume_token", Type: field.TypeUint64, Comment: "消耗token数"},
  1033. {Name: "active_user", Type: field.TypeUint64, Comment: "活跃用户数"},
  1034. {Name: "new_user", Type: field.TypeInt64, Comment: "新增用户数"},
  1035. {Name: "label_dist", Type: field.TypeJSON, Comment: "标签分布"},
  1036. }
  1037. // UsageStatisticMonthTable holds the schema information for the "usage_statistic_month" table.
  1038. UsageStatisticMonthTable = &schema.Table{
  1039. Name: "usage_statistic_month",
  1040. Columns: UsageStatisticMonthColumns,
  1041. PrimaryKey: []*schema.Column{UsageStatisticMonthColumns[0]},
  1042. Indexes: []*schema.Index{
  1043. {
  1044. Name: "usagestatisticmonth_addtime",
  1045. Unique: false,
  1046. Columns: []*schema.Column{UsageStatisticMonthColumns[5]},
  1047. },
  1048. {
  1049. Name: "usagestatisticmonth_bot_id",
  1050. Unique: false,
  1051. Columns: []*schema.Column{UsageStatisticMonthColumns[7]},
  1052. },
  1053. },
  1054. }
  1055. // UsageTotalColumns holds the columns for the "usage_total" table.
  1056. UsageTotalColumns = []*schema.Column{
  1057. {Name: "id", Type: field.TypeUint64, Increment: true},
  1058. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1059. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1060. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1061. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  1062. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  1063. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  1064. {Name: "start_index", Type: field.TypeUint64, Nullable: true, Comment: "重制后的起始usage_detail 索引", Default: 0},
  1065. {Name: "end_index", Type: field.TypeUint64, Nullable: true, Comment: "usage_detail 索引", Default: 0},
  1066. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  1067. }
  1068. // UsageTotalTable holds the schema information for the "usage_total" table.
  1069. UsageTotalTable = &schema.Table{
  1070. Name: "usage_total",
  1071. Columns: UsageTotalColumns,
  1072. PrimaryKey: []*schema.Column{UsageTotalColumns[0]},
  1073. Indexes: []*schema.Index{
  1074. {
  1075. Name: "usagetotal_bot_id",
  1076. Unique: false,
  1077. Columns: []*schema.Column{UsageTotalColumns[5]},
  1078. },
  1079. {
  1080. Name: "usagetotal_organization_id",
  1081. Unique: false,
  1082. Columns: []*schema.Column{UsageTotalColumns[9]},
  1083. },
  1084. },
  1085. }
  1086. // WhatsappColumns holds the columns for the "whatsapp" table.
  1087. WhatsappColumns = []*schema.Column{
  1088. {Name: "id", Type: field.TypeUint64, Increment: true},
  1089. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1090. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1091. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1092. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1093. {Name: "wa_id", Type: field.TypeString, Nullable: true, Default: ""},
  1094. {Name: "wa_name", Type: field.TypeString, Nullable: true, Default: ""},
  1095. {Name: "callback", Type: field.TypeString, Nullable: true, Default: ""},
  1096. {Name: "account", Type: field.TypeString, Nullable: true, Default: ""},
  1097. {Name: "cc", Type: field.TypeString, Default: ""},
  1098. {Name: "phone", Type: field.TypeString, Default: ""},
  1099. {Name: "cc_phone", Type: field.TypeString, Default: ""},
  1100. {Name: "phone_name", Type: field.TypeString, Default: ""},
  1101. {Name: "phone_status", Type: field.TypeInt8, Default: 0},
  1102. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
  1103. {Name: "api_base", Type: field.TypeString, Nullable: true, Default: ""},
  1104. {Name: "api_key", Type: field.TypeString, Nullable: true, Default: ""},
  1105. {Name: "allow_list", Type: field.TypeJSON, Nullable: true},
  1106. {Name: "group_allow_list", Type: field.TypeJSON, Nullable: true},
  1107. {Name: "block_list", Type: field.TypeJSON, Nullable: true},
  1108. {Name: "group_block_list", Type: field.TypeJSON, Nullable: true},
  1109. {Name: "agent_id", Type: field.TypeUint64, Default: 0},
  1110. }
  1111. // WhatsappTable holds the schema information for the "whatsapp" table.
  1112. WhatsappTable = &schema.Table{
  1113. Name: "whatsapp",
  1114. Columns: WhatsappColumns,
  1115. PrimaryKey: []*schema.Column{WhatsappColumns[0]},
  1116. ForeignKeys: []*schema.ForeignKey{
  1117. {
  1118. Symbol: "whatsapp_agent_wa_agent",
  1119. Columns: []*schema.Column{WhatsappColumns[21]},
  1120. RefColumns: []*schema.Column{AgentColumns[0]},
  1121. OnDelete: schema.NoAction,
  1122. },
  1123. },
  1124. }
  1125. // WhatsappChannelColumns holds the columns for the "whatsapp_channel" table.
  1126. WhatsappChannelColumns = []*schema.Column{
  1127. {Name: "id", Type: field.TypeUint64, Increment: true},
  1128. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1129. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1130. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1131. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1132. {Name: "ak", Type: field.TypeString, Nullable: true, Default: ""},
  1133. {Name: "sk", Type: field.TypeString, Default: ""},
  1134. {Name: "wa_id", Type: field.TypeString, Nullable: true, Default: ""},
  1135. {Name: "wa_name", Type: field.TypeString, Nullable: true, Default: ""},
  1136. {Name: "waba_id", Type: field.TypeUint64, Default: 0},
  1137. {Name: "business_id", Type: field.TypeUint64, Default: 0},
  1138. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Default: 0},
  1139. {Name: "verify_account", Type: field.TypeString, Default: ""},
  1140. }
  1141. // WhatsappChannelTable holds the schema information for the "whatsapp_channel" table.
  1142. WhatsappChannelTable = &schema.Table{
  1143. Name: "whatsapp_channel",
  1144. Columns: WhatsappChannelColumns,
  1145. PrimaryKey: []*schema.Column{WhatsappChannelColumns[0]},
  1146. Indexes: []*schema.Index{
  1147. {
  1148. Name: "whatsappchannel_ak_sk",
  1149. Unique: false,
  1150. Columns: []*schema.Column{WhatsappChannelColumns[5], WhatsappChannelColumns[6]},
  1151. },
  1152. },
  1153. }
  1154. // WorkExperienceColumns holds the columns for the "work_experience" table.
  1155. WorkExperienceColumns = []*schema.Column{
  1156. {Name: "id", Type: field.TypeUint64, Increment: true},
  1157. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1158. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1159. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1160. {Name: "start_date", Type: field.TypeTime, Comment: "start_date | 开始时间"},
  1161. {Name: "end_date", Type: field.TypeTime, Comment: "end_date | 结束时间"},
  1162. {Name: "company", Type: field.TypeString, Comment: "company | 公司名"},
  1163. {Name: "experience", Type: field.TypeString, Size: 2147483647, Comment: "experience | 工作内容"},
  1164. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  1165. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  1166. }
  1167. // WorkExperienceTable holds the schema information for the "work_experience" table.
  1168. WorkExperienceTable = &schema.Table{
  1169. Name: "work_experience",
  1170. Columns: WorkExperienceColumns,
  1171. PrimaryKey: []*schema.Column{WorkExperienceColumns[0]},
  1172. ForeignKeys: []*schema.ForeignKey{
  1173. {
  1174. Symbol: "work_experience_employee_em_work_experiences",
  1175. Columns: []*schema.Column{WorkExperienceColumns[9]},
  1176. RefColumns: []*schema.Column{EmployeeColumns[0]},
  1177. OnDelete: schema.NoAction,
  1178. },
  1179. },
  1180. Indexes: []*schema.Index{
  1181. {
  1182. Name: "workexperience_employee_id",
  1183. Unique: false,
  1184. Columns: []*schema.Column{WorkExperienceColumns[9]},
  1185. },
  1186. },
  1187. }
  1188. // WpChatroomColumns holds the columns for the "wp_chatroom" table.
  1189. WpChatroomColumns = []*schema.Column{
  1190. {Name: "id", Type: field.TypeUint64, Increment: true},
  1191. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1192. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1193. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1194. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  1195. {Name: "chatroom_id", Type: field.TypeString, Comment: "群id", Default: ""},
  1196. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  1197. {Name: "owner", Type: field.TypeString, Comment: "群主", Default: ""},
  1198. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  1199. {Name: "member_list", Type: field.TypeJSON, Comment: "群成员"},
  1200. }
  1201. // WpChatroomTable holds the schema information for the "wp_chatroom" table.
  1202. WpChatroomTable = &schema.Table{
  1203. Name: "wp_chatroom",
  1204. Columns: WpChatroomColumns,
  1205. PrimaryKey: []*schema.Column{WpChatroomColumns[0]},
  1206. Indexes: []*schema.Index{
  1207. {
  1208. Name: "wpchatroom_wx_wxid_chatroom_id",
  1209. Unique: false,
  1210. Columns: []*schema.Column{WpChatroomColumns[4], WpChatroomColumns[5]},
  1211. },
  1212. },
  1213. }
  1214. // WpChatroomMemberColumns holds the columns for the "wp_chatroom_member" table.
  1215. WpChatroomMemberColumns = []*schema.Column{
  1216. {Name: "id", Type: field.TypeUint64, Increment: true},
  1217. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1218. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1219. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1220. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  1221. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1222. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  1223. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  1224. }
  1225. // WpChatroomMemberTable holds the schema information for the "wp_chatroom_member" table.
  1226. WpChatroomMemberTable = &schema.Table{
  1227. Name: "wp_chatroom_member",
  1228. Columns: WpChatroomMemberColumns,
  1229. PrimaryKey: []*schema.Column{WpChatroomMemberColumns[0]},
  1230. Indexes: []*schema.Index{
  1231. {
  1232. Name: "wpchatroommember_wx_wxid_wxid",
  1233. Unique: false,
  1234. Columns: []*schema.Column{WpChatroomMemberColumns[4], WpChatroomMemberColumns[5]},
  1235. },
  1236. },
  1237. }
  1238. // WxColumns holds the columns for the "wx" table.
  1239. WxColumns = []*schema.Column{
  1240. {Name: "id", Type: field.TypeUint64, Increment: true},
  1241. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1242. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1243. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  1244. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1245. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  1246. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  1247. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  1248. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1249. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  1250. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  1251. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  1252. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  1253. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  1254. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  1255. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  1256. {Name: "allow_list", Type: field.TypeJSON, Comment: "白名单"},
  1257. {Name: "group_allow_list", Type: field.TypeJSON, Comment: "群白名单"},
  1258. {Name: "block_list", Type: field.TypeJSON, Comment: "黑名单"},
  1259. {Name: "group_block_list", Type: field.TypeJSON, Comment: "群黑名单"},
  1260. {Name: "ctype", Type: field.TypeUint64, Nullable: true, Comment: "账号类型:1-个微 2-企微", Default: 1},
  1261. {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
  1262. {Name: "agent_base_wx_agent", Type: field.TypeString, Nullable: true},
  1263. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  1264. }
  1265. // WxTable holds the schema information for the "wx" table.
  1266. WxTable = &schema.Table{
  1267. Name: "wx",
  1268. Columns: WxColumns,
  1269. PrimaryKey: []*schema.Column{WxColumns[0]},
  1270. ForeignKeys: []*schema.ForeignKey{
  1271. {
  1272. Symbol: "wx_agent_wx_agent",
  1273. Columns: []*schema.Column{WxColumns[21]},
  1274. RefColumns: []*schema.Column{AgentColumns[0]},
  1275. OnDelete: schema.NoAction,
  1276. },
  1277. {
  1278. Symbol: "wx_agent_base_wx_agent",
  1279. Columns: []*schema.Column{WxColumns[22]},
  1280. RefColumns: []*schema.Column{AgentBaseColumns[0]},
  1281. OnDelete: schema.SetNull,
  1282. },
  1283. {
  1284. Symbol: "wx_server_wxs",
  1285. Columns: []*schema.Column{WxColumns[23]},
  1286. RefColumns: []*schema.Column{ServerColumns[0]},
  1287. OnDelete: schema.SetNull,
  1288. },
  1289. },
  1290. Indexes: []*schema.Index{
  1291. {
  1292. Name: "wx_server_id_port_ctype",
  1293. Unique: true,
  1294. Columns: []*schema.Column{WxColumns[23], WxColumns[5], WxColumns[20]},
  1295. },
  1296. {
  1297. Name: "wx_wxid",
  1298. Unique: true,
  1299. Columns: []*schema.Column{WxColumns[8]},
  1300. },
  1301. {
  1302. Name: "wx_account",
  1303. Unique: false,
  1304. Columns: []*schema.Column{WxColumns[9]},
  1305. },
  1306. {
  1307. Name: "wx_nickname",
  1308. Unique: false,
  1309. Columns: []*schema.Column{WxColumns[10]},
  1310. },
  1311. {
  1312. Name: "wx_tel",
  1313. Unique: false,
  1314. Columns: []*schema.Column{WxColumns[11]},
  1315. },
  1316. },
  1317. }
  1318. // WxCardColumns holds the columns for the "wx_card" table.
  1319. WxCardColumns = []*schema.Column{
  1320. {Name: "id", Type: field.TypeUint64, Increment: true},
  1321. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1322. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1323. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1324. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1325. {Name: "wx_user_id", Type: field.TypeUint64, Nullable: true, Comment: "wx表ID", Default: 0},
  1326. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1327. {Name: "logo", Type: field.TypeString, Comment: "logo", Default: ""},
  1328. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  1329. {Name: "company", Type: field.TypeString, Comment: "公司", Default: ""},
  1330. {Name: "address", Type: field.TypeString, Comment: "地址", Default: ""},
  1331. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1332. {Name: "official_account", Type: field.TypeString, Comment: "公众号", Default: ""},
  1333. {Name: "wechat_account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1334. {Name: "email", Type: field.TypeString, Nullable: true, Comment: "邮箱", Default: ""},
  1335. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "fastgpt-base"},
  1336. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "fastgpt-key"},
  1337. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  1338. {Name: "intro", Type: field.TypeString, Nullable: true, Comment: "个人介绍", Default: ""},
  1339. }
  1340. // WxCardTable holds the schema information for the "wx_card" table.
  1341. WxCardTable = &schema.Table{
  1342. Name: "wx_card",
  1343. Columns: WxCardColumns,
  1344. PrimaryKey: []*schema.Column{WxCardColumns[0]},
  1345. Indexes: []*schema.Index{
  1346. {
  1347. Name: "wxcard_user_id",
  1348. Unique: false,
  1349. Columns: []*schema.Column{WxCardColumns[4]},
  1350. },
  1351. {
  1352. Name: "wxcard_wx_user_id",
  1353. Unique: false,
  1354. Columns: []*schema.Column{WxCardColumns[5]},
  1355. },
  1356. },
  1357. }
  1358. // WxCardUserColumns holds the columns for the "wx_card_user" table.
  1359. WxCardUserColumns = []*schema.Column{
  1360. {Name: "id", Type: field.TypeUint64, Increment: true},
  1361. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1362. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1363. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1364. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1365. {Name: "account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1366. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1367. {Name: "nickname", Type: field.TypeString, Comment: "昵称", Default: ""},
  1368. {Name: "remark", Type: field.TypeString, Comment: "备注名", Default: ""},
  1369. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1370. {Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
  1371. {Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
  1372. {Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
  1373. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  1374. }
  1375. // WxCardUserTable holds the schema information for the "wx_card_user" table.
  1376. WxCardUserTable = &schema.Table{
  1377. Name: "wx_card_user",
  1378. Columns: WxCardUserColumns,
  1379. PrimaryKey: []*schema.Column{WxCardUserColumns[0]},
  1380. Indexes: []*schema.Index{
  1381. {
  1382. Name: "wxcarduser_wxid_open_id",
  1383. Unique: false,
  1384. Columns: []*schema.Column{WxCardUserColumns[4], WxCardUserColumns[10]},
  1385. },
  1386. },
  1387. }
  1388. // WxCardVisitColumns holds the columns for the "wx_card_visit" table.
  1389. WxCardVisitColumns = []*schema.Column{
  1390. {Name: "id", Type: field.TypeUint64, Increment: true},
  1391. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1392. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1393. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1394. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1395. {Name: "bot_id", Type: field.TypeUint64, Comment: "被访ID", Default: 0},
  1396. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序 3-智能体", Default: 0},
  1397. }
  1398. // WxCardVisitTable holds the schema information for the "wx_card_visit" table.
  1399. WxCardVisitTable = &schema.Table{
  1400. Name: "wx_card_visit",
  1401. Columns: WxCardVisitColumns,
  1402. PrimaryKey: []*schema.Column{WxCardVisitColumns[0]},
  1403. Indexes: []*schema.Index{
  1404. {
  1405. Name: "wxcardvisit_user_id",
  1406. Unique: false,
  1407. Columns: []*schema.Column{WxCardVisitColumns[4]},
  1408. },
  1409. {
  1410. Name: "wxcardvisit_bot_id_bot_type",
  1411. Unique: false,
  1412. Columns: []*schema.Column{WxCardVisitColumns[5], WxCardVisitColumns[6]},
  1413. },
  1414. },
  1415. }
  1416. // Tables holds all the tables in the schema.
  1417. Tables = []*schema.Table{
  1418. AgentTable,
  1419. AgentBaseTable,
  1420. AliyunAvatarTable,
  1421. AllocAgentTable,
  1422. APIKeyTable,
  1423. BatchMsgTable,
  1424. CategoryTable,
  1425. ChatRecordsTable,
  1426. ChatSessionTable,
  1427. ContactTable,
  1428. CreditBalanceTable,
  1429. CreditUsageTable,
  1430. EmployeeTable,
  1431. EmployeeConfigTable,
  1432. LabelTable,
  1433. LabelRelationshipTable,
  1434. LabelTaggingTable,
  1435. MessagesTable,
  1436. MessageRecordsTable,
  1437. MsgTable,
  1438. PayRechargeTable,
  1439. ServerTable,
  1440. SopNodeTable,
  1441. SopStageTable,
  1442. SopTaskTable,
  1443. TokenTable,
  1444. TutorialTable,
  1445. UsageDetailTable,
  1446. UsageStatisticDayTable,
  1447. UsageStatisticHourTable,
  1448. UsageStatisticMonthTable,
  1449. UsageTotalTable,
  1450. WhatsappTable,
  1451. WhatsappChannelTable,
  1452. WorkExperienceTable,
  1453. WpChatroomTable,
  1454. WpChatroomMemberTable,
  1455. WxTable,
  1456. WxCardTable,
  1457. WxCardUserTable,
  1458. WxCardVisitTable,
  1459. }
  1460. )
  1461. func init() {
  1462. AgentTable.Annotation = &entsql.Annotation{
  1463. Table: "agent",
  1464. }
  1465. AgentBaseTable.Annotation = &entsql.Annotation{
  1466. Table: "agent_base",
  1467. }
  1468. AliyunAvatarTable.Annotation = &entsql.Annotation{
  1469. Table: "aliyun_avatar",
  1470. }
  1471. AllocAgentTable.Annotation = &entsql.Annotation{
  1472. Table: "alloc_agent",
  1473. }
  1474. APIKeyTable.ForeignKeys[0].RefTable = AgentTable
  1475. APIKeyTable.Annotation = &entsql.Annotation{
  1476. Table: "api_key",
  1477. }
  1478. BatchMsgTable.Annotation = &entsql.Annotation{
  1479. Table: "batch_msg",
  1480. }
  1481. CategoryTable.Annotation = &entsql.Annotation{
  1482. Table: "category",
  1483. }
  1484. ChatRecordsTable.Annotation = &entsql.Annotation{
  1485. Table: "chat_records",
  1486. }
  1487. ChatSessionTable.Annotation = &entsql.Annotation{
  1488. Table: "chat_session",
  1489. }
  1490. ContactTable.Annotation = &entsql.Annotation{
  1491. Table: "contact",
  1492. }
  1493. CreditBalanceTable.Annotation = &entsql.Annotation{
  1494. Table: "credit_balance",
  1495. }
  1496. CreditUsageTable.Annotation = &entsql.Annotation{
  1497. Table: "credit_usage",
  1498. }
  1499. EmployeeTable.Annotation = &entsql.Annotation{
  1500. Table: "employee",
  1501. }
  1502. EmployeeConfigTable.Annotation = &entsql.Annotation{
  1503. Table: "employee_config",
  1504. }
  1505. LabelTable.Annotation = &entsql.Annotation{
  1506. Table: "label",
  1507. }
  1508. LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
  1509. LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
  1510. LabelRelationshipTable.Annotation = &entsql.Annotation{
  1511. Table: "label_relationship",
  1512. }
  1513. LabelTaggingTable.Annotation = &entsql.Annotation{
  1514. Table: "label_tagging",
  1515. }
  1516. MessagesTable.Annotation = &entsql.Annotation{
  1517. Table: "messages",
  1518. }
  1519. MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
  1520. MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
  1521. MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
  1522. MessageRecordsTable.Annotation = &entsql.Annotation{
  1523. Table: "message_records",
  1524. }
  1525. MsgTable.Annotation = &entsql.Annotation{
  1526. Table: "msg",
  1527. }
  1528. PayRechargeTable.Annotation = &entsql.Annotation{
  1529. Table: "pay_recharge",
  1530. }
  1531. ServerTable.Annotation = &entsql.Annotation{
  1532. Table: "server",
  1533. }
  1534. SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
  1535. SopNodeTable.Annotation = &entsql.Annotation{
  1536. Table: "sop_node",
  1537. }
  1538. SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
  1539. SopStageTable.Annotation = &entsql.Annotation{
  1540. Table: "sop_stage",
  1541. }
  1542. SopTaskTable.Annotation = &entsql.Annotation{
  1543. Table: "sop_task",
  1544. }
  1545. TokenTable.ForeignKeys[0].RefTable = AgentTable
  1546. TokenTable.Annotation = &entsql.Annotation{
  1547. Table: "token",
  1548. }
  1549. TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
  1550. TutorialTable.Annotation = &entsql.Annotation{
  1551. Table: "tutorial",
  1552. }
  1553. UsageDetailTable.Annotation = &entsql.Annotation{
  1554. Table: "usage_detail",
  1555. }
  1556. UsageStatisticDayTable.Annotation = &entsql.Annotation{
  1557. Table: "usage_statistic_day",
  1558. }
  1559. UsageStatisticHourTable.Annotation = &entsql.Annotation{
  1560. Table: "usage_statistic_hour",
  1561. }
  1562. UsageStatisticMonthTable.Annotation = &entsql.Annotation{
  1563. Table: "usage_statistic_month",
  1564. }
  1565. UsageTotalTable.Annotation = &entsql.Annotation{
  1566. Table: "usage_total",
  1567. }
  1568. WhatsappTable.ForeignKeys[0].RefTable = AgentTable
  1569. WhatsappTable.Annotation = &entsql.Annotation{
  1570. Table: "whatsapp",
  1571. }
  1572. WhatsappChannelTable.Annotation = &entsql.Annotation{
  1573. Table: "whatsapp_channel",
  1574. }
  1575. WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
  1576. WorkExperienceTable.Annotation = &entsql.Annotation{
  1577. Table: "work_experience",
  1578. }
  1579. WpChatroomTable.Annotation = &entsql.Annotation{
  1580. Table: "wp_chatroom",
  1581. }
  1582. WpChatroomMemberTable.Annotation = &entsql.Annotation{
  1583. Table: "wp_chatroom_member",
  1584. }
  1585. WxTable.ForeignKeys[0].RefTable = AgentTable
  1586. WxTable.ForeignKeys[1].RefTable = AgentBaseTable
  1587. WxTable.ForeignKeys[2].RefTable = ServerTable
  1588. WxTable.Annotation = &entsql.Annotation{
  1589. Table: "wx",
  1590. }
  1591. WxCardTable.Annotation = &entsql.Annotation{
  1592. Table: "wx_card",
  1593. }
  1594. WxCardUserTable.Annotation = &entsql.Annotation{
  1595. Table: "wx_card_user",
  1596. }
  1597. WxCardVisitTable.Annotation = &entsql.Annotation{
  1598. Table: "wx_card_visit",
  1599. }
  1600. }