schema.go 88 KB

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