batchmsg.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // Code generated by ent, DO NOT EDIT.
  2. package batchmsg
  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 batchmsg type in the database.
  10. Label = "batch_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. // FieldBatchNo holds the string denoting the batch_no field in the database.
  22. FieldBatchNo = "batch_no"
  23. // FieldFromwxid holds the string denoting the fromwxid field in the database.
  24. FieldFromwxid = "fromwxid"
  25. // FieldMsg holds the string denoting the msg field in the database.
  26. FieldMsg = "msg"
  27. // FieldTag holds the string denoting the tag field in the database.
  28. FieldTag = "tag"
  29. // FieldTotal holds the string denoting the total field in the database.
  30. FieldTotal = "total"
  31. // FieldSuccess holds the string denoting the success field in the database.
  32. FieldSuccess = "success"
  33. // FieldFail holds the string denoting the fail field in the database.
  34. FieldFail = "fail"
  35. // FieldStartTime holds the string denoting the start_time field in the database.
  36. FieldStartTime = "start_time"
  37. // FieldStopTime holds the string denoting the stop_time field in the database.
  38. FieldStopTime = "stop_time"
  39. // Table holds the table name of the batchmsg in the database.
  40. Table = "batch_msg"
  41. )
  42. // Columns holds all SQL columns for batchmsg fields.
  43. var Columns = []string{
  44. FieldID,
  45. FieldCreatedAt,
  46. FieldUpdatedAt,
  47. FieldDeletedAt,
  48. FieldStatus,
  49. FieldBatchNo,
  50. FieldFromwxid,
  51. FieldMsg,
  52. FieldTag,
  53. FieldTotal,
  54. FieldSuccess,
  55. FieldFail,
  56. FieldStartTime,
  57. FieldStopTime,
  58. }
  59. // ValidColumn reports if the column name is valid (part of the table columns).
  60. func ValidColumn(column string) bool {
  61. for i := range Columns {
  62. if column == Columns[i] {
  63. return true
  64. }
  65. }
  66. return false
  67. }
  68. // Note that the variables below are initialized by the runtime
  69. // package on the initialization of the application. Therefore,
  70. // it should be imported in the main as follows:
  71. //
  72. // import _ "wechat-api/ent/runtime"
  73. var (
  74. Hooks [1]ent.Hook
  75. Interceptors [1]ent.Interceptor
  76. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  77. DefaultCreatedAt func() time.Time
  78. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  79. DefaultUpdatedAt func() time.Time
  80. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  81. UpdateDefaultUpdatedAt func() time.Time
  82. )
  83. // OrderOption defines the ordering options for the BatchMsg 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. // ByStatus orders the results by the status field.
  102. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  103. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  104. }
  105. // ByBatchNo orders the results by the batch_no field.
  106. func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
  108. }
  109. // ByFromwxid orders the results by the fromwxid field.
  110. func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
  111. return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
  112. }
  113. // ByMsg orders the results by the msg field.
  114. func ByMsg(opts ...sql.OrderTermOption) OrderOption {
  115. return sql.OrderByField(FieldMsg, opts...).ToFunc()
  116. }
  117. // ByTag orders the results by the tag field.
  118. func ByTag(opts ...sql.OrderTermOption) OrderOption {
  119. return sql.OrderByField(FieldTag, opts...).ToFunc()
  120. }
  121. // ByTotal orders the results by the total field.
  122. func ByTotal(opts ...sql.OrderTermOption) OrderOption {
  123. return sql.OrderByField(FieldTotal, opts...).ToFunc()
  124. }
  125. // BySuccess orders the results by the success field.
  126. func BySuccess(opts ...sql.OrderTermOption) OrderOption {
  127. return sql.OrderByField(FieldSuccess, opts...).ToFunc()
  128. }
  129. // ByFail orders the results by the fail field.
  130. func ByFail(opts ...sql.OrderTermOption) OrderOption {
  131. return sql.OrderByField(FieldFail, opts...).ToFunc()
  132. }
  133. // ByStartTime orders the results by the start_time field.
  134. func ByStartTime(opts ...sql.OrderTermOption) OrderOption {
  135. return sql.OrderByField(FieldStartTime, opts...).ToFunc()
  136. }
  137. // ByStopTime orders the results by the stop_time field.
  138. func ByStopTime(opts ...sql.OrderTermOption) OrderOption {
  139. return sql.OrderByField(FieldStopTime, opts...).ToFunc()
  140. }