batchmsg.go 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. // FieldTaskName holds the string denoting the task_name field in the database.
  24. FieldTaskName = "task_name"
  25. // FieldFromwxid holds the string denoting the fromwxid field in the database.
  26. FieldFromwxid = "fromwxid"
  27. // FieldMsg holds the string denoting the msg field in the database.
  28. FieldMsg = "msg"
  29. // FieldTag holds the string denoting the tag field in the database.
  30. FieldTag = "tag"
  31. // FieldTagids holds the string denoting the tagids field in the database.
  32. FieldTagids = "tagids"
  33. // FieldTotal holds the string denoting the total field in the database.
  34. FieldTotal = "total"
  35. // FieldSuccess holds the string denoting the success field in the database.
  36. FieldSuccess = "success"
  37. // FieldFail holds the string denoting the fail field in the database.
  38. FieldFail = "fail"
  39. // FieldStartTime holds the string denoting the start_time field in the database.
  40. FieldStartTime = "start_time"
  41. // FieldStopTime holds the string denoting the stop_time field in the database.
  42. FieldStopTime = "stop_time"
  43. // FieldSendTime holds the string denoting the send_time field in the database.
  44. FieldSendTime = "send_time"
  45. // FieldType holds the string denoting the type field in the database.
  46. FieldType = "type"
  47. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  48. FieldOrganizationID = "organization_id"
  49. // Table holds the table name of the batchmsg in the database.
  50. Table = "batch_msg"
  51. )
  52. // Columns holds all SQL columns for batchmsg fields.
  53. var Columns = []string{
  54. FieldID,
  55. FieldCreatedAt,
  56. FieldUpdatedAt,
  57. FieldDeletedAt,
  58. FieldStatus,
  59. FieldBatchNo,
  60. FieldTaskName,
  61. FieldFromwxid,
  62. FieldMsg,
  63. FieldTag,
  64. FieldTagids,
  65. FieldTotal,
  66. FieldSuccess,
  67. FieldFail,
  68. FieldStartTime,
  69. FieldStopTime,
  70. FieldSendTime,
  71. FieldType,
  72. FieldOrganizationID,
  73. }
  74. // ValidColumn reports if the column name is valid (part of the table columns).
  75. func ValidColumn(column string) bool {
  76. for i := range Columns {
  77. if column == Columns[i] {
  78. return true
  79. }
  80. }
  81. return false
  82. }
  83. // Note that the variables below are initialized by the runtime
  84. // package on the initialization of the application. Therefore,
  85. // it should be imported in the main as follows:
  86. //
  87. // import _ "wechat-api/ent/runtime"
  88. var (
  89. Hooks [1]ent.Hook
  90. Interceptors [1]ent.Interceptor
  91. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  92. DefaultCreatedAt func() time.Time
  93. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  94. DefaultUpdatedAt func() time.Time
  95. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  96. UpdateDefaultUpdatedAt func() time.Time
  97. // DefaultTaskName holds the default value on creation for the "task_name" field.
  98. DefaultTaskName string
  99. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  100. OrganizationIDValidator func(uint64) error
  101. )
  102. // OrderOption defines the ordering options for the BatchMsg queries.
  103. type OrderOption func(*sql.Selector)
  104. // ByID orders the results by the id field.
  105. func ByID(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldID, opts...).ToFunc()
  107. }
  108. // ByCreatedAt orders the results by the created_at field.
  109. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  111. }
  112. // ByUpdatedAt orders the results by the updated_at field.
  113. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  115. }
  116. // ByDeletedAt orders the results by the deleted_at field.
  117. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  119. }
  120. // ByStatus orders the results by the status field.
  121. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  123. }
  124. // ByBatchNo orders the results by the batch_no field.
  125. func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
  127. }
  128. // ByTaskName orders the results by the task_name field.
  129. func ByTaskName(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldTaskName, opts...).ToFunc()
  131. }
  132. // ByFromwxid orders the results by the fromwxid field.
  133. func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
  135. }
  136. // ByMsg orders the results by the msg field.
  137. func ByMsg(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldMsg, opts...).ToFunc()
  139. }
  140. // ByTag orders the results by the tag field.
  141. func ByTag(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldTag, opts...).ToFunc()
  143. }
  144. // ByTagids orders the results by the tagids field.
  145. func ByTagids(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldTagids, opts...).ToFunc()
  147. }
  148. // ByTotal orders the results by the total field.
  149. func ByTotal(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldTotal, opts...).ToFunc()
  151. }
  152. // BySuccess orders the results by the success field.
  153. func BySuccess(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldSuccess, opts...).ToFunc()
  155. }
  156. // ByFail orders the results by the fail field.
  157. func ByFail(opts ...sql.OrderTermOption) OrderOption {
  158. return sql.OrderByField(FieldFail, opts...).ToFunc()
  159. }
  160. // ByStartTime orders the results by the start_time field.
  161. func ByStartTime(opts ...sql.OrderTermOption) OrderOption {
  162. return sql.OrderByField(FieldStartTime, opts...).ToFunc()
  163. }
  164. // ByStopTime orders the results by the stop_time field.
  165. func ByStopTime(opts ...sql.OrderTermOption) OrderOption {
  166. return sql.OrderByField(FieldStopTime, opts...).ToFunc()
  167. }
  168. // BySendTime orders the results by the send_time field.
  169. func BySendTime(opts ...sql.OrderTermOption) OrderOption {
  170. return sql.OrderByField(FieldSendTime, opts...).ToFunc()
  171. }
  172. // ByType orders the results by the type field.
  173. func ByType(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldType, opts...).ToFunc()
  175. }
  176. // ByOrganizationID orders the results by the organization_id field.
  177. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  178. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  179. }