runtime.go 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. // Code generated by ent, DO NOT EDIT.
  2. package runtime
  3. import (
  4. "time"
  5. "wechat-api/ent/agent"
  6. "wechat-api/ent/batchmsg"
  7. "wechat-api/ent/contact"
  8. "wechat-api/ent/label"
  9. "wechat-api/ent/labelrelationship"
  10. "wechat-api/ent/message"
  11. "wechat-api/ent/messagerecords"
  12. "wechat-api/ent/msg"
  13. "wechat-api/ent/schema"
  14. "wechat-api/ent/server"
  15. "wechat-api/ent/sopnode"
  16. "wechat-api/ent/sopstage"
  17. "wechat-api/ent/soptask"
  18. "wechat-api/ent/wx"
  19. )
  20. // The init function reads all schema descriptors with runtime code
  21. // (default values, validators, hooks and policies) and stitches it
  22. // to their package variables.
  23. func init() {
  24. agentMixin := schema.Agent{}.Mixin()
  25. agentMixinHooks1 := agentMixin[1].Hooks()
  26. agent.Hooks[0] = agentMixinHooks1[0]
  27. agentMixinInters1 := agentMixin[1].Interceptors()
  28. agent.Interceptors[0] = agentMixinInters1[0]
  29. agentMixinFields0 := agentMixin[0].Fields()
  30. _ = agentMixinFields0
  31. agentFields := schema.Agent{}.Fields()
  32. _ = agentFields
  33. // agentDescCreatedAt is the schema descriptor for created_at field.
  34. agentDescCreatedAt := agentMixinFields0[1].Descriptor()
  35. // agent.DefaultCreatedAt holds the default value on creation for the created_at field.
  36. agent.DefaultCreatedAt = agentDescCreatedAt.Default.(func() time.Time)
  37. // agentDescUpdatedAt is the schema descriptor for updated_at field.
  38. agentDescUpdatedAt := agentMixinFields0[2].Descriptor()
  39. // agent.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  40. agent.DefaultUpdatedAt = agentDescUpdatedAt.Default.(func() time.Time)
  41. // agent.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  42. agent.UpdateDefaultUpdatedAt = agentDescUpdatedAt.UpdateDefault.(func() time.Time)
  43. // agentDescName is the schema descriptor for name field.
  44. agentDescName := agentFields[0].Descriptor()
  45. // agent.NameValidator is a validator for the "name" field. It is called by the builders before save.
  46. agent.NameValidator = agentDescName.Validators[0].(func(string) error)
  47. // agentDescRole is the schema descriptor for role field.
  48. agentDescRole := agentFields[1].Descriptor()
  49. // agent.RoleValidator is a validator for the "role" field. It is called by the builders before save.
  50. agent.RoleValidator = agentDescRole.Validators[0].(func(string) error)
  51. // agentDescStatus is the schema descriptor for status field.
  52. agentDescStatus := agentFields[2].Descriptor()
  53. // agent.DefaultStatus holds the default value on creation for the status field.
  54. agent.DefaultStatus = agentDescStatus.Default.(int)
  55. // agent.StatusValidator is a validator for the "status" field. It is called by the builders before save.
  56. agent.StatusValidator = agentDescStatus.Validators[0].(func(int) error)
  57. // agentDescBackground is the schema descriptor for background field.
  58. agentDescBackground := agentFields[3].Descriptor()
  59. // agent.DefaultBackground holds the default value on creation for the background field.
  60. agent.DefaultBackground = agentDescBackground.Default.(string)
  61. // agent.BackgroundValidator is a validator for the "background" field. It is called by the builders before save.
  62. agent.BackgroundValidator = agentDescBackground.Validators[0].(func(string) error)
  63. // agentDescExamples is the schema descriptor for examples field.
  64. agentDescExamples := agentFields[4].Descriptor()
  65. // agent.DefaultExamples holds the default value on creation for the examples field.
  66. agent.DefaultExamples = agentDescExamples.Default.(string)
  67. // agent.ExamplesValidator is a validator for the "examples" field. It is called by the builders before save.
  68. agent.ExamplesValidator = agentDescExamples.Validators[0].(func(string) error)
  69. // agentDescOrganizationID is the schema descriptor for organization_id field.
  70. agentDescOrganizationID := agentFields[5].Descriptor()
  71. // agent.OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  72. agent.OrganizationIDValidator = agentDescOrganizationID.Validators[0].(func(uint64) error)
  73. batchmsgMixin := schema.BatchMsg{}.Mixin()
  74. batchmsgMixinHooks1 := batchmsgMixin[1].Hooks()
  75. batchmsg.Hooks[0] = batchmsgMixinHooks1[0]
  76. batchmsgMixinInters1 := batchmsgMixin[1].Interceptors()
  77. batchmsg.Interceptors[0] = batchmsgMixinInters1[0]
  78. batchmsgMixinFields0 := batchmsgMixin[0].Fields()
  79. _ = batchmsgMixinFields0
  80. batchmsgFields := schema.BatchMsg{}.Fields()
  81. _ = batchmsgFields
  82. // batchmsgDescCreatedAt is the schema descriptor for created_at field.
  83. batchmsgDescCreatedAt := batchmsgMixinFields0[1].Descriptor()
  84. // batchmsg.DefaultCreatedAt holds the default value on creation for the created_at field.
  85. batchmsg.DefaultCreatedAt = batchmsgDescCreatedAt.Default.(func() time.Time)
  86. // batchmsgDescUpdatedAt is the schema descriptor for updated_at field.
  87. batchmsgDescUpdatedAt := batchmsgMixinFields0[2].Descriptor()
  88. // batchmsg.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  89. batchmsg.DefaultUpdatedAt = batchmsgDescUpdatedAt.Default.(func() time.Time)
  90. // batchmsg.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  91. batchmsg.UpdateDefaultUpdatedAt = batchmsgDescUpdatedAt.UpdateDefault.(func() time.Time)
  92. contactMixin := schema.Contact{}.Mixin()
  93. contactMixinHooks2 := contactMixin[2].Hooks()
  94. contact.Hooks[0] = contactMixinHooks2[0]
  95. contactMixinInters2 := contactMixin[2].Interceptors()
  96. contact.Interceptors[0] = contactMixinInters2[0]
  97. contactMixinFields0 := contactMixin[0].Fields()
  98. _ = contactMixinFields0
  99. contactMixinFields1 := contactMixin[1].Fields()
  100. _ = contactMixinFields1
  101. contactFields := schema.Contact{}.Fields()
  102. _ = contactFields
  103. // contactDescCreatedAt is the schema descriptor for created_at field.
  104. contactDescCreatedAt := contactMixinFields0[1].Descriptor()
  105. // contact.DefaultCreatedAt holds the default value on creation for the created_at field.
  106. contact.DefaultCreatedAt = contactDescCreatedAt.Default.(func() time.Time)
  107. // contactDescUpdatedAt is the schema descriptor for updated_at field.
  108. contactDescUpdatedAt := contactMixinFields0[2].Descriptor()
  109. // contact.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  110. contact.DefaultUpdatedAt = contactDescUpdatedAt.Default.(func() time.Time)
  111. // contact.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  112. contact.UpdateDefaultUpdatedAt = contactDescUpdatedAt.UpdateDefault.(func() time.Time)
  113. // contactDescStatus is the schema descriptor for status field.
  114. contactDescStatus := contactMixinFields1[0].Descriptor()
  115. // contact.DefaultStatus holds the default value on creation for the status field.
  116. contact.DefaultStatus = contactDescStatus.Default.(uint8)
  117. // contactDescWxWxid is the schema descriptor for wx_wxid field.
  118. contactDescWxWxid := contactFields[0].Descriptor()
  119. // contact.DefaultWxWxid holds the default value on creation for the wx_wxid field.
  120. contact.DefaultWxWxid = contactDescWxWxid.Default.(string)
  121. // contactDescType is the schema descriptor for type field.
  122. contactDescType := contactFields[1].Descriptor()
  123. // contact.DefaultType holds the default value on creation for the type field.
  124. contact.DefaultType = contactDescType.Default.(int)
  125. // contactDescWxid is the schema descriptor for wxid field.
  126. contactDescWxid := contactFields[2].Descriptor()
  127. // contact.DefaultWxid holds the default value on creation for the wxid field.
  128. contact.DefaultWxid = contactDescWxid.Default.(string)
  129. // contactDescAccount is the schema descriptor for account field.
  130. contactDescAccount := contactFields[3].Descriptor()
  131. // contact.DefaultAccount holds the default value on creation for the account field.
  132. contact.DefaultAccount = contactDescAccount.Default.(string)
  133. // contactDescNickname is the schema descriptor for nickname field.
  134. contactDescNickname := contactFields[4].Descriptor()
  135. // contact.DefaultNickname holds the default value on creation for the nickname field.
  136. contact.DefaultNickname = contactDescNickname.Default.(string)
  137. // contactDescMarkname is the schema descriptor for markname field.
  138. contactDescMarkname := contactFields[5].Descriptor()
  139. // contact.DefaultMarkname holds the default value on creation for the markname field.
  140. contact.DefaultMarkname = contactDescMarkname.Default.(string)
  141. // contactDescHeadimg is the schema descriptor for headimg field.
  142. contactDescHeadimg := contactFields[6].Descriptor()
  143. // contact.DefaultHeadimg holds the default value on creation for the headimg field.
  144. contact.DefaultHeadimg = contactDescHeadimg.Default.(string)
  145. // contactDescSex is the schema descriptor for sex field.
  146. contactDescSex := contactFields[7].Descriptor()
  147. // contact.DefaultSex holds the default value on creation for the sex field.
  148. contact.DefaultSex = contactDescSex.Default.(int)
  149. // contactDescStarrole is the schema descriptor for starrole field.
  150. contactDescStarrole := contactFields[8].Descriptor()
  151. // contact.DefaultStarrole holds the default value on creation for the starrole field.
  152. contact.DefaultStarrole = contactDescStarrole.Default.(string)
  153. // contactDescDontseeit is the schema descriptor for dontseeit field.
  154. contactDescDontseeit := contactFields[9].Descriptor()
  155. // contact.DefaultDontseeit holds the default value on creation for the dontseeit field.
  156. contact.DefaultDontseeit = contactDescDontseeit.Default.(int)
  157. // contactDescDontseeme is the schema descriptor for dontseeme field.
  158. contactDescDontseeme := contactFields[10].Descriptor()
  159. // contact.DefaultDontseeme holds the default value on creation for the dontseeme field.
  160. contact.DefaultDontseeme = contactDescDontseeme.Default.(int)
  161. // contactDescLag is the schema descriptor for lag field.
  162. contactDescLag := contactFields[11].Descriptor()
  163. // contact.DefaultLag holds the default value on creation for the lag field.
  164. contact.DefaultLag = contactDescLag.Default.(string)
  165. // contactDescGid is the schema descriptor for gid field.
  166. contactDescGid := contactFields[12].Descriptor()
  167. // contact.DefaultGid holds the default value on creation for the gid field.
  168. contact.DefaultGid = contactDescGid.Default.(string)
  169. // contactDescGname is the schema descriptor for gname field.
  170. contactDescGname := contactFields[13].Descriptor()
  171. // contact.DefaultGname holds the default value on creation for the gname field.
  172. contact.DefaultGname = contactDescGname.Default.(string)
  173. // contactDescV3 is the schema descriptor for v3 field.
  174. contactDescV3 := contactFields[14].Descriptor()
  175. // contact.DefaultV3 holds the default value on creation for the v3 field.
  176. contact.DefaultV3 = contactDescV3.Default.(string)
  177. // contactDescOrganizationID is the schema descriptor for organization_id field.
  178. contactDescOrganizationID := contactFields[15].Descriptor()
  179. // contact.DefaultOrganizationID holds the default value on creation for the organization_id field.
  180. contact.DefaultOrganizationID = contactDescOrganizationID.Default.(uint64)
  181. labelMixin := schema.Label{}.Mixin()
  182. labelMixinFields0 := labelMixin[0].Fields()
  183. _ = labelMixinFields0
  184. labelMixinFields1 := labelMixin[1].Fields()
  185. _ = labelMixinFields1
  186. labelFields := schema.Label{}.Fields()
  187. _ = labelFields
  188. // labelDescCreatedAt is the schema descriptor for created_at field.
  189. labelDescCreatedAt := labelMixinFields0[1].Descriptor()
  190. // label.DefaultCreatedAt holds the default value on creation for the created_at field.
  191. label.DefaultCreatedAt = labelDescCreatedAt.Default.(func() time.Time)
  192. // labelDescUpdatedAt is the schema descriptor for updated_at field.
  193. labelDescUpdatedAt := labelMixinFields0[2].Descriptor()
  194. // label.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  195. label.DefaultUpdatedAt = labelDescUpdatedAt.Default.(func() time.Time)
  196. // label.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  197. label.UpdateDefaultUpdatedAt = labelDescUpdatedAt.UpdateDefault.(func() time.Time)
  198. // labelDescStatus is the schema descriptor for status field.
  199. labelDescStatus := labelMixinFields1[0].Descriptor()
  200. // label.DefaultStatus holds the default value on creation for the status field.
  201. label.DefaultStatus = labelDescStatus.Default.(uint8)
  202. // labelDescType is the schema descriptor for type field.
  203. labelDescType := labelFields[0].Descriptor()
  204. // label.DefaultType holds the default value on creation for the type field.
  205. label.DefaultType = labelDescType.Default.(int)
  206. // labelDescName is the schema descriptor for name field.
  207. labelDescName := labelFields[1].Descriptor()
  208. // label.DefaultName holds the default value on creation for the name field.
  209. label.DefaultName = labelDescName.Default.(string)
  210. // labelDescFrom is the schema descriptor for from field.
  211. labelDescFrom := labelFields[2].Descriptor()
  212. // label.DefaultFrom holds the default value on creation for the from field.
  213. label.DefaultFrom = labelDescFrom.Default.(int)
  214. // labelDescMode is the schema descriptor for mode field.
  215. labelDescMode := labelFields[3].Descriptor()
  216. // label.DefaultMode holds the default value on creation for the mode field.
  217. label.DefaultMode = labelDescMode.Default.(int)
  218. // labelDescConditions is the schema descriptor for conditions field.
  219. labelDescConditions := labelFields[4].Descriptor()
  220. // label.DefaultConditions holds the default value on creation for the conditions field.
  221. label.DefaultConditions = labelDescConditions.Default.(string)
  222. // labelDescOrganizationID is the schema descriptor for organization_id field.
  223. labelDescOrganizationID := labelFields[5].Descriptor()
  224. // label.DefaultOrganizationID holds the default value on creation for the organization_id field.
  225. label.DefaultOrganizationID = labelDescOrganizationID.Default.(uint64)
  226. labelrelationshipMixin := schema.LabelRelationship{}.Mixin()
  227. labelrelationshipMixinHooks2 := labelrelationshipMixin[2].Hooks()
  228. labelrelationship.Hooks[0] = labelrelationshipMixinHooks2[0]
  229. labelrelationshipMixinInters2 := labelrelationshipMixin[2].Interceptors()
  230. labelrelationship.Interceptors[0] = labelrelationshipMixinInters2[0]
  231. labelrelationshipMixinFields0 := labelrelationshipMixin[0].Fields()
  232. _ = labelrelationshipMixinFields0
  233. labelrelationshipMixinFields1 := labelrelationshipMixin[1].Fields()
  234. _ = labelrelationshipMixinFields1
  235. labelrelationshipFields := schema.LabelRelationship{}.Fields()
  236. _ = labelrelationshipFields
  237. // labelrelationshipDescCreatedAt is the schema descriptor for created_at field.
  238. labelrelationshipDescCreatedAt := labelrelationshipMixinFields0[1].Descriptor()
  239. // labelrelationship.DefaultCreatedAt holds the default value on creation for the created_at field.
  240. labelrelationship.DefaultCreatedAt = labelrelationshipDescCreatedAt.Default.(func() time.Time)
  241. // labelrelationshipDescUpdatedAt is the schema descriptor for updated_at field.
  242. labelrelationshipDescUpdatedAt := labelrelationshipMixinFields0[2].Descriptor()
  243. // labelrelationship.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  244. labelrelationship.DefaultUpdatedAt = labelrelationshipDescUpdatedAt.Default.(func() time.Time)
  245. // labelrelationship.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  246. labelrelationship.UpdateDefaultUpdatedAt = labelrelationshipDescUpdatedAt.UpdateDefault.(func() time.Time)
  247. // labelrelationshipDescStatus is the schema descriptor for status field.
  248. labelrelationshipDescStatus := labelrelationshipMixinFields1[0].Descriptor()
  249. // labelrelationship.DefaultStatus holds the default value on creation for the status field.
  250. labelrelationship.DefaultStatus = labelrelationshipDescStatus.Default.(uint8)
  251. // labelrelationshipDescLabelID is the schema descriptor for label_id field.
  252. labelrelationshipDescLabelID := labelrelationshipFields[0].Descriptor()
  253. // labelrelationship.DefaultLabelID holds the default value on creation for the label_id field.
  254. labelrelationship.DefaultLabelID = labelrelationshipDescLabelID.Default.(uint64)
  255. // labelrelationshipDescContactID is the schema descriptor for contact_id field.
  256. labelrelationshipDescContactID := labelrelationshipFields[1].Descriptor()
  257. // labelrelationship.DefaultContactID holds the default value on creation for the contact_id field.
  258. labelrelationship.DefaultContactID = labelrelationshipDescContactID.Default.(uint64)
  259. // labelrelationshipDescOrganizationID is the schema descriptor for organization_id field.
  260. labelrelationshipDescOrganizationID := labelrelationshipFields[2].Descriptor()
  261. // labelrelationship.DefaultOrganizationID holds the default value on creation for the organization_id field.
  262. labelrelationship.DefaultOrganizationID = labelrelationshipDescOrganizationID.Default.(uint64)
  263. messageFields := schema.Message{}.Fields()
  264. _ = messageFields
  265. // messageDescWxWxid is the schema descriptor for wx_wxid field.
  266. messageDescWxWxid := messageFields[0].Descriptor()
  267. // message.DefaultWxWxid holds the default value on creation for the wx_wxid field.
  268. message.DefaultWxWxid = messageDescWxWxid.Default.(string)
  269. // messageDescWxid is the schema descriptor for wxid field.
  270. messageDescWxid := messageFields[1].Descriptor()
  271. // message.DefaultWxid holds the default value on creation for the wxid field.
  272. message.DefaultWxid = messageDescWxid.Default.(string)
  273. // messageDescContent is the schema descriptor for content field.
  274. messageDescContent := messageFields[2].Descriptor()
  275. // message.DefaultContent holds the default value on creation for the content field.
  276. message.DefaultContent = messageDescContent.Default.(string)
  277. messagerecordsMixin := schema.MessageRecords{}.Mixin()
  278. messagerecordsMixinHooks2 := messagerecordsMixin[2].Hooks()
  279. messagerecords.Hooks[0] = messagerecordsMixinHooks2[0]
  280. messagerecordsMixinInters2 := messagerecordsMixin[2].Interceptors()
  281. messagerecords.Interceptors[0] = messagerecordsMixinInters2[0]
  282. messagerecordsMixinFields0 := messagerecordsMixin[0].Fields()
  283. _ = messagerecordsMixinFields0
  284. messagerecordsMixinFields1 := messagerecordsMixin[1].Fields()
  285. _ = messagerecordsMixinFields1
  286. messagerecordsFields := schema.MessageRecords{}.Fields()
  287. _ = messagerecordsFields
  288. // messagerecordsDescCreatedAt is the schema descriptor for created_at field.
  289. messagerecordsDescCreatedAt := messagerecordsMixinFields0[1].Descriptor()
  290. // messagerecords.DefaultCreatedAt holds the default value on creation for the created_at field.
  291. messagerecords.DefaultCreatedAt = messagerecordsDescCreatedAt.Default.(func() time.Time)
  292. // messagerecordsDescUpdatedAt is the schema descriptor for updated_at field.
  293. messagerecordsDescUpdatedAt := messagerecordsMixinFields0[2].Descriptor()
  294. // messagerecords.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  295. messagerecords.DefaultUpdatedAt = messagerecordsDescUpdatedAt.Default.(func() time.Time)
  296. // messagerecords.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  297. messagerecords.UpdateDefaultUpdatedAt = messagerecordsDescUpdatedAt.UpdateDefault.(func() time.Time)
  298. // messagerecordsDescStatus is the schema descriptor for status field.
  299. messagerecordsDescStatus := messagerecordsMixinFields1[0].Descriptor()
  300. // messagerecords.DefaultStatus holds the default value on creation for the status field.
  301. messagerecords.DefaultStatus = messagerecordsDescStatus.Default.(uint8)
  302. // messagerecordsDescContactType is the schema descriptor for contact_type field.
  303. messagerecordsDescContactType := messagerecordsFields[2].Descriptor()
  304. // messagerecords.DefaultContactType holds the default value on creation for the contact_type field.
  305. messagerecords.DefaultContactType = messagerecordsDescContactType.Default.(int)
  306. // messagerecordsDescContactWxid is the schema descriptor for contact_wxid field.
  307. messagerecordsDescContactWxid := messagerecordsFields[3].Descriptor()
  308. // messagerecords.DefaultContactWxid holds the default value on creation for the contact_wxid field.
  309. messagerecords.DefaultContactWxid = messagerecordsDescContactWxid.Default.(string)
  310. // messagerecordsDescContentType is the schema descriptor for content_type field.
  311. messagerecordsDescContentType := messagerecordsFields[4].Descriptor()
  312. // messagerecords.DefaultContentType holds the default value on creation for the content_type field.
  313. messagerecords.DefaultContentType = messagerecordsDescContentType.Default.(int)
  314. // messagerecordsDescContent is the schema descriptor for content field.
  315. messagerecordsDescContent := messagerecordsFields[5].Descriptor()
  316. // messagerecords.DefaultContent holds the default value on creation for the content field.
  317. messagerecords.DefaultContent = messagerecordsDescContent.Default.(string)
  318. // messagerecordsDescErrorDetail is the schema descriptor for error_detail field.
  319. messagerecordsDescErrorDetail := messagerecordsFields[7].Descriptor()
  320. // messagerecords.DefaultErrorDetail holds the default value on creation for the error_detail field.
  321. messagerecords.DefaultErrorDetail = messagerecordsDescErrorDetail.Default.(string)
  322. // messagerecordsDescSourceType is the schema descriptor for source_type field.
  323. messagerecordsDescSourceType := messagerecordsFields[9].Descriptor()
  324. // messagerecords.DefaultSourceType holds the default value on creation for the source_type field.
  325. messagerecords.DefaultSourceType = messagerecordsDescSourceType.Default.(int)
  326. // messagerecordsDescSourceID is the schema descriptor for source_id field.
  327. messagerecordsDescSourceID := messagerecordsFields[10].Descriptor()
  328. // messagerecords.DefaultSourceID holds the default value on creation for the source_id field.
  329. messagerecords.DefaultSourceID = messagerecordsDescSourceID.Default.(uint64)
  330. // messagerecordsDescSubSourceID is the schema descriptor for sub_source_id field.
  331. messagerecordsDescSubSourceID := messagerecordsFields[11].Descriptor()
  332. // messagerecords.DefaultSubSourceID holds the default value on creation for the sub_source_id field.
  333. messagerecords.DefaultSubSourceID = messagerecordsDescSubSourceID.Default.(uint64)
  334. // messagerecordsDescOrganizationID is the schema descriptor for organization_id field.
  335. messagerecordsDescOrganizationID := messagerecordsFields[12].Descriptor()
  336. // messagerecords.DefaultOrganizationID holds the default value on creation for the organization_id field.
  337. messagerecords.DefaultOrganizationID = messagerecordsDescOrganizationID.Default.(uint64)
  338. msgMixin := schema.Msg{}.Mixin()
  339. msgMixinHooks1 := msgMixin[1].Hooks()
  340. msg.Hooks[0] = msgMixinHooks1[0]
  341. msgMixinInters1 := msgMixin[1].Interceptors()
  342. msg.Interceptors[0] = msgMixinInters1[0]
  343. msgMixinFields0 := msgMixin[0].Fields()
  344. _ = msgMixinFields0
  345. msgFields := schema.Msg{}.Fields()
  346. _ = msgFields
  347. // msgDescCreatedAt is the schema descriptor for created_at field.
  348. msgDescCreatedAt := msgMixinFields0[1].Descriptor()
  349. // msg.DefaultCreatedAt holds the default value on creation for the created_at field.
  350. msg.DefaultCreatedAt = msgDescCreatedAt.Default.(func() time.Time)
  351. // msgDescUpdatedAt is the schema descriptor for updated_at field.
  352. msgDescUpdatedAt := msgMixinFields0[2].Descriptor()
  353. // msg.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  354. msg.DefaultUpdatedAt = msgDescUpdatedAt.Default.(func() time.Time)
  355. // msg.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  356. msg.UpdateDefaultUpdatedAt = msgDescUpdatedAt.UpdateDefault.(func() time.Time)
  357. serverMixin := schema.Server{}.Mixin()
  358. serverMixinHooks2 := serverMixin[2].Hooks()
  359. server.Hooks[0] = serverMixinHooks2[0]
  360. serverMixinInters2 := serverMixin[2].Interceptors()
  361. server.Interceptors[0] = serverMixinInters2[0]
  362. serverMixinFields0 := serverMixin[0].Fields()
  363. _ = serverMixinFields0
  364. serverMixinFields1 := serverMixin[1].Fields()
  365. _ = serverMixinFields1
  366. serverFields := schema.Server{}.Fields()
  367. _ = serverFields
  368. // serverDescCreatedAt is the schema descriptor for created_at field.
  369. serverDescCreatedAt := serverMixinFields0[1].Descriptor()
  370. // server.DefaultCreatedAt holds the default value on creation for the created_at field.
  371. server.DefaultCreatedAt = serverDescCreatedAt.Default.(func() time.Time)
  372. // serverDescUpdatedAt is the schema descriptor for updated_at field.
  373. serverDescUpdatedAt := serverMixinFields0[2].Descriptor()
  374. // server.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  375. server.DefaultUpdatedAt = serverDescUpdatedAt.Default.(func() time.Time)
  376. // server.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  377. server.UpdateDefaultUpdatedAt = serverDescUpdatedAt.UpdateDefault.(func() time.Time)
  378. // serverDescStatus is the schema descriptor for status field.
  379. serverDescStatus := serverMixinFields1[0].Descriptor()
  380. // server.DefaultStatus holds the default value on creation for the status field.
  381. server.DefaultStatus = serverDescStatus.Default.(uint8)
  382. sopnodeMixin := schema.SopNode{}.Mixin()
  383. sopnodeMixinHooks2 := sopnodeMixin[2].Hooks()
  384. sopnode.Hooks[0] = sopnodeMixinHooks2[0]
  385. sopnodeMixinInters2 := sopnodeMixin[2].Interceptors()
  386. sopnode.Interceptors[0] = sopnodeMixinInters2[0]
  387. sopnodeMixinFields0 := sopnodeMixin[0].Fields()
  388. _ = sopnodeMixinFields0
  389. sopnodeMixinFields1 := sopnodeMixin[1].Fields()
  390. _ = sopnodeMixinFields1
  391. sopnodeFields := schema.SopNode{}.Fields()
  392. _ = sopnodeFields
  393. // sopnodeDescCreatedAt is the schema descriptor for created_at field.
  394. sopnodeDescCreatedAt := sopnodeMixinFields0[1].Descriptor()
  395. // sopnode.DefaultCreatedAt holds the default value on creation for the created_at field.
  396. sopnode.DefaultCreatedAt = sopnodeDescCreatedAt.Default.(func() time.Time)
  397. // sopnodeDescUpdatedAt is the schema descriptor for updated_at field.
  398. sopnodeDescUpdatedAt := sopnodeMixinFields0[2].Descriptor()
  399. // sopnode.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  400. sopnode.DefaultUpdatedAt = sopnodeDescUpdatedAt.Default.(func() time.Time)
  401. // sopnode.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  402. sopnode.UpdateDefaultUpdatedAt = sopnodeDescUpdatedAt.UpdateDefault.(func() time.Time)
  403. // sopnodeDescStatus is the schema descriptor for status field.
  404. sopnodeDescStatus := sopnodeMixinFields1[0].Descriptor()
  405. // sopnode.DefaultStatus holds the default value on creation for the status field.
  406. sopnode.DefaultStatus = sopnodeDescStatus.Default.(uint8)
  407. // sopnodeDescName is the schema descriptor for name field.
  408. sopnodeDescName := sopnodeFields[2].Descriptor()
  409. // sopnode.DefaultName holds the default value on creation for the name field.
  410. sopnode.DefaultName = sopnodeDescName.Default.(string)
  411. // sopnodeDescConditionType is the schema descriptor for condition_type field.
  412. sopnodeDescConditionType := sopnodeFields[3].Descriptor()
  413. // sopnode.DefaultConditionType holds the default value on creation for the condition_type field.
  414. sopnode.DefaultConditionType = sopnodeDescConditionType.Default.(int)
  415. // sopnodeDescNoReplyCondition is the schema descriptor for no_reply_condition field.
  416. sopnodeDescNoReplyCondition := sopnodeFields[5].Descriptor()
  417. // sopnode.DefaultNoReplyCondition holds the default value on creation for the no_reply_condition field.
  418. sopnode.DefaultNoReplyCondition = sopnodeDescNoReplyCondition.Default.(uint64)
  419. sopstageMixin := schema.SopStage{}.Mixin()
  420. sopstageMixinHooks2 := sopstageMixin[2].Hooks()
  421. sopstage.Hooks[0] = sopstageMixinHooks2[0]
  422. sopstageMixinInters2 := sopstageMixin[2].Interceptors()
  423. sopstage.Interceptors[0] = sopstageMixinInters2[0]
  424. sopstageMixinFields0 := sopstageMixin[0].Fields()
  425. _ = sopstageMixinFields0
  426. sopstageMixinFields1 := sopstageMixin[1].Fields()
  427. _ = sopstageMixinFields1
  428. sopstageFields := schema.SopStage{}.Fields()
  429. _ = sopstageFields
  430. // sopstageDescCreatedAt is the schema descriptor for created_at field.
  431. sopstageDescCreatedAt := sopstageMixinFields0[1].Descriptor()
  432. // sopstage.DefaultCreatedAt holds the default value on creation for the created_at field.
  433. sopstage.DefaultCreatedAt = sopstageDescCreatedAt.Default.(func() time.Time)
  434. // sopstageDescUpdatedAt is the schema descriptor for updated_at field.
  435. sopstageDescUpdatedAt := sopstageMixinFields0[2].Descriptor()
  436. // sopstage.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  437. sopstage.DefaultUpdatedAt = sopstageDescUpdatedAt.Default.(func() time.Time)
  438. // sopstage.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  439. sopstage.UpdateDefaultUpdatedAt = sopstageDescUpdatedAt.UpdateDefault.(func() time.Time)
  440. // sopstageDescStatus is the schema descriptor for status field.
  441. sopstageDescStatus := sopstageMixinFields1[0].Descriptor()
  442. // sopstage.DefaultStatus holds the default value on creation for the status field.
  443. sopstage.DefaultStatus = sopstageDescStatus.Default.(uint8)
  444. // sopstageDescName is the schema descriptor for name field.
  445. sopstageDescName := sopstageFields[1].Descriptor()
  446. // sopstage.DefaultName holds the default value on creation for the name field.
  447. sopstage.DefaultName = sopstageDescName.Default.(string)
  448. // sopstageDescConditionType is the schema descriptor for condition_type field.
  449. sopstageDescConditionType := sopstageFields[2].Descriptor()
  450. // sopstage.DefaultConditionType holds the default value on creation for the condition_type field.
  451. sopstage.DefaultConditionType = sopstageDescConditionType.Default.(int)
  452. // sopstageDescConditionOperator is the schema descriptor for condition_operator field.
  453. sopstageDescConditionOperator := sopstageFields[3].Descriptor()
  454. // sopstage.DefaultConditionOperator holds the default value on creation for the condition_operator field.
  455. sopstage.DefaultConditionOperator = sopstageDescConditionOperator.Default.(int)
  456. // sopstageDescIndexSort is the schema descriptor for index_sort field.
  457. sopstageDescIndexSort := sopstageFields[7].Descriptor()
  458. // sopstage.DefaultIndexSort holds the default value on creation for the index_sort field.
  459. sopstage.DefaultIndexSort = sopstageDescIndexSort.Default.(int)
  460. soptaskMixin := schema.SopTask{}.Mixin()
  461. soptaskMixinHooks2 := soptaskMixin[2].Hooks()
  462. soptask.Hooks[0] = soptaskMixinHooks2[0]
  463. soptaskMixinInters2 := soptaskMixin[2].Interceptors()
  464. soptask.Interceptors[0] = soptaskMixinInters2[0]
  465. soptaskMixinFields0 := soptaskMixin[0].Fields()
  466. _ = soptaskMixinFields0
  467. soptaskMixinFields1 := soptaskMixin[1].Fields()
  468. _ = soptaskMixinFields1
  469. soptaskFields := schema.SopTask{}.Fields()
  470. _ = soptaskFields
  471. // soptaskDescCreatedAt is the schema descriptor for created_at field.
  472. soptaskDescCreatedAt := soptaskMixinFields0[1].Descriptor()
  473. // soptask.DefaultCreatedAt holds the default value on creation for the created_at field.
  474. soptask.DefaultCreatedAt = soptaskDescCreatedAt.Default.(func() time.Time)
  475. // soptaskDescUpdatedAt is the schema descriptor for updated_at field.
  476. soptaskDescUpdatedAt := soptaskMixinFields0[2].Descriptor()
  477. // soptask.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  478. soptask.DefaultUpdatedAt = soptaskDescUpdatedAt.Default.(func() time.Time)
  479. // soptask.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  480. soptask.UpdateDefaultUpdatedAt = soptaskDescUpdatedAt.UpdateDefault.(func() time.Time)
  481. // soptaskDescStatus is the schema descriptor for status field.
  482. soptaskDescStatus := soptaskMixinFields1[0].Descriptor()
  483. // soptask.DefaultStatus holds the default value on creation for the status field.
  484. soptask.DefaultStatus = soptaskDescStatus.Default.(uint8)
  485. // soptaskDescName is the schema descriptor for name field.
  486. soptaskDescName := soptaskFields[0].Descriptor()
  487. // soptask.NameValidator is a validator for the "name" field. It is called by the builders before save.
  488. soptask.NameValidator = soptaskDescName.Validators[0].(func(string) error)
  489. // soptaskDescType is the schema descriptor for type field.
  490. soptaskDescType := soptaskFields[2].Descriptor()
  491. // soptask.DefaultType holds the default value on creation for the type field.
  492. soptask.DefaultType = soptaskDescType.Default.(int)
  493. // soptaskDescOrganizationID is the schema descriptor for organization_id field.
  494. soptaskDescOrganizationID := soptaskFields[6].Descriptor()
  495. // soptask.DefaultOrganizationID holds the default value on creation for the organization_id field.
  496. soptask.DefaultOrganizationID = soptaskDescOrganizationID.Default.(uint64)
  497. wxMixin := schema.Wx{}.Mixin()
  498. wxMixinHooks2 := wxMixin[2].Hooks()
  499. wx.Hooks[0] = wxMixinHooks2[0]
  500. wxMixinInters2 := wxMixin[2].Interceptors()
  501. wx.Interceptors[0] = wxMixinInters2[0]
  502. wxMixinFields0 := wxMixin[0].Fields()
  503. _ = wxMixinFields0
  504. wxMixinFields1 := wxMixin[1].Fields()
  505. _ = wxMixinFields1
  506. wxFields := schema.Wx{}.Fields()
  507. _ = wxFields
  508. // wxDescCreatedAt is the schema descriptor for created_at field.
  509. wxDescCreatedAt := wxMixinFields0[1].Descriptor()
  510. // wx.DefaultCreatedAt holds the default value on creation for the created_at field.
  511. wx.DefaultCreatedAt = wxDescCreatedAt.Default.(func() time.Time)
  512. // wxDescUpdatedAt is the schema descriptor for updated_at field.
  513. wxDescUpdatedAt := wxMixinFields0[2].Descriptor()
  514. // wx.DefaultUpdatedAt holds the default value on creation for the updated_at field.
  515. wx.DefaultUpdatedAt = wxDescUpdatedAt.Default.(func() time.Time)
  516. // wx.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
  517. wx.UpdateDefaultUpdatedAt = wxDescUpdatedAt.UpdateDefault.(func() time.Time)
  518. // wxDescStatus is the schema descriptor for status field.
  519. wxDescStatus := wxMixinFields1[0].Descriptor()
  520. // wx.DefaultStatus holds the default value on creation for the status field.
  521. wx.DefaultStatus = wxDescStatus.Default.(uint8)
  522. // wxDescServerID is the schema descriptor for server_id field.
  523. wxDescServerID := wxFields[0].Descriptor()
  524. // wx.DefaultServerID holds the default value on creation for the server_id field.
  525. wx.DefaultServerID = wxDescServerID.Default.(uint64)
  526. // wxDescPort is the schema descriptor for port field.
  527. wxDescPort := wxFields[1].Descriptor()
  528. // wx.DefaultPort holds the default value on creation for the port field.
  529. wx.DefaultPort = wxDescPort.Default.(string)
  530. // wxDescProcessID is the schema descriptor for process_id field.
  531. wxDescProcessID := wxFields[2].Descriptor()
  532. // wx.DefaultProcessID holds the default value on creation for the process_id field.
  533. wx.DefaultProcessID = wxDescProcessID.Default.(string)
  534. // wxDescCallback is the schema descriptor for callback field.
  535. wxDescCallback := wxFields[3].Descriptor()
  536. // wx.DefaultCallback holds the default value on creation for the callback field.
  537. wx.DefaultCallback = wxDescCallback.Default.(string)
  538. // wxDescWxid is the schema descriptor for wxid field.
  539. wxDescWxid := wxFields[4].Descriptor()
  540. // wx.DefaultWxid holds the default value on creation for the wxid field.
  541. wx.DefaultWxid = wxDescWxid.Default.(string)
  542. // wxDescAccount is the schema descriptor for account field.
  543. wxDescAccount := wxFields[5].Descriptor()
  544. // wx.DefaultAccount holds the default value on creation for the account field.
  545. wx.DefaultAccount = wxDescAccount.Default.(string)
  546. // wxDescNickname is the schema descriptor for nickname field.
  547. wxDescNickname := wxFields[6].Descriptor()
  548. // wx.DefaultNickname holds the default value on creation for the nickname field.
  549. wx.DefaultNickname = wxDescNickname.Default.(string)
  550. // wxDescTel is the schema descriptor for tel field.
  551. wxDescTel := wxFields[7].Descriptor()
  552. // wx.DefaultTel holds the default value on creation for the tel field.
  553. wx.DefaultTel = wxDescTel.Default.(string)
  554. // wxDescHeadBig is the schema descriptor for head_big field.
  555. wxDescHeadBig := wxFields[8].Descriptor()
  556. // wx.DefaultHeadBig holds the default value on creation for the head_big field.
  557. wx.DefaultHeadBig = wxDescHeadBig.Default.(string)
  558. // wxDescOrganizationID is the schema descriptor for organization_id field.
  559. wxDescOrganizationID := wxFields[9].Descriptor()
  560. // wx.DefaultOrganizationID holds the default value on creation for the organization_id field.
  561. wx.DefaultOrganizationID = wxDescOrganizationID.Default.(uint64)
  562. // wxDescAgentID is the schema descriptor for agent_id field.
  563. wxDescAgentID := wxFields[10].Descriptor()
  564. // wx.DefaultAgentID holds the default value on creation for the agent_id field.
  565. wx.DefaultAgentID = wxDescAgentID.Default.(uint64)
  566. }
  567. const (
  568. Version = "v0.13.1" // Version of ent codegen.
  569. Sum = "h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=" // Sum of ent codegen.
  570. )