aliyunavatar.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // Code generated by ent, DO NOT EDIT.
  2. package aliyunavatar
  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 aliyunavatar type in the database.
  10. Label = "aliyun_avatar"
  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. // FieldBizID holds the string denoting the biz_id field in the database.
  22. FieldBizID = "biz_id"
  23. // FieldAccessKeyID holds the string denoting the access_key_id field in the database.
  24. FieldAccessKeyID = "access_key_id"
  25. // FieldAccessKeySecret holds the string denoting the access_key_secret field in the database.
  26. FieldAccessKeySecret = "access_key_secret"
  27. // FieldAppID holds the string denoting the app_id field in the database.
  28. FieldAppID = "app_id"
  29. // FieldTenantID holds the string denoting the tenant_id field in the database.
  30. FieldTenantID = "tenant_id"
  31. // FieldResponse holds the string denoting the response field in the database.
  32. FieldResponse = "response"
  33. // FieldToken holds the string denoting the token field in the database.
  34. FieldToken = "token"
  35. // FieldSessionID holds the string denoting the session_id field in the database.
  36. FieldSessionID = "session_id"
  37. // Table holds the table name of the aliyunavatar in the database.
  38. Table = "aliyun_avatar"
  39. )
  40. // Columns holds all SQL columns for aliyunavatar fields.
  41. var Columns = []string{
  42. FieldID,
  43. FieldCreatedAt,
  44. FieldUpdatedAt,
  45. FieldDeletedAt,
  46. FieldUserID,
  47. FieldBizID,
  48. FieldAccessKeyID,
  49. FieldAccessKeySecret,
  50. FieldAppID,
  51. FieldTenantID,
  52. FieldResponse,
  53. FieldToken,
  54. FieldSessionID,
  55. }
  56. // ValidColumn reports if the column name is valid (part of the table columns).
  57. func ValidColumn(column string) bool {
  58. for i := range Columns {
  59. if column == Columns[i] {
  60. return true
  61. }
  62. }
  63. return false
  64. }
  65. // Note that the variables below are initialized by the runtime
  66. // package on the initialization of the application. Therefore,
  67. // it should be imported in the main as follows:
  68. //
  69. // import _ "wechat-api/ent/runtime"
  70. var (
  71. Hooks [1]ent.Hook
  72. Interceptors [1]ent.Interceptor
  73. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  74. DefaultCreatedAt func() time.Time
  75. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  76. DefaultUpdatedAt func() time.Time
  77. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  78. UpdateDefaultUpdatedAt func() time.Time
  79. // DefaultToken holds the default value on creation for the "token" field.
  80. DefaultToken string
  81. // DefaultSessionID holds the default value on creation for the "session_id" field.
  82. DefaultSessionID string
  83. )
  84. // OrderOption defines the ordering options for the AliyunAvatar queries.
  85. type OrderOption func(*sql.Selector)
  86. // ByID orders the results by the id field.
  87. func ByID(opts ...sql.OrderTermOption) OrderOption {
  88. return sql.OrderByField(FieldID, opts...).ToFunc()
  89. }
  90. // ByCreatedAt orders the results by the created_at field.
  91. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  92. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  93. }
  94. // ByUpdatedAt orders the results by the updated_at field.
  95. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  96. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  97. }
  98. // ByDeletedAt orders the results by the deleted_at field.
  99. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  100. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  101. }
  102. // ByUserID orders the results by the user_id field.
  103. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  104. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  105. }
  106. // ByBizID orders the results by the biz_id field.
  107. func ByBizID(opts ...sql.OrderTermOption) OrderOption {
  108. return sql.OrderByField(FieldBizID, opts...).ToFunc()
  109. }
  110. // ByAccessKeyID orders the results by the access_key_id field.
  111. func ByAccessKeyID(opts ...sql.OrderTermOption) OrderOption {
  112. return sql.OrderByField(FieldAccessKeyID, opts...).ToFunc()
  113. }
  114. // ByAccessKeySecret orders the results by the access_key_secret field.
  115. func ByAccessKeySecret(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldAccessKeySecret, opts...).ToFunc()
  117. }
  118. // ByAppID orders the results by the app_id field.
  119. func ByAppID(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldAppID, opts...).ToFunc()
  121. }
  122. // ByTenantID orders the results by the tenant_id field.
  123. func ByTenantID(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldTenantID, opts...).ToFunc()
  125. }
  126. // ByResponse orders the results by the response field.
  127. func ByResponse(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldResponse, opts...).ToFunc()
  129. }
  130. // ByToken orders the results by the token field.
  131. func ByToken(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldToken, opts...).ToFunc()
  133. }
  134. // BySessionID orders the results by the session_id field.
  135. func BySessionID(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldSessionID, opts...).ToFunc()
  137. }