compapijob.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. // Code generated by ent, DO NOT EDIT.
  2. package compapijob
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the compapijob type in the database.
  9. Label = "compapi_job"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldCreatedAt holds the string denoting the created_at field in the database.
  13. FieldCreatedAt = "created_at"
  14. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  15. FieldUpdatedAt = "updated_at"
  16. // FieldDistAt holds the string denoting the dist_at field in the database.
  17. FieldDistAt = "dist_at"
  18. // FieldDistStatus holds the string denoting the dist_status field in the database.
  19. FieldDistStatus = "dist_status"
  20. // FieldCallbackStatus holds the string denoting the callback_status field in the database.
  21. FieldCallbackStatus = "callback_status"
  22. // FieldCallbackURL holds the string denoting the callback_url field in the database.
  23. FieldCallbackURL = "callback_url"
  24. // FieldRequestJSON holds the string denoting the request_json field in the database.
  25. FieldRequestJSON = "request_json"
  26. // FieldAuthToken holds the string denoting the auth_token field in the database.
  27. FieldAuthToken = "auth_token"
  28. // FieldEventType holds the string denoting the event_type field in the database.
  29. FieldEventType = "event_type"
  30. // FieldWorkidIdx holds the string denoting the workid_idx field in the database.
  31. FieldWorkidIdx = "workid_idx"
  32. // FieldChatID holds the string denoting the chat_id field in the database.
  33. FieldChatID = "chat_id"
  34. // FieldRetryCount holds the string denoting the retry_count field in the database.
  35. FieldRetryCount = "retry_count"
  36. // Table holds the table name of the compapijob in the database.
  37. Table = "compapi_job"
  38. )
  39. // Columns holds all SQL columns for compapijob fields.
  40. var Columns = []string{
  41. FieldID,
  42. FieldCreatedAt,
  43. FieldUpdatedAt,
  44. FieldDistAt,
  45. FieldDistStatus,
  46. FieldCallbackStatus,
  47. FieldCallbackURL,
  48. FieldRequestJSON,
  49. FieldAuthToken,
  50. FieldEventType,
  51. FieldWorkidIdx,
  52. FieldChatID,
  53. FieldRetryCount,
  54. }
  55. // ValidColumn reports if the column name is valid (part of the table columns).
  56. func ValidColumn(column string) bool {
  57. for i := range Columns {
  58. if column == Columns[i] {
  59. return true
  60. }
  61. }
  62. return false
  63. }
  64. var (
  65. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  66. DefaultCreatedAt func() time.Time
  67. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  68. DefaultUpdatedAt func() time.Time
  69. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  70. UpdateDefaultUpdatedAt func() time.Time
  71. // DefaultDistStatus holds the default value on creation for the "dist_status" field.
  72. DefaultDistStatus int8
  73. // DefaultCallbackStatus holds the default value on creation for the "callback_status" field.
  74. DefaultCallbackStatus int8
  75. // DefaultAuthToken holds the default value on creation for the "auth_token" field.
  76. DefaultAuthToken string
  77. // DefaultEventType holds the default value on creation for the "event_type" field.
  78. DefaultEventType string
  79. // DefaultWorkidIdx holds the default value on creation for the "workid_idx" field.
  80. DefaultWorkidIdx int8
  81. // DefaultChatID holds the default value on creation for the "chat_id" field.
  82. DefaultChatID string
  83. // DefaultRetryCount holds the default value on creation for the "retry_count" field.
  84. DefaultRetryCount int8
  85. )
  86. // OrderOption defines the ordering options for the CompapiJob queries.
  87. type OrderOption func(*sql.Selector)
  88. // ByID orders the results by the id field.
  89. func ByID(opts ...sql.OrderTermOption) OrderOption {
  90. return sql.OrderByField(FieldID, opts...).ToFunc()
  91. }
  92. // ByCreatedAt orders the results by the created_at field.
  93. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  94. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  95. }
  96. // ByUpdatedAt orders the results by the updated_at field.
  97. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  98. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  99. }
  100. // ByDistAt orders the results by the dist_at field.
  101. func ByDistAt(opts ...sql.OrderTermOption) OrderOption {
  102. return sql.OrderByField(FieldDistAt, opts...).ToFunc()
  103. }
  104. // ByDistStatus orders the results by the dist_status field.
  105. func ByDistStatus(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldDistStatus, opts...).ToFunc()
  107. }
  108. // ByCallbackStatus orders the results by the callback_status field.
  109. func ByCallbackStatus(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldCallbackStatus, opts...).ToFunc()
  111. }
  112. // ByCallbackURL orders the results by the callback_url field.
  113. func ByCallbackURL(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldCallbackURL, opts...).ToFunc()
  115. }
  116. // ByAuthToken orders the results by the auth_token field.
  117. func ByAuthToken(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldAuthToken, opts...).ToFunc()
  119. }
  120. // ByEventType orders the results by the event_type field.
  121. func ByEventType(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldEventType, opts...).ToFunc()
  123. }
  124. // ByWorkidIdx orders the results by the workid_idx field.
  125. func ByWorkidIdx(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldWorkidIdx, opts...).ToFunc()
  127. }
  128. // ByChatID orders the results by the chat_id field.
  129. func ByChatID(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldChatID, opts...).ToFunc()
  131. }
  132. // ByRetryCount orders the results by the retry_count field.
  133. func ByRetryCount(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldRetryCount, opts...).ToFunc()
  135. }