creditusage.go 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. // Code generated by ent, DO NOT EDIT.
  2. package creditusage
  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 creditusage type in the database.
  10. Label = "credit_usage"
  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. // FieldUserID holds the string denoting the user_id field in the database.
  20. FieldUserID = "user_id"
  21. // FieldNumber holds the string denoting the number field in the database.
  22. FieldNumber = "number"
  23. // FieldPayNumber holds the string denoting the pay_number field in the database.
  24. FieldPayNumber = "pay_number"
  25. // FieldBeforeNumber holds the string denoting the before_number field in the database.
  26. FieldBeforeNumber = "before_number"
  27. // FieldAfterNumber holds the string denoting the after_number field in the database.
  28. FieldAfterNumber = "after_number"
  29. // FieldPayMethod holds the string denoting the pay_method field in the database.
  30. FieldPayMethod = "pay_method"
  31. // FieldStatus holds the string denoting the status field in the database.
  32. FieldStatus = "status"
  33. // FieldNtype holds the string denoting the ntype field in the database.
  34. FieldNtype = "ntype"
  35. // FieldTable holds the string denoting the table field in the database.
  36. FieldTable = "table"
  37. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  38. FieldOrganizationID = "organization_id"
  39. // FieldNid holds the string denoting the nid field in the database.
  40. FieldNid = "nid"
  41. // FieldReason holds the string denoting the reason field in the database.
  42. FieldReason = "reason"
  43. // FieldOperator holds the string denoting the operator field in the database.
  44. FieldOperator = "operator"
  45. // Table holds the table name of the creditusage in the database.
  46. Table = "credit_usage"
  47. )
  48. // Columns holds all SQL columns for creditusage fields.
  49. var Columns = []string{
  50. FieldID,
  51. FieldCreatedAt,
  52. FieldUpdatedAt,
  53. FieldDeletedAt,
  54. FieldUserID,
  55. FieldNumber,
  56. FieldPayNumber,
  57. FieldBeforeNumber,
  58. FieldAfterNumber,
  59. FieldPayMethod,
  60. FieldStatus,
  61. FieldNtype,
  62. FieldTable,
  63. FieldOrganizationID,
  64. FieldNid,
  65. FieldReason,
  66. FieldOperator,
  67. }
  68. // ValidColumn reports if the column name is valid (part of the table columns).
  69. func ValidColumn(column string) bool {
  70. for i := range Columns {
  71. if column == Columns[i] {
  72. return true
  73. }
  74. }
  75. return false
  76. }
  77. // Note that the variables below are initialized by the runtime
  78. // package on the initialization of the application. Therefore,
  79. // it should be imported in the main as follows:
  80. //
  81. // import _ "wechat-api/ent/runtime"
  82. var (
  83. Hooks [1]ent.Hook
  84. Interceptors [1]ent.Interceptor
  85. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  86. DefaultCreatedAt func() time.Time
  87. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  88. DefaultUpdatedAt func() time.Time
  89. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  90. UpdateDefaultUpdatedAt func() time.Time
  91. // UserIDValidator is a validator for the "user_id" field. It is called by the builders before save.
  92. UserIDValidator func(string) error
  93. // DefaultStatus holds the default value on creation for the "status" field.
  94. DefaultStatus int
  95. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  96. StatusValidator func(int) error
  97. // DefaultNtype holds the default value on creation for the "ntype" field.
  98. DefaultNtype int
  99. // DefaultTable holds the default value on creation for the "table" field.
  100. DefaultTable string
  101. // DefaultNid holds the default value on creation for the "nid" field.
  102. DefaultNid uint64
  103. // DefaultReason holds the default value on creation for the "reason" field.
  104. DefaultReason string
  105. // ReasonValidator is a validator for the "reason" field. It is called by the builders before save.
  106. ReasonValidator func(string) error
  107. // DefaultOperator holds the default value on creation for the "operator" field.
  108. DefaultOperator string
  109. // OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
  110. OperatorValidator func(string) error
  111. )
  112. // OrderOption defines the ordering options for the CreditUsage queries.
  113. type OrderOption func(*sql.Selector)
  114. // ByID orders the results by the id field.
  115. func ByID(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldID, opts...).ToFunc()
  117. }
  118. // ByCreatedAt orders the results by the created_at field.
  119. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  121. }
  122. // ByUpdatedAt orders the results by the updated_at field.
  123. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  125. }
  126. // ByDeletedAt orders the results by the deleted_at field.
  127. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  129. }
  130. // ByUserID orders the results by the user_id field.
  131. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  133. }
  134. // ByNumber orders the results by the number field.
  135. func ByNumber(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldNumber, opts...).ToFunc()
  137. }
  138. // ByPayNumber orders the results by the pay_number field.
  139. func ByPayNumber(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldPayNumber, opts...).ToFunc()
  141. }
  142. // ByBeforeNumber orders the results by the before_number field.
  143. func ByBeforeNumber(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldBeforeNumber, opts...).ToFunc()
  145. }
  146. // ByAfterNumber orders the results by the after_number field.
  147. func ByAfterNumber(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldAfterNumber, opts...).ToFunc()
  149. }
  150. // ByPayMethod orders the results by the pay_method field.
  151. func ByPayMethod(opts ...sql.OrderTermOption) OrderOption {
  152. return sql.OrderByField(FieldPayMethod, opts...).ToFunc()
  153. }
  154. // ByStatus orders the results by the status field.
  155. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  156. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  157. }
  158. // ByNtype orders the results by the ntype field.
  159. func ByNtype(opts ...sql.OrderTermOption) OrderOption {
  160. return sql.OrderByField(FieldNtype, opts...).ToFunc()
  161. }
  162. // ByTable orders the results by the table field.
  163. func ByTable(opts ...sql.OrderTermOption) OrderOption {
  164. return sql.OrderByField(FieldTable, opts...).ToFunc()
  165. }
  166. // ByOrganizationID orders the results by the organization_id field.
  167. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  168. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  169. }
  170. // ByNid orders the results by the nid field.
  171. func ByNid(opts ...sql.OrderTermOption) OrderOption {
  172. return sql.OrderByField(FieldNid, opts...).ToFunc()
  173. }
  174. // ByReason orders the results by the reason field.
  175. func ByReason(opts ...sql.OrderTermOption) OrderOption {
  176. return sql.OrderByField(FieldReason, opts...).ToFunc()
  177. }
  178. // ByOperator orders the results by the operator field.
  179. func ByOperator(opts ...sql.OrderTermOption) OrderOption {
  180. return sql.OrderByField(FieldOperator, opts...).ToFunc()
  181. }