xunjiservice.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // Code generated by ent, DO NOT EDIT.
  2. package xunjiservice
  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 xunjiservice type in the database.
  11. Label = "xunji_service"
  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. // FieldXunjiID holds the string denoting the xunji_id field in the database.
  23. FieldXunjiID = "xunji_id"
  24. // FieldAgentID holds the string denoting the agent_id field in the database.
  25. FieldAgentID = "agent_id"
  26. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  27. FieldOrganizationID = "organization_id"
  28. // FieldWxid holds the string denoting the wxid field in the database.
  29. FieldWxid = "wxid"
  30. // FieldAPIBase holds the string denoting the api_base field in the database.
  31. FieldAPIBase = "api_base"
  32. // FieldAPIKey holds the string denoting the api_key field in the database.
  33. FieldAPIKey = "api_key"
  34. // EdgeAgent holds the string denoting the agent edge name in mutations.
  35. EdgeAgent = "agent"
  36. // Table holds the table name of the xunjiservice in the database.
  37. Table = "xunji_service"
  38. // AgentTable is the table that holds the agent relation/edge.
  39. AgentTable = "xunji_service"
  40. // AgentInverseTable is the table name for the Agent entity.
  41. // It exists in this package in order to avoid circular dependency with the "agent" package.
  42. AgentInverseTable = "agent"
  43. // AgentColumn is the table column denoting the agent relation/edge.
  44. AgentColumn = "agent_id"
  45. )
  46. // Columns holds all SQL columns for xunjiservice fields.
  47. var Columns = []string{
  48. FieldID,
  49. FieldCreatedAt,
  50. FieldUpdatedAt,
  51. FieldStatus,
  52. FieldDeletedAt,
  53. FieldXunjiID,
  54. FieldAgentID,
  55. FieldOrganizationID,
  56. FieldWxid,
  57. FieldAPIBase,
  58. FieldAPIKey,
  59. }
  60. // ValidColumn reports if the column name is valid (part of the table columns).
  61. func ValidColumn(column string) bool {
  62. for i := range Columns {
  63. if column == Columns[i] {
  64. return true
  65. }
  66. }
  67. return false
  68. }
  69. // Note that the variables below are initialized by the runtime
  70. // package on the initialization of the application. Therefore,
  71. // it should be imported in the main as follows:
  72. //
  73. // import _ "wechat-api/ent/runtime"
  74. var (
  75. Hooks [1]ent.Hook
  76. Interceptors [1]ent.Interceptor
  77. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  78. DefaultCreatedAt func() time.Time
  79. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  80. DefaultUpdatedAt func() time.Time
  81. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  82. UpdateDefaultUpdatedAt func() time.Time
  83. // DefaultStatus holds the default value on creation for the "status" field.
  84. DefaultStatus uint8
  85. // DefaultAgentID holds the default value on creation for the "agent_id" field.
  86. DefaultAgentID uint64
  87. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  88. OrganizationIDValidator func(uint64) error
  89. // DefaultAPIBase holds the default value on creation for the "api_base" field.
  90. DefaultAPIBase string
  91. // DefaultAPIKey holds the default value on creation for the "api_key" field.
  92. DefaultAPIKey string
  93. )
  94. // OrderOption defines the ordering options for the XunjiService 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. // ByStatus orders the results by the status field.
  109. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  111. }
  112. // ByDeletedAt orders the results by the deleted_at field.
  113. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  115. }
  116. // ByXunjiID orders the results by the xunji_id field.
  117. func ByXunjiID(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldXunjiID, opts...).ToFunc()
  119. }
  120. // ByAgentID orders the results by the agent_id field.
  121. func ByAgentID(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldAgentID, opts...).ToFunc()
  123. }
  124. // ByOrganizationID orders the results by the organization_id field.
  125. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  127. }
  128. // ByWxid orders the results by the wxid field.
  129. func ByWxid(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldWxid, opts...).ToFunc()
  131. }
  132. // ByAPIBase orders the results by the api_base field.
  133. func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
  135. }
  136. // ByAPIKey orders the results by the api_key field.
  137. func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
  139. }
  140. // ByAgentField orders the results by agent field.
  141. func ByAgentField(field string, opts ...sql.OrderTermOption) OrderOption {
  142. return func(s *sql.Selector) {
  143. sqlgraph.OrderByNeighborTerms(s, newAgentStep(), sql.OrderByField(field, opts...))
  144. }
  145. }
  146. func newAgentStep() *sqlgraph.Step {
  147. return sqlgraph.NewStep(
  148. sqlgraph.From(Table, FieldID),
  149. sqlgraph.To(AgentInverseTable, FieldID),
  150. sqlgraph.Edge(sqlgraph.M2O, true, AgentTable, AgentColumn),
  151. )
  152. }