messagerecords.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. // Code generated by ent, DO NOT EDIT.
  2. package messagerecords
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the messagerecords type in the database.
  9. Label = "message_records"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldCreatedAt holds the string denoting the created_at field in the database.
  13. FieldCreatedAt = "created_at"
  14. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  15. FieldUpdatedAt = "updated_at"
  16. // FieldStatus holds the string denoting the status field in the database.
  17. FieldStatus = "status"
  18. // FieldBotWxid holds the string denoting the bot_wxid field in the database.
  19. FieldBotWxid = "bot_wxid"
  20. // FieldContactID holds the string denoting the contact_id field in the database.
  21. FieldContactID = "contact_id"
  22. // FieldContactType holds the string denoting the contact_type field in the database.
  23. FieldContactType = "contact_type"
  24. // FieldContactWxid holds the string denoting the contact_wxid field in the database.
  25. FieldContactWxid = "contact_wxid"
  26. // FieldContentType holds the string denoting the content_type field in the database.
  27. FieldContentType = "content_type"
  28. // FieldContent holds the string denoting the content field in the database.
  29. FieldContent = "content"
  30. // FieldErrorDetail holds the string denoting the error_detail field in the database.
  31. FieldErrorDetail = "error_detail"
  32. // FieldSendTime holds the string denoting the send_time field in the database.
  33. FieldSendTime = "send_time"
  34. // FieldSourceType holds the string denoting the source_type field in the database.
  35. FieldSourceType = "source_type"
  36. // FieldSourceID holds the string denoting the source_id field in the database.
  37. FieldSourceID = "source_id"
  38. // FieldSubSourceID holds the string denoting the sub_source_id field in the database.
  39. FieldSubSourceID = "sub_source_id"
  40. // Table holds the table name of the messagerecords in the database.
  41. Table = "message_records"
  42. )
  43. // Columns holds all SQL columns for messagerecords fields.
  44. var Columns = []string{
  45. FieldID,
  46. FieldCreatedAt,
  47. FieldUpdatedAt,
  48. FieldStatus,
  49. FieldBotWxid,
  50. FieldContactID,
  51. FieldContactType,
  52. FieldContactWxid,
  53. FieldContentType,
  54. FieldContent,
  55. FieldErrorDetail,
  56. FieldSendTime,
  57. FieldSourceType,
  58. FieldSourceID,
  59. FieldSubSourceID,
  60. }
  61. // ValidColumn reports if the column name is valid (part of the table columns).
  62. func ValidColumn(column string) bool {
  63. for i := range Columns {
  64. if column == Columns[i] {
  65. return true
  66. }
  67. }
  68. return false
  69. }
  70. var (
  71. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  72. DefaultCreatedAt func() time.Time
  73. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  74. DefaultUpdatedAt func() time.Time
  75. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  76. UpdateDefaultUpdatedAt func() time.Time
  77. // DefaultStatus holds the default value on creation for the "status" field.
  78. DefaultStatus uint8
  79. // DefaultContactType holds the default value on creation for the "contact_type" field.
  80. DefaultContactType int
  81. // DefaultContactWxid holds the default value on creation for the "contact_wxid" field.
  82. DefaultContactWxid string
  83. // DefaultContentType holds the default value on creation for the "content_type" field.
  84. DefaultContentType int
  85. // DefaultContent holds the default value on creation for the "content" field.
  86. DefaultContent string
  87. // DefaultErrorDetail holds the default value on creation for the "error_detail" field.
  88. DefaultErrorDetail string
  89. // DefaultSourceType holds the default value on creation for the "source_type" field.
  90. DefaultSourceType int
  91. // DefaultSourceID holds the default value on creation for the "source_id" field.
  92. DefaultSourceID uint64
  93. // DefaultSubSourceID holds the default value on creation for the "sub_source_id" field.
  94. DefaultSubSourceID uint64
  95. )
  96. // OrderOption defines the ordering options for the MessageRecords queries.
  97. type OrderOption func(*sql.Selector)
  98. // ByID orders the results by the id field.
  99. func ByID(opts ...sql.OrderTermOption) OrderOption {
  100. return sql.OrderByField(FieldID, opts...).ToFunc()
  101. }
  102. // ByCreatedAt orders the results by the created_at field.
  103. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  104. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  105. }
  106. // ByUpdatedAt orders the results by the updated_at field.
  107. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  108. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  109. }
  110. // ByStatus orders the results by the status field.
  111. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  112. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  113. }
  114. // ByBotWxid orders the results by the bot_wxid field.
  115. func ByBotWxid(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldBotWxid, opts...).ToFunc()
  117. }
  118. // ByContactID orders the results by the contact_id field.
  119. func ByContactID(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldContactID, opts...).ToFunc()
  121. }
  122. // ByContactType orders the results by the contact_type field.
  123. func ByContactType(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldContactType, opts...).ToFunc()
  125. }
  126. // ByContactWxid orders the results by the contact_wxid field.
  127. func ByContactWxid(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldContactWxid, opts...).ToFunc()
  129. }
  130. // ByContentType orders the results by the content_type field.
  131. func ByContentType(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldContentType, opts...).ToFunc()
  133. }
  134. // ByContent orders the results by the content field.
  135. func ByContent(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldContent, opts...).ToFunc()
  137. }
  138. // ByErrorDetail orders the results by the error_detail field.
  139. func ByErrorDetail(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldErrorDetail, opts...).ToFunc()
  141. }
  142. // BySendTime orders the results by the send_time field.
  143. func BySendTime(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldSendTime, opts...).ToFunc()
  145. }
  146. // BySourceType orders the results by the source_type field.
  147. func BySourceType(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldSourceType, opts...).ToFunc()
  149. }
  150. // BySourceID orders the results by the source_id field.
  151. func BySourceID(opts ...sql.OrderTermOption) OrderOption {
  152. return sql.OrderByField(FieldSourceID, opts...).ToFunc()
  153. }
  154. // BySubSourceID orders the results by the sub_source_id field.
  155. func BySubSourceID(opts ...sql.OrderTermOption) OrderOption {
  156. return sql.OrderByField(FieldSubSourceID, opts...).ToFunc()
  157. }