wxcardvisit.go 3.6 KB

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