msg.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Code generated by ent, DO NOT EDIT.
  2. package msg
  3. import (
  4. "entgo.io/ent/dialect/sql"
  5. )
  6. const (
  7. // Label holds the string label denoting the msg type in the database.
  8. Label = "msg"
  9. // FieldID holds the string denoting the id field in the database.
  10. FieldID = "id"
  11. // FieldCreatedAt holds the string denoting the created_at field in the database.
  12. FieldCreatedAt = "created_at"
  13. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  14. FieldUpdatedAt = "updated_at"
  15. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  16. FieldDeletedAt = "deleted_at"
  17. // FieldStatus holds the string denoting the status field in the database.
  18. FieldStatus = "status"
  19. // FieldFromwxid holds the string denoting the fromwxid field in the database.
  20. FieldFromwxid = "fromwxid"
  21. // FieldToid holds the string denoting the toid field in the database.
  22. FieldToid = "toid"
  23. // FieldMsgtype holds the string denoting the msgtype field in the database.
  24. FieldMsgtype = "msgtype"
  25. // FieldMsg holds the string denoting the msg field in the database.
  26. FieldMsg = "msg"
  27. // FieldBatchNo holds the string denoting the batch_no field in the database.
  28. FieldBatchNo = "batch_no"
  29. // Table holds the table name of the msg in the database.
  30. Table = "msg"
  31. )
  32. // Columns holds all SQL columns for msg fields.
  33. var Columns = []string{
  34. FieldID,
  35. FieldCreatedAt,
  36. FieldUpdatedAt,
  37. FieldDeletedAt,
  38. FieldStatus,
  39. FieldFromwxid,
  40. FieldToid,
  41. FieldMsgtype,
  42. FieldMsg,
  43. FieldBatchNo,
  44. }
  45. // ValidColumn reports if the column name is valid (part of the table columns).
  46. func ValidColumn(column string) bool {
  47. for i := range Columns {
  48. if column == Columns[i] {
  49. return true
  50. }
  51. }
  52. return false
  53. }
  54. // OrderOption defines the ordering options for the Msg queries.
  55. type OrderOption func(*sql.Selector)
  56. // ByID orders the results by the id field.
  57. func ByID(opts ...sql.OrderTermOption) OrderOption {
  58. return sql.OrderByField(FieldID, opts...).ToFunc()
  59. }
  60. // ByCreatedAt orders the results by the created_at field.
  61. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  62. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  63. }
  64. // ByUpdatedAt orders the results by the updated_at field.
  65. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  66. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  67. }
  68. // ByDeletedAt orders the results by the deleted_at field.
  69. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  70. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  71. }
  72. // ByStatus orders the results by the status field.
  73. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  74. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  75. }
  76. // ByFromwxid orders the results by the fromwxid field.
  77. func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
  78. return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
  79. }
  80. // ByToid orders the results by the toid field.
  81. func ByToid(opts ...sql.OrderTermOption) OrderOption {
  82. return sql.OrderByField(FieldToid, opts...).ToFunc()
  83. }
  84. // ByMsgtype orders the results by the msgtype field.
  85. func ByMsgtype(opts ...sql.OrderTermOption) OrderOption {
  86. return sql.OrderByField(FieldMsgtype, opts...).ToFunc()
  87. }
  88. // ByMsg orders the results by the msg field.
  89. func ByMsg(opts ...sql.OrderTermOption) OrderOption {
  90. return sql.OrderByField(FieldMsg, opts...).ToFunc()
  91. }
  92. // ByBatchNo orders the results by the batch_no field.
  93. func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
  94. return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
  95. }