allocagent.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Code generated by ent, DO NOT EDIT.
  2. package allocagent
  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 allocagent type in the database.
  10. Label = "alloc_agent"
  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. // FieldUserID holds the string denoting the user_id field in the database.
  20. FieldUserID = "user_id"
  21. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  22. FieldOrganizationID = "organization_id"
  23. // FieldAgents holds the string denoting the agents field in the database.
  24. FieldAgents = "agents"
  25. // FieldStatus holds the string denoting the status field in the database.
  26. FieldStatus = "status"
  27. // Table holds the table name of the allocagent in the database.
  28. Table = "alloc_agent"
  29. )
  30. // Columns holds all SQL columns for allocagent fields.
  31. var Columns = []string{
  32. FieldID,
  33. FieldCreatedAt,
  34. FieldUpdatedAt,
  35. FieldDeletedAt,
  36. FieldUserID,
  37. FieldOrganizationID,
  38. FieldAgents,
  39. FieldStatus,
  40. }
  41. // ValidColumn reports if the column name is valid (part of the table columns).
  42. func ValidColumn(column string) bool {
  43. for i := range Columns {
  44. if column == Columns[i] {
  45. return true
  46. }
  47. }
  48. return false
  49. }
  50. // Note that the variables below are initialized by the runtime
  51. // package on the initialization of the application. Therefore,
  52. // it should be imported in the main as follows:
  53. //
  54. // import _ "wechat-api/ent/runtime"
  55. var (
  56. Hooks [1]ent.Hook
  57. Interceptors [1]ent.Interceptor
  58. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  59. DefaultCreatedAt func() time.Time
  60. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  61. DefaultUpdatedAt func() time.Time
  62. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  63. UpdateDefaultUpdatedAt func() time.Time
  64. // DefaultUserID holds the default value on creation for the "user_id" field.
  65. DefaultUserID string
  66. // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
  67. DefaultOrganizationID uint64
  68. // DefaultStatus holds the default value on creation for the "status" field.
  69. DefaultStatus int
  70. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  71. StatusValidator func(int) error
  72. )
  73. // OrderOption defines the ordering options for the AllocAgent queries.
  74. type OrderOption func(*sql.Selector)
  75. // ByID orders the results by the id field.
  76. func ByID(opts ...sql.OrderTermOption) OrderOption {
  77. return sql.OrderByField(FieldID, opts...).ToFunc()
  78. }
  79. // ByCreatedAt orders the results by the created_at field.
  80. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  81. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  82. }
  83. // ByUpdatedAt orders the results by the updated_at field.
  84. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  85. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  86. }
  87. // ByDeletedAt orders the results by the deleted_at field.
  88. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  90. }
  91. // ByUserID orders the results by the user_id field.
  92. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  94. }
  95. // ByOrganizationID orders the results by the organization_id field.
  96. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  98. }
  99. // ByStatus orders the results by the status field.
  100. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  102. }