soptask.go 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. // Code generated by ent, DO NOT EDIT.
  2. package soptask
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the soptask type in the database.
  11. Label = "sop_task"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldStatus holds the string denoting the status field in the database.
  19. FieldStatus = "status"
  20. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  21. FieldDeletedAt = "deleted_at"
  22. // FieldName holds the string denoting the name field in the database.
  23. FieldName = "name"
  24. // FieldBotWxidList holds the string denoting the bot_wxid_list field in the database.
  25. FieldBotWxidList = "bot_wxid_list"
  26. // FieldType holds the string denoting the type field in the database.
  27. FieldType = "type"
  28. // FieldPlanStartTime holds the string denoting the plan_start_time field in the database.
  29. FieldPlanStartTime = "plan_start_time"
  30. // FieldPlanEndTime holds the string denoting the plan_end_time field in the database.
  31. FieldPlanEndTime = "plan_end_time"
  32. // FieldCreatorID holds the string denoting the creator_id field in the database.
  33. FieldCreatorID = "creator_id"
  34. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  35. FieldOrganizationID = "organization_id"
  36. // FieldToken holds the string denoting the token field in the database.
  37. FieldToken = "token"
  38. // EdgeTaskStages holds the string denoting the task_stages edge name in mutations.
  39. EdgeTaskStages = "task_stages"
  40. // Table holds the table name of the soptask in the database.
  41. Table = "sop_task"
  42. // TaskStagesTable is the table that holds the task_stages relation/edge.
  43. TaskStagesTable = "sop_stage"
  44. // TaskStagesInverseTable is the table name for the SopStage entity.
  45. // It exists in this package in order to avoid circular dependency with the "sopstage" package.
  46. TaskStagesInverseTable = "sop_stage"
  47. // TaskStagesColumn is the table column denoting the task_stages relation/edge.
  48. TaskStagesColumn = "task_id"
  49. )
  50. // Columns holds all SQL columns for soptask fields.
  51. var Columns = []string{
  52. FieldID,
  53. FieldCreatedAt,
  54. FieldUpdatedAt,
  55. FieldStatus,
  56. FieldDeletedAt,
  57. FieldName,
  58. FieldBotWxidList,
  59. FieldType,
  60. FieldPlanStartTime,
  61. FieldPlanEndTime,
  62. FieldCreatorID,
  63. FieldOrganizationID,
  64. FieldToken,
  65. }
  66. // ValidColumn reports if the column name is valid (part of the table columns).
  67. func ValidColumn(column string) bool {
  68. for i := range Columns {
  69. if column == Columns[i] {
  70. return true
  71. }
  72. }
  73. return false
  74. }
  75. // Note that the variables below are initialized by the runtime
  76. // package on the initialization of the application. Therefore,
  77. // it should be imported in the main as follows:
  78. //
  79. // import _ "wechat-api/ent/runtime"
  80. var (
  81. Hooks [1]ent.Hook
  82. Interceptors [1]ent.Interceptor
  83. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  84. DefaultCreatedAt func() time.Time
  85. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  86. DefaultUpdatedAt func() time.Time
  87. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  88. UpdateDefaultUpdatedAt func() time.Time
  89. // DefaultStatus holds the default value on creation for the "status" field.
  90. DefaultStatus uint8
  91. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  92. NameValidator func(string) error
  93. // DefaultType holds the default value on creation for the "type" field.
  94. DefaultType int
  95. // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
  96. DefaultOrganizationID uint64
  97. // DefaultToken holds the default value on creation for the "token" field.
  98. DefaultToken string
  99. )
  100. // OrderOption defines the ordering options for the SopTask queries.
  101. type OrderOption func(*sql.Selector)
  102. // ByID orders the results by the id field.
  103. func ByID(opts ...sql.OrderTermOption) OrderOption {
  104. return sql.OrderByField(FieldID, opts...).ToFunc()
  105. }
  106. // ByCreatedAt orders the results by the created_at field.
  107. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  108. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  109. }
  110. // ByUpdatedAt orders the results by the updated_at field.
  111. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  112. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  113. }
  114. // ByStatus orders the results by the status field.
  115. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  117. }
  118. // ByDeletedAt orders the results by the deleted_at field.
  119. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  121. }
  122. // ByName orders the results by the name field.
  123. func ByName(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldName, opts...).ToFunc()
  125. }
  126. // ByType orders the results by the type field.
  127. func ByType(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldType, opts...).ToFunc()
  129. }
  130. // ByPlanStartTime orders the results by the plan_start_time field.
  131. func ByPlanStartTime(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldPlanStartTime, opts...).ToFunc()
  133. }
  134. // ByPlanEndTime orders the results by the plan_end_time field.
  135. func ByPlanEndTime(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldPlanEndTime, opts...).ToFunc()
  137. }
  138. // ByCreatorID orders the results by the creator_id field.
  139. func ByCreatorID(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldCreatorID, opts...).ToFunc()
  141. }
  142. // ByOrganizationID orders the results by the organization_id field.
  143. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  145. }
  146. // ByToken orders the results by the token field.
  147. func ByToken(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldToken, opts...).ToFunc()
  149. }
  150. // ByTaskStagesCount orders the results by task_stages count.
  151. func ByTaskStagesCount(opts ...sql.OrderTermOption) OrderOption {
  152. return func(s *sql.Selector) {
  153. sqlgraph.OrderByNeighborsCount(s, newTaskStagesStep(), opts...)
  154. }
  155. }
  156. // ByTaskStages orders the results by task_stages terms.
  157. func ByTaskStages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  158. return func(s *sql.Selector) {
  159. sqlgraph.OrderByNeighborTerms(s, newTaskStagesStep(), append([]sql.OrderTerm{term}, terms...)...)
  160. }
  161. }
  162. func newTaskStagesStep() *sqlgraph.Step {
  163. return sqlgraph.NewStep(
  164. sqlgraph.From(Table, FieldID),
  165. sqlgraph.To(TaskStagesInverseTable, FieldID),
  166. sqlgraph.Edge(sqlgraph.O2M, false, TaskStagesTable, TaskStagesColumn),
  167. )
  168. }