wx.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. // Code generated by ent, DO NOT EDIT.
  2. package wx
  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 wx type in the database.
  11. Label = "wx"
  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. // FieldServerID holds the string denoting the server_id field in the database.
  23. FieldServerID = "server_id"
  24. // FieldPort holds the string denoting the port field in the database.
  25. FieldPort = "port"
  26. // FieldProcessID holds the string denoting the process_id field in the database.
  27. FieldProcessID = "process_id"
  28. // FieldCallback holds the string denoting the callback field in the database.
  29. FieldCallback = "callback"
  30. // FieldWxid holds the string denoting the wxid field in the database.
  31. FieldWxid = "wxid"
  32. // FieldAccount holds the string denoting the account field in the database.
  33. FieldAccount = "account"
  34. // FieldNickname holds the string denoting the nickname field in the database.
  35. FieldNickname = "nickname"
  36. // FieldTel holds the string denoting the tel field in the database.
  37. FieldTel = "tel"
  38. // FieldHeadBig holds the string denoting the head_big field in the database.
  39. FieldHeadBig = "head_big"
  40. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  41. FieldOrganizationID = "organization_id"
  42. // EdgeServer holds the string denoting the server edge name in mutations.
  43. EdgeServer = "server"
  44. // Table holds the table name of the wx in the database.
  45. Table = "wx"
  46. // ServerTable is the table that holds the server relation/edge.
  47. ServerTable = "wx"
  48. // ServerInverseTable is the table name for the Server entity.
  49. // It exists in this package in order to avoid circular dependency with the "server" package.
  50. ServerInverseTable = "server"
  51. // ServerColumn is the table column denoting the server relation/edge.
  52. ServerColumn = "server_id"
  53. )
  54. // Columns holds all SQL columns for wx fields.
  55. var Columns = []string{
  56. FieldID,
  57. FieldCreatedAt,
  58. FieldUpdatedAt,
  59. FieldStatus,
  60. FieldDeletedAt,
  61. FieldServerID,
  62. FieldPort,
  63. FieldProcessID,
  64. FieldCallback,
  65. FieldWxid,
  66. FieldAccount,
  67. FieldNickname,
  68. FieldTel,
  69. FieldHeadBig,
  70. FieldOrganizationID,
  71. }
  72. // ValidColumn reports if the column name is valid (part of the table columns).
  73. func ValidColumn(column string) bool {
  74. for i := range Columns {
  75. if column == Columns[i] {
  76. return true
  77. }
  78. }
  79. return false
  80. }
  81. // Note that the variables below are initialized by the runtime
  82. // package on the initialization of the application. Therefore,
  83. // it should be imported in the main as follows:
  84. //
  85. // import _ "wechat-api/ent/runtime"
  86. var (
  87. Hooks [1]ent.Hook
  88. Interceptors [1]ent.Interceptor
  89. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  90. DefaultCreatedAt func() time.Time
  91. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  92. DefaultUpdatedAt func() time.Time
  93. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  94. UpdateDefaultUpdatedAt func() time.Time
  95. // DefaultStatus holds the default value on creation for the "status" field.
  96. DefaultStatus uint8
  97. // DefaultServerID holds the default value on creation for the "server_id" field.
  98. DefaultServerID uint64
  99. // DefaultPort holds the default value on creation for the "port" field.
  100. DefaultPort string
  101. // DefaultProcessID holds the default value on creation for the "process_id" field.
  102. DefaultProcessID string
  103. // DefaultCallback holds the default value on creation for the "callback" field.
  104. DefaultCallback string
  105. // DefaultWxid holds the default value on creation for the "wxid" field.
  106. DefaultWxid string
  107. // DefaultAccount holds the default value on creation for the "account" field.
  108. DefaultAccount string
  109. // DefaultNickname holds the default value on creation for the "nickname" field.
  110. DefaultNickname string
  111. // DefaultTel holds the default value on creation for the "tel" field.
  112. DefaultTel string
  113. // DefaultHeadBig holds the default value on creation for the "head_big" field.
  114. DefaultHeadBig string
  115. // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
  116. DefaultOrganizationID uint64
  117. )
  118. // OrderOption defines the ordering options for the Wx queries.
  119. type OrderOption func(*sql.Selector)
  120. // ByID orders the results by the id field.
  121. func ByID(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldID, opts...).ToFunc()
  123. }
  124. // ByCreatedAt orders the results by the created_at field.
  125. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  127. }
  128. // ByUpdatedAt orders the results by the updated_at field.
  129. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  131. }
  132. // ByStatus orders the results by the status field.
  133. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  135. }
  136. // ByDeletedAt orders the results by the deleted_at field.
  137. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  139. }
  140. // ByServerID orders the results by the server_id field.
  141. func ByServerID(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldServerID, opts...).ToFunc()
  143. }
  144. // ByPort orders the results by the port field.
  145. func ByPort(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldPort, opts...).ToFunc()
  147. }
  148. // ByProcessID orders the results by the process_id field.
  149. func ByProcessID(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldProcessID, opts...).ToFunc()
  151. }
  152. // ByCallback orders the results by the callback field.
  153. func ByCallback(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldCallback, opts...).ToFunc()
  155. }
  156. // ByWxid orders the results by the wxid field.
  157. func ByWxid(opts ...sql.OrderTermOption) OrderOption {
  158. return sql.OrderByField(FieldWxid, opts...).ToFunc()
  159. }
  160. // ByAccount orders the results by the account field.
  161. func ByAccount(opts ...sql.OrderTermOption) OrderOption {
  162. return sql.OrderByField(FieldAccount, opts...).ToFunc()
  163. }
  164. // ByNickname orders the results by the nickname field.
  165. func ByNickname(opts ...sql.OrderTermOption) OrderOption {
  166. return sql.OrderByField(FieldNickname, opts...).ToFunc()
  167. }
  168. // ByTel orders the results by the tel field.
  169. func ByTel(opts ...sql.OrderTermOption) OrderOption {
  170. return sql.OrderByField(FieldTel, opts...).ToFunc()
  171. }
  172. // ByHeadBig orders the results by the head_big field.
  173. func ByHeadBig(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldHeadBig, opts...).ToFunc()
  175. }
  176. // ByOrganizationID orders the results by the organization_id field.
  177. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  178. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  179. }
  180. // ByServerField orders the results by server field.
  181. func ByServerField(field string, opts ...sql.OrderTermOption) OrderOption {
  182. return func(s *sql.Selector) {
  183. sqlgraph.OrderByNeighborTerms(s, newServerStep(), sql.OrderByField(field, opts...))
  184. }
  185. }
  186. func newServerStep() *sqlgraph.Step {
  187. return sqlgraph.NewStep(
  188. sqlgraph.From(Table, FieldID),
  189. sqlgraph.To(ServerInverseTable, FieldID),
  190. sqlgraph.Edge(sqlgraph.M2O, true, ServerTable, ServerColumn),
  191. )
  192. }