wpchatroom.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. // Code generated by ent, DO NOT EDIT.
  2. package wpchatroom
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the wpchatroom type in the database.
  9. Label = "wp_chatroom"
  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. // FieldWxWxid holds the string denoting the wx_wxid field in the database.
  19. FieldWxWxid = "wx_wxid"
  20. // FieldChatroomID holds the string denoting the chatroom_id field in the database.
  21. FieldChatroomID = "chatroom_id"
  22. // FieldNickname holds the string denoting the nickname field in the database.
  23. FieldNickname = "nickname"
  24. // FieldOwner holds the string denoting the owner field in the database.
  25. FieldOwner = "owner"
  26. // FieldAvatar holds the string denoting the avatar field in the database.
  27. FieldAvatar = "avatar"
  28. // FieldMemberList holds the string denoting the member_list field in the database.
  29. FieldMemberList = "member_list"
  30. // Table holds the table name of the wpchatroom in the database.
  31. Table = "wp_chatroom"
  32. )
  33. // Columns holds all SQL columns for wpchatroom fields.
  34. var Columns = []string{
  35. FieldID,
  36. FieldCreatedAt,
  37. FieldUpdatedAt,
  38. FieldStatus,
  39. FieldWxWxid,
  40. FieldChatroomID,
  41. FieldNickname,
  42. FieldOwner,
  43. FieldAvatar,
  44. FieldMemberList,
  45. }
  46. // ValidColumn reports if the column name is valid (part of the table columns).
  47. func ValidColumn(column string) bool {
  48. for i := range Columns {
  49. if column == Columns[i] {
  50. return true
  51. }
  52. }
  53. return false
  54. }
  55. var (
  56. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  57. DefaultCreatedAt func() time.Time
  58. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  59. DefaultUpdatedAt func() time.Time
  60. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  61. UpdateDefaultUpdatedAt func() time.Time
  62. // DefaultStatus holds the default value on creation for the "status" field.
  63. DefaultStatus uint8
  64. // DefaultWxWxid holds the default value on creation for the "wx_wxid" field.
  65. DefaultWxWxid string
  66. // DefaultChatroomID holds the default value on creation for the "chatroom_id" field.
  67. DefaultChatroomID string
  68. // DefaultNickname holds the default value on creation for the "nickname" field.
  69. DefaultNickname string
  70. // DefaultOwner holds the default value on creation for the "owner" field.
  71. DefaultOwner string
  72. // DefaultAvatar holds the default value on creation for the "avatar" field.
  73. DefaultAvatar string
  74. )
  75. // OrderOption defines the ordering options for the WpChatroom queries.
  76. type OrderOption func(*sql.Selector)
  77. // ByID orders the results by the id field.
  78. func ByID(opts ...sql.OrderTermOption) OrderOption {
  79. return sql.OrderByField(FieldID, opts...).ToFunc()
  80. }
  81. // ByCreatedAt orders the results by the created_at field.
  82. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  83. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  84. }
  85. // ByUpdatedAt orders the results by the updated_at field.
  86. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  87. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  88. }
  89. // ByStatus orders the results by the status field.
  90. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  91. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  92. }
  93. // ByWxWxid orders the results by the wx_wxid field.
  94. func ByWxWxid(opts ...sql.OrderTermOption) OrderOption {
  95. return sql.OrderByField(FieldWxWxid, opts...).ToFunc()
  96. }
  97. // ByChatroomID orders the results by the chatroom_id field.
  98. func ByChatroomID(opts ...sql.OrderTermOption) OrderOption {
  99. return sql.OrderByField(FieldChatroomID, opts...).ToFunc()
  100. }
  101. // ByNickname orders the results by the nickname field.
  102. func ByNickname(opts ...sql.OrderTermOption) OrderOption {
  103. return sql.OrderByField(FieldNickname, opts...).ToFunc()
  104. }
  105. // ByOwner orders the results by the owner field.
  106. func ByOwner(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldOwner, opts...).ToFunc()
  108. }
  109. // ByAvatar orders the results by the avatar field.
  110. func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
  111. return sql.OrderByField(FieldAvatar, opts...).ToFunc()
  112. }