wxcarduser.go 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. // Code generated by ent, DO NOT EDIT.
  2. package wxcarduser
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. )
  8. const (
  9. // Label holds the string label denoting the wxcarduser type in the database.
  10. Label = "wx_card_user"
  11. // FieldID holds the string denoting the id field in the database.
  12. FieldID = "id"
  13. // FieldCreatedAt holds the string denoting the created_at field in the database.
  14. FieldCreatedAt = "created_at"
  15. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  16. FieldUpdatedAt = "updated_at"
  17. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  18. FieldDeletedAt = "deleted_at"
  19. // FieldWxid holds the string denoting the wxid field in the database.
  20. FieldWxid = "wxid"
  21. // FieldAccount holds the string denoting the account field in the database.
  22. FieldAccount = "account"
  23. // FieldAvatar holds the string denoting the avatar field in the database.
  24. FieldAvatar = "avatar"
  25. // FieldNickname holds the string denoting the nickname field in the database.
  26. FieldNickname = "nickname"
  27. // FieldRemark holds the string denoting the remark field in the database.
  28. FieldRemark = "remark"
  29. // FieldPhone holds the string denoting the phone field in the database.
  30. FieldPhone = "phone"
  31. // FieldOpenID holds the string denoting the open_id field in the database.
  32. FieldOpenID = "open_id"
  33. // FieldUnionID holds the string denoting the union_id field in the database.
  34. FieldUnionID = "union_id"
  35. // FieldSessionKey holds the string denoting the session_key field in the database.
  36. FieldSessionKey = "session_key"
  37. // FieldIsVip holds the string denoting the is_vip field in the database.
  38. FieldIsVip = "is_vip"
  39. // Table holds the table name of the wxcarduser in the database.
  40. Table = "wx_card_user"
  41. )
  42. // Columns holds all SQL columns for wxcarduser fields.
  43. var Columns = []string{
  44. FieldID,
  45. FieldCreatedAt,
  46. FieldUpdatedAt,
  47. FieldDeletedAt,
  48. FieldWxid,
  49. FieldAccount,
  50. FieldAvatar,
  51. FieldNickname,
  52. FieldRemark,
  53. FieldPhone,
  54. FieldOpenID,
  55. FieldUnionID,
  56. FieldSessionKey,
  57. FieldIsVip,
  58. }
  59. // ValidColumn reports if the column name is valid (part of the table columns).
  60. func ValidColumn(column string) bool {
  61. for i := range Columns {
  62. if column == Columns[i] {
  63. return true
  64. }
  65. }
  66. return false
  67. }
  68. // Note that the variables below are initialized by the runtime
  69. // package on the initialization of the application. Therefore,
  70. // it should be imported in the main as follows:
  71. //
  72. // import _ "wechat-api/ent/runtime"
  73. var (
  74. Hooks [1]ent.Hook
  75. Interceptors [1]ent.Interceptor
  76. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  77. DefaultCreatedAt func() time.Time
  78. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  79. DefaultUpdatedAt func() time.Time
  80. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  81. UpdateDefaultUpdatedAt func() time.Time
  82. // DefaultWxid holds the default value on creation for the "wxid" field.
  83. DefaultWxid string
  84. // DefaultAccount holds the default value on creation for the "account" field.
  85. DefaultAccount string
  86. // DefaultAvatar holds the default value on creation for the "avatar" field.
  87. DefaultAvatar string
  88. // DefaultNickname holds the default value on creation for the "nickname" field.
  89. DefaultNickname string
  90. // DefaultRemark holds the default value on creation for the "remark" field.
  91. DefaultRemark string
  92. // DefaultPhone holds the default value on creation for the "phone" field.
  93. DefaultPhone string
  94. // DefaultOpenID holds the default value on creation for the "open_id" field.
  95. DefaultOpenID string
  96. // DefaultUnionID holds the default value on creation for the "union_id" field.
  97. DefaultUnionID string
  98. // DefaultSessionKey holds the default value on creation for the "session_key" field.
  99. DefaultSessionKey string
  100. // DefaultIsVip holds the default value on creation for the "is_vip" field.
  101. DefaultIsVip int
  102. )
  103. // OrderOption defines the ordering options for the WxCardUser queries.
  104. type OrderOption func(*sql.Selector)
  105. // ByID orders the results by the id field.
  106. func ByID(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldID, opts...).ToFunc()
  108. }
  109. // ByCreatedAt orders the results by the created_at field.
  110. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  111. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  112. }
  113. // ByUpdatedAt orders the results by the updated_at field.
  114. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  115. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  116. }
  117. // ByDeletedAt orders the results by the deleted_at field.
  118. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  119. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  120. }
  121. // ByWxid orders the results by the wxid field.
  122. func ByWxid(opts ...sql.OrderTermOption) OrderOption {
  123. return sql.OrderByField(FieldWxid, opts...).ToFunc()
  124. }
  125. // ByAccount orders the results by the account field.
  126. func ByAccount(opts ...sql.OrderTermOption) OrderOption {
  127. return sql.OrderByField(FieldAccount, opts...).ToFunc()
  128. }
  129. // ByAvatar orders the results by the avatar field.
  130. func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
  131. return sql.OrderByField(FieldAvatar, opts...).ToFunc()
  132. }
  133. // ByNickname orders the results by the nickname field.
  134. func ByNickname(opts ...sql.OrderTermOption) OrderOption {
  135. return sql.OrderByField(FieldNickname, opts...).ToFunc()
  136. }
  137. // ByRemark orders the results by the remark field.
  138. func ByRemark(opts ...sql.OrderTermOption) OrderOption {
  139. return sql.OrderByField(FieldRemark, opts...).ToFunc()
  140. }
  141. // ByPhone orders the results by the phone field.
  142. func ByPhone(opts ...sql.OrderTermOption) OrderOption {
  143. return sql.OrderByField(FieldPhone, opts...).ToFunc()
  144. }
  145. // ByOpenID orders the results by the open_id field.
  146. func ByOpenID(opts ...sql.OrderTermOption) OrderOption {
  147. return sql.OrderByField(FieldOpenID, opts...).ToFunc()
  148. }
  149. // ByUnionID orders the results by the union_id field.
  150. func ByUnionID(opts ...sql.OrderTermOption) OrderOption {
  151. return sql.OrderByField(FieldUnionID, opts...).ToFunc()
  152. }
  153. // BySessionKey orders the results by the session_key field.
  154. func BySessionKey(opts ...sql.OrderTermOption) OrderOption {
  155. return sql.OrderByField(FieldSessionKey, opts...).ToFunc()
  156. }
  157. // ByIsVip orders the results by the is_vip field.
  158. func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
  159. return sql.OrderByField(FieldIsVip, opts...).ToFunc()
  160. }