usagestatisticmonth.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // Code generated by ent, DO NOT EDIT.
  2. package usagestatisticmonth
  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 usagestatisticmonth type in the database.
  10. Label = "usage_statistic_month"
  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. // FieldStatus holds the string denoting the status field in the database.
  18. FieldStatus = "status"
  19. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  20. FieldDeletedAt = "deleted_at"
  21. // FieldAddtime holds the string denoting the addtime field in the database.
  22. FieldAddtime = "addtime"
  23. // FieldType holds the string denoting the type field in the database.
  24. FieldType = "type"
  25. // FieldBotID holds the string denoting the bot_id field in the database.
  26. FieldBotID = "bot_id"
  27. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  28. FieldOrganizationID = "organization_id"
  29. // FieldAiResponse holds the string denoting the ai_response field in the database.
  30. FieldAiResponse = "ai_response"
  31. // FieldSopRun holds the string denoting the sop_run field in the database.
  32. FieldSopRun = "sop_run"
  33. // FieldTotalFriend holds the string denoting the total_friend field in the database.
  34. FieldTotalFriend = "total_friend"
  35. // FieldTotalGroup holds the string denoting the total_group field in the database.
  36. FieldTotalGroup = "total_group"
  37. // FieldAccountBalance holds the string denoting the account_balance field in the database.
  38. FieldAccountBalance = "account_balance"
  39. // FieldConsumeToken holds the string denoting the consume_token field in the database.
  40. FieldConsumeToken = "consume_token"
  41. // FieldActiveUser holds the string denoting the active_user field in the database.
  42. FieldActiveUser = "active_user"
  43. // FieldNewUser holds the string denoting the new_user field in the database.
  44. FieldNewUser = "new_user"
  45. // FieldLabelDist holds the string denoting the label_dist field in the database.
  46. FieldLabelDist = "label_dist"
  47. // Table holds the table name of the usagestatisticmonth in the database.
  48. Table = "usage_statistic_month"
  49. )
  50. // Columns holds all SQL columns for usagestatisticmonth fields.
  51. var Columns = []string{
  52. FieldID,
  53. FieldCreatedAt,
  54. FieldUpdatedAt,
  55. FieldStatus,
  56. FieldDeletedAt,
  57. FieldAddtime,
  58. FieldType,
  59. FieldBotID,
  60. FieldOrganizationID,
  61. FieldAiResponse,
  62. FieldSopRun,
  63. FieldTotalFriend,
  64. FieldTotalGroup,
  65. FieldAccountBalance,
  66. FieldConsumeToken,
  67. FieldActiveUser,
  68. FieldNewUser,
  69. FieldLabelDist,
  70. }
  71. // ValidColumn reports if the column name is valid (part of the table columns).
  72. func ValidColumn(column string) bool {
  73. for i := range Columns {
  74. if column == Columns[i] {
  75. return true
  76. }
  77. }
  78. return false
  79. }
  80. // Note that the variables below are initialized by the runtime
  81. // package on the initialization of the application. Therefore,
  82. // it should be imported in the main as follows:
  83. //
  84. // import _ "wechat-api/ent/runtime"
  85. var (
  86. Hooks [1]ent.Hook
  87. Interceptors [1]ent.Interceptor
  88. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  89. DefaultCreatedAt func() time.Time
  90. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  91. DefaultUpdatedAt func() time.Time
  92. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  93. UpdateDefaultUpdatedAt func() time.Time
  94. // DefaultStatus holds the default value on creation for the "status" field.
  95. DefaultStatus uint8
  96. )
  97. // OrderOption defines the ordering options for the UsageStatisticMonth queries.
  98. type OrderOption func(*sql.Selector)
  99. // ByID orders the results by the id field.
  100. func ByID(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldID, opts...).ToFunc()
  102. }
  103. // ByCreatedAt orders the results by the created_at field.
  104. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  106. }
  107. // ByUpdatedAt orders the results by the updated_at field.
  108. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  110. }
  111. // ByStatus orders the results by the status field.
  112. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  114. }
  115. // ByDeletedAt orders the results by the deleted_at field.
  116. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  118. }
  119. // ByAddtime orders the results by the addtime field.
  120. func ByAddtime(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldAddtime, opts...).ToFunc()
  122. }
  123. // ByType orders the results by the type field.
  124. func ByType(opts ...sql.OrderTermOption) OrderOption {
  125. return sql.OrderByField(FieldType, opts...).ToFunc()
  126. }
  127. // ByBotID orders the results by the bot_id field.
  128. func ByBotID(opts ...sql.OrderTermOption) OrderOption {
  129. return sql.OrderByField(FieldBotID, opts...).ToFunc()
  130. }
  131. // ByOrganizationID orders the results by the organization_id field.
  132. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  133. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  134. }
  135. // ByAiResponse orders the results by the ai_response field.
  136. func ByAiResponse(opts ...sql.OrderTermOption) OrderOption {
  137. return sql.OrderByField(FieldAiResponse, opts...).ToFunc()
  138. }
  139. // BySopRun orders the results by the sop_run field.
  140. func BySopRun(opts ...sql.OrderTermOption) OrderOption {
  141. return sql.OrderByField(FieldSopRun, opts...).ToFunc()
  142. }
  143. // ByTotalFriend orders the results by the total_friend field.
  144. func ByTotalFriend(opts ...sql.OrderTermOption) OrderOption {
  145. return sql.OrderByField(FieldTotalFriend, opts...).ToFunc()
  146. }
  147. // ByTotalGroup orders the results by the total_group field.
  148. func ByTotalGroup(opts ...sql.OrderTermOption) OrderOption {
  149. return sql.OrderByField(FieldTotalGroup, opts...).ToFunc()
  150. }
  151. // ByAccountBalance orders the results by the account_balance field.
  152. func ByAccountBalance(opts ...sql.OrderTermOption) OrderOption {
  153. return sql.OrderByField(FieldAccountBalance, opts...).ToFunc()
  154. }
  155. // ByConsumeToken orders the results by the consume_token field.
  156. func ByConsumeToken(opts ...sql.OrderTermOption) OrderOption {
  157. return sql.OrderByField(FieldConsumeToken, opts...).ToFunc()
  158. }
  159. // ByActiveUser orders the results by the active_user field.
  160. func ByActiveUser(opts ...sql.OrderTermOption) OrderOption {
  161. return sql.OrderByField(FieldActiveUser, opts...).ToFunc()
  162. }
  163. // ByNewUser orders the results by the new_user field.
  164. func ByNewUser(opts ...sql.OrderTermOption) OrderOption {
  165. return sql.OrderByField(FieldNewUser, opts...).ToFunc()
  166. }