chatrecords.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // Code generated by ent, DO NOT EDIT.
  2. package chatrecords
  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 chatrecords type in the database.
  10. Label = "chat_records"
  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. // FieldContent holds the string denoting the content field in the database.
  20. FieldContent = "content"
  21. // FieldContentType holds the string denoting the content_type field in the database.
  22. FieldContentType = "content_type"
  23. // FieldSessionID holds the string denoting the session_id field in the database.
  24. FieldSessionID = "session_id"
  25. // FieldUserID holds the string denoting the user_id field in the database.
  26. FieldUserID = "user_id"
  27. // FieldBotID holds the string denoting the bot_id field in the database.
  28. FieldBotID = "bot_id"
  29. // FieldBotType holds the string denoting the bot_type field in the database.
  30. FieldBotType = "bot_type"
  31. // Table holds the table name of the chatrecords in the database.
  32. Table = "chat_records"
  33. )
  34. // Columns holds all SQL columns for chatrecords fields.
  35. var Columns = []string{
  36. FieldID,
  37. FieldCreatedAt,
  38. FieldUpdatedAt,
  39. FieldDeletedAt,
  40. FieldContent,
  41. FieldContentType,
  42. FieldSessionID,
  43. FieldUserID,
  44. FieldBotID,
  45. FieldBotType,
  46. }
  47. // ValidColumn reports if the column name is valid (part of the table columns).
  48. func ValidColumn(column string) bool {
  49. for i := range Columns {
  50. if column == Columns[i] {
  51. return true
  52. }
  53. }
  54. return false
  55. }
  56. // Note that the variables below are initialized by the runtime
  57. // package on the initialization of the application. Therefore,
  58. // it should be imported in the main as follows:
  59. //
  60. // import _ "wechat-api/ent/runtime"
  61. var (
  62. Hooks [1]ent.Hook
  63. Interceptors [1]ent.Interceptor
  64. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  65. DefaultCreatedAt func() time.Time
  66. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  67. DefaultUpdatedAt func() time.Time
  68. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  69. UpdateDefaultUpdatedAt func() time.Time
  70. // DefaultContent holds the default value on creation for the "content" field.
  71. DefaultContent string
  72. // DefaultContentType holds the default value on creation for the "content_type" field.
  73. DefaultContentType uint8
  74. // DefaultSessionID holds the default value on creation for the "session_id" field.
  75. DefaultSessionID uint64
  76. // DefaultUserID holds the default value on creation for the "user_id" field.
  77. DefaultUserID uint64
  78. // DefaultBotID holds the default value on creation for the "bot_id" field.
  79. DefaultBotID uint64
  80. // DefaultBotType holds the default value on creation for the "bot_type" field.
  81. DefaultBotType uint8
  82. )
  83. // OrderOption defines the ordering options for the ChatRecords queries.
  84. type OrderOption func(*sql.Selector)
  85. // ByID orders the results by the id field.
  86. func ByID(opts ...sql.OrderTermOption) OrderOption {
  87. return sql.OrderByField(FieldID, opts...).ToFunc()
  88. }
  89. // ByCreatedAt orders the results by the created_at field.
  90. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  91. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  92. }
  93. // ByUpdatedAt orders the results by the updated_at field.
  94. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  95. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  96. }
  97. // ByDeletedAt orders the results by the deleted_at field.
  98. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  99. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  100. }
  101. // ByContent orders the results by the content field.
  102. func ByContent(opts ...sql.OrderTermOption) OrderOption {
  103. return sql.OrderByField(FieldContent, opts...).ToFunc()
  104. }
  105. // ByContentType orders the results by the content_type field.
  106. func ByContentType(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldContentType, opts...).ToFunc()
  108. }
  109. // BySessionID orders the results by the session_id field.
  110. func BySessionID(opts ...sql.OrderTermOption) OrderOption {
  111. return sql.OrderByField(FieldSessionID, opts...).ToFunc()
  112. }
  113. // ByUserID orders the results by the user_id field.
  114. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  115. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  116. }
  117. // ByBotID orders the results by the bot_id field.
  118. func ByBotID(opts ...sql.OrderTermOption) OrderOption {
  119. return sql.OrderByField(FieldBotID, opts...).ToFunc()
  120. }
  121. // ByBotType orders the results by the bot_type field.
  122. func ByBotType(opts ...sql.OrderTermOption) OrderOption {
  123. return sql.OrderByField(FieldBotType, opts...).ToFunc()
  124. }