msg.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // Code generated by ent, DO NOT EDIT.
  2. package msg
  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 msg type in the database.
  10. Label = "msg"
  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. // FieldStatus holds the string denoting the status field in the database.
  20. FieldStatus = "status"
  21. // FieldFromwxid holds the string denoting the fromwxid field in the database.
  22. FieldFromwxid = "fromwxid"
  23. // FieldToid holds the string denoting the toid field in the database.
  24. FieldToid = "toid"
  25. // FieldMsgtype holds the string denoting the msgtype field in the database.
  26. FieldMsgtype = "msgtype"
  27. // FieldMsg holds the string denoting the msg field in the database.
  28. FieldMsg = "msg"
  29. // FieldBatchNo holds the string denoting the batch_no field in the database.
  30. FieldBatchNo = "batch_no"
  31. // FieldCc holds the string denoting the cc field in the database.
  32. FieldCc = "cc"
  33. // FieldPhone holds the string denoting the phone field in the database.
  34. FieldPhone = "phone"
  35. // Table holds the table name of the msg in the database.
  36. Table = "msg"
  37. )
  38. // Columns holds all SQL columns for msg fields.
  39. var Columns = []string{
  40. FieldID,
  41. FieldCreatedAt,
  42. FieldUpdatedAt,
  43. FieldDeletedAt,
  44. FieldStatus,
  45. FieldFromwxid,
  46. FieldToid,
  47. FieldMsgtype,
  48. FieldMsg,
  49. FieldBatchNo,
  50. FieldCc,
  51. FieldPhone,
  52. }
  53. // ValidColumn reports if the column name is valid (part of the table columns).
  54. func ValidColumn(column string) bool {
  55. for i := range Columns {
  56. if column == Columns[i] {
  57. return true
  58. }
  59. }
  60. return false
  61. }
  62. // Note that the variables below are initialized by the runtime
  63. // package on the initialization of the application. Therefore,
  64. // it should be imported in the main as follows:
  65. //
  66. // import _ "wechat-api/ent/runtime"
  67. var (
  68. Hooks [1]ent.Hook
  69. Interceptors [1]ent.Interceptor
  70. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  71. DefaultCreatedAt func() time.Time
  72. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  73. DefaultUpdatedAt func() time.Time
  74. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  75. UpdateDefaultUpdatedAt func() time.Time
  76. // DefaultCc holds the default value on creation for the "cc" field.
  77. DefaultCc string
  78. // DefaultPhone holds the default value on creation for the "phone" field.
  79. DefaultPhone string
  80. )
  81. // OrderOption defines the ordering options for the Msg queries.
  82. type OrderOption func(*sql.Selector)
  83. // ByID orders the results by the id field.
  84. func ByID(opts ...sql.OrderTermOption) OrderOption {
  85. return sql.OrderByField(FieldID, opts...).ToFunc()
  86. }
  87. // ByCreatedAt orders the results by the created_at field.
  88. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  90. }
  91. // ByUpdatedAt orders the results by the updated_at field.
  92. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  94. }
  95. // ByDeletedAt orders the results by the deleted_at field.
  96. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  98. }
  99. // ByStatus orders the results by the status field.
  100. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  102. }
  103. // ByFromwxid orders the results by the fromwxid field.
  104. func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
  106. }
  107. // ByToid orders the results by the toid field.
  108. func ByToid(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldToid, opts...).ToFunc()
  110. }
  111. // ByMsgtype orders the results by the msgtype field.
  112. func ByMsgtype(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldMsgtype, opts...).ToFunc()
  114. }
  115. // ByMsg orders the results by the msg field.
  116. func ByMsg(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldMsg, opts...).ToFunc()
  118. }
  119. // ByBatchNo orders the results by the batch_no field.
  120. func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
  122. }
  123. // ByCc orders the results by the cc field.
  124. func ByCc(opts ...sql.OrderTermOption) OrderOption {
  125. return sql.OrderByField(FieldCc, opts...).ToFunc()
  126. }
  127. // ByPhone orders the results by the phone field.
  128. func ByPhone(opts ...sql.OrderTermOption) OrderOption {
  129. return sql.OrderByField(FieldPhone, opts...).ToFunc()
  130. }