runtime.go 35 KB

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