compapiasynctask.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // Code generated by ent, DO NOT EDIT.
  2. package compapiasynctask
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the compapiasynctask type in the database.
  9. Label = "compapi_asynctask"
  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. // FieldAuthToken holds the string denoting the auth_token field in the database.
  17. FieldAuthToken = "auth_token"
  18. // FieldEventType holds the string denoting the event_type field in the database.
  19. FieldEventType = "event_type"
  20. // FieldChatID holds the string denoting the chat_id field in the database.
  21. FieldChatID = "chat_id"
  22. // FieldWorkidIdx holds the string denoting the workid_idx field in the database.
  23. FieldWorkidIdx = "workid_idx"
  24. // FieldOpenaiBase holds the string denoting the openai_base field in the database.
  25. FieldOpenaiBase = "openai_base"
  26. // FieldOpenaiKey holds the string denoting the openai_key field in the database.
  27. FieldOpenaiKey = "openai_key"
  28. // FieldRequestRaw holds the string denoting the request_raw field in the database.
  29. FieldRequestRaw = "request_raw"
  30. // FieldResponseRaw holds the string denoting the response_raw field in the database.
  31. FieldResponseRaw = "response_raw"
  32. // FieldCallbackURL holds the string denoting the callback_url field in the database.
  33. FieldCallbackURL = "callback_url"
  34. // FieldTaskStatus holds the string denoting the task_status field in the database.
  35. FieldTaskStatus = "task_status"
  36. // FieldRetryCount holds the string denoting the retry_count field in the database.
  37. FieldRetryCount = "retry_count"
  38. // FieldLastError holds the string denoting the last_error field in the database.
  39. FieldLastError = "last_error"
  40. // Table holds the table name of the compapiasynctask in the database.
  41. Table = "compapi_asynctask"
  42. )
  43. // Columns holds all SQL columns for compapiasynctask fields.
  44. var Columns = []string{
  45. FieldID,
  46. FieldCreatedAt,
  47. FieldUpdatedAt,
  48. FieldAuthToken,
  49. FieldEventType,
  50. FieldChatID,
  51. FieldWorkidIdx,
  52. FieldOpenaiBase,
  53. FieldOpenaiKey,
  54. FieldRequestRaw,
  55. FieldResponseRaw,
  56. FieldCallbackURL,
  57. FieldTaskStatus,
  58. FieldRetryCount,
  59. FieldLastError,
  60. }
  61. // ValidColumn reports if the column name is valid (part of the table columns).
  62. func ValidColumn(column string) bool {
  63. for i := range Columns {
  64. if column == Columns[i] {
  65. return true
  66. }
  67. }
  68. return false
  69. }
  70. var (
  71. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  72. DefaultCreatedAt func() time.Time
  73. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  74. DefaultUpdatedAt func() time.Time
  75. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  76. UpdateDefaultUpdatedAt func() time.Time
  77. // DefaultEventType holds the default value on creation for the "event_type" field.
  78. DefaultEventType string
  79. // DefaultChatID holds the default value on creation for the "chat_id" field.
  80. DefaultChatID string
  81. // DefaultWorkidIdx holds the default value on creation for the "workid_idx" field.
  82. DefaultWorkidIdx int8
  83. // DefaultResponseRaw holds the default value on creation for the "response_raw" field.
  84. DefaultResponseRaw string
  85. // CallbackURLValidator is a validator for the "callback_url" field. It is called by the builders before save.
  86. CallbackURLValidator func(string) error
  87. // DefaultTaskStatus holds the default value on creation for the "task_status" field.
  88. DefaultTaskStatus int8
  89. // DefaultRetryCount holds the default value on creation for the "retry_count" field.
  90. DefaultRetryCount int8
  91. // DefaultLastError holds the default value on creation for the "last_error" field.
  92. DefaultLastError string
  93. )
  94. // OrderOption defines the ordering options for the CompapiAsynctask queries.
  95. type OrderOption func(*sql.Selector)
  96. // ByID orders the results by the id field.
  97. func ByID(opts ...sql.OrderTermOption) OrderOption {
  98. return sql.OrderByField(FieldID, opts...).ToFunc()
  99. }
  100. // ByCreatedAt orders the results by the created_at field.
  101. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  102. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  103. }
  104. // ByUpdatedAt orders the results by the updated_at field.
  105. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  107. }
  108. // ByAuthToken orders the results by the auth_token field.
  109. func ByAuthToken(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldAuthToken, opts...).ToFunc()
  111. }
  112. // ByEventType orders the results by the event_type field.
  113. func ByEventType(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldEventType, opts...).ToFunc()
  115. }
  116. // ByChatID orders the results by the chat_id field.
  117. func ByChatID(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldChatID, opts...).ToFunc()
  119. }
  120. // ByWorkidIdx orders the results by the workid_idx field.
  121. func ByWorkidIdx(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldWorkidIdx, opts...).ToFunc()
  123. }
  124. // ByOpenaiBase orders the results by the openai_base field.
  125. func ByOpenaiBase(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldOpenaiBase, opts...).ToFunc()
  127. }
  128. // ByOpenaiKey orders the results by the openai_key field.
  129. func ByOpenaiKey(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldOpenaiKey, opts...).ToFunc()
  131. }
  132. // ByRequestRaw orders the results by the request_raw field.
  133. func ByRequestRaw(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldRequestRaw, opts...).ToFunc()
  135. }
  136. // ByResponseRaw orders the results by the response_raw field.
  137. func ByResponseRaw(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldResponseRaw, opts...).ToFunc()
  139. }
  140. // ByCallbackURL orders the results by the callback_url field.
  141. func ByCallbackURL(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldCallbackURL, opts...).ToFunc()
  143. }
  144. // ByTaskStatus orders the results by the task_status field.
  145. func ByTaskStatus(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldTaskStatus, opts...).ToFunc()
  147. }
  148. // ByRetryCount orders the results by the retry_count field.
  149. func ByRetryCount(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldRetryCount, opts...).ToFunc()
  151. }
  152. // ByLastError orders the results by the last_error field.
  153. func ByLastError(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldLastError, opts...).ToFunc()
  155. }