batchmsg.go 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. // FieldCtype holds the string denoting the ctype field in the database.
  50. FieldCtype = "ctype"
  51. // FieldCc holds the string denoting the cc field in the database.
  52. FieldCc = "cc"
  53. // FieldPhone holds the string denoting the phone field in the database.
  54. FieldPhone = "phone"
  55. // FieldTemplateName holds the string denoting the template_name field in the database.
  56. FieldTemplateName = "template_name"
  57. // FieldTemplateCode holds the string denoting the template_code field in the database.
  58. FieldTemplateCode = "template_code"
  59. // FieldLang holds the string denoting the lang field in the database.
  60. FieldLang = "lang"
  61. // Table holds the table name of the batchmsg in the database.
  62. Table = "batch_msg"
  63. )
  64. // Columns holds all SQL columns for batchmsg fields.
  65. var Columns = []string{
  66. FieldID,
  67. FieldCreatedAt,
  68. FieldUpdatedAt,
  69. FieldDeletedAt,
  70. FieldStatus,
  71. FieldBatchNo,
  72. FieldTaskName,
  73. FieldFromwxid,
  74. FieldMsg,
  75. FieldTag,
  76. FieldTagids,
  77. FieldTotal,
  78. FieldSuccess,
  79. FieldFail,
  80. FieldStartTime,
  81. FieldStopTime,
  82. FieldSendTime,
  83. FieldType,
  84. FieldOrganizationID,
  85. FieldCtype,
  86. FieldCc,
  87. FieldPhone,
  88. FieldTemplateName,
  89. FieldTemplateCode,
  90. FieldLang,
  91. }
  92. // ValidColumn reports if the column name is valid (part of the table columns).
  93. func ValidColumn(column string) bool {
  94. for i := range Columns {
  95. if column == Columns[i] {
  96. return true
  97. }
  98. }
  99. return false
  100. }
  101. // Note that the variables below are initialized by the runtime
  102. // package on the initialization of the application. Therefore,
  103. // it should be imported in the main as follows:
  104. //
  105. // import _ "wechat-api/ent/runtime"
  106. var (
  107. Hooks [1]ent.Hook
  108. Interceptors [1]ent.Interceptor
  109. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  110. DefaultCreatedAt func() time.Time
  111. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  112. DefaultUpdatedAt func() time.Time
  113. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  114. UpdateDefaultUpdatedAt func() time.Time
  115. // DefaultTaskName holds the default value on creation for the "task_name" field.
  116. DefaultTaskName string
  117. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  118. OrganizationIDValidator func(uint64) error
  119. // DefaultCtype holds the default value on creation for the "ctype" field.
  120. DefaultCtype uint64
  121. )
  122. // OrderOption defines the ordering options for the BatchMsg queries.
  123. type OrderOption func(*sql.Selector)
  124. // ByID orders the results by the id field.
  125. func ByID(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldID, opts...).ToFunc()
  127. }
  128. // ByCreatedAt orders the results by the created_at field.
  129. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  131. }
  132. // ByUpdatedAt orders the results by the updated_at field.
  133. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  135. }
  136. // ByDeletedAt orders the results by the deleted_at field.
  137. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  139. }
  140. // ByStatus orders the results by the status field.
  141. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  143. }
  144. // ByBatchNo orders the results by the batch_no field.
  145. func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
  147. }
  148. // ByTaskName orders the results by the task_name field.
  149. func ByTaskName(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldTaskName, opts...).ToFunc()
  151. }
  152. // ByFromwxid orders the results by the fromwxid field.
  153. func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
  155. }
  156. // ByMsg orders the results by the msg field.
  157. func ByMsg(opts ...sql.OrderTermOption) OrderOption {
  158. return sql.OrderByField(FieldMsg, opts...).ToFunc()
  159. }
  160. // ByTag orders the results by the tag field.
  161. func ByTag(opts ...sql.OrderTermOption) OrderOption {
  162. return sql.OrderByField(FieldTag, opts...).ToFunc()
  163. }
  164. // ByTagids orders the results by the tagids field.
  165. func ByTagids(opts ...sql.OrderTermOption) OrderOption {
  166. return sql.OrderByField(FieldTagids, opts...).ToFunc()
  167. }
  168. // ByTotal orders the results by the total field.
  169. func ByTotal(opts ...sql.OrderTermOption) OrderOption {
  170. return sql.OrderByField(FieldTotal, opts...).ToFunc()
  171. }
  172. // BySuccess orders the results by the success field.
  173. func BySuccess(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldSuccess, opts...).ToFunc()
  175. }
  176. // ByFail orders the results by the fail field.
  177. func ByFail(opts ...sql.OrderTermOption) OrderOption {
  178. return sql.OrderByField(FieldFail, opts...).ToFunc()
  179. }
  180. // ByStartTime orders the results by the start_time field.
  181. func ByStartTime(opts ...sql.OrderTermOption) OrderOption {
  182. return sql.OrderByField(FieldStartTime, opts...).ToFunc()
  183. }
  184. // ByStopTime orders the results by the stop_time field.
  185. func ByStopTime(opts ...sql.OrderTermOption) OrderOption {
  186. return sql.OrderByField(FieldStopTime, opts...).ToFunc()
  187. }
  188. // BySendTime orders the results by the send_time field.
  189. func BySendTime(opts ...sql.OrderTermOption) OrderOption {
  190. return sql.OrderByField(FieldSendTime, opts...).ToFunc()
  191. }
  192. // ByType orders the results by the type field.
  193. func ByType(opts ...sql.OrderTermOption) OrderOption {
  194. return sql.OrderByField(FieldType, opts...).ToFunc()
  195. }
  196. // ByOrganizationID orders the results by the organization_id field.
  197. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  198. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  199. }
  200. // ByCtype orders the results by the ctype field.
  201. func ByCtype(opts ...sql.OrderTermOption) OrderOption {
  202. return sql.OrderByField(FieldCtype, opts...).ToFunc()
  203. }
  204. // ByCc orders the results by the cc field.
  205. func ByCc(opts ...sql.OrderTermOption) OrderOption {
  206. return sql.OrderByField(FieldCc, opts...).ToFunc()
  207. }
  208. // ByPhone orders the results by the phone field.
  209. func ByPhone(opts ...sql.OrderTermOption) OrderOption {
  210. return sql.OrderByField(FieldPhone, opts...).ToFunc()
  211. }
  212. // ByTemplateName orders the results by the template_name field.
  213. func ByTemplateName(opts ...sql.OrderTermOption) OrderOption {
  214. return sql.OrderByField(FieldTemplateName, opts...).ToFunc()
  215. }
  216. // ByTemplateCode orders the results by the template_code field.
  217. func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
  218. return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
  219. }
  220. // ByLang orders the results by the lang field.
  221. func ByLang(opts ...sql.OrderTermOption) OrderOption {
  222. return sql.OrderByField(FieldLang, opts...).ToFunc()
  223. }