wxcard.go 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. // Code generated by ent, DO NOT EDIT.
  2. package wxcard
  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 wxcard type in the database.
  10. Label = "wx_card"
  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. // FieldWxUserID holds the string denoting the wx_user_id field in the database.
  22. FieldWxUserID = "wx_user_id"
  23. // FieldAvatar holds the string denoting the avatar field in the database.
  24. FieldAvatar = "avatar"
  25. // FieldLogo holds the string denoting the logo field in the database.
  26. FieldLogo = "logo"
  27. // FieldName holds the string denoting the name field in the database.
  28. FieldName = "name"
  29. // FieldCompany holds the string denoting the company field in the database.
  30. FieldCompany = "company"
  31. // FieldAddress holds the string denoting the address field in the database.
  32. FieldAddress = "address"
  33. // FieldPhone holds the string denoting the phone field in the database.
  34. FieldPhone = "phone"
  35. // FieldOfficialAccount holds the string denoting the official_account field in the database.
  36. FieldOfficialAccount = "official_account"
  37. // FieldWechatAccount holds the string denoting the wechat_account field in the database.
  38. FieldWechatAccount = "wechat_account"
  39. // FieldEmail holds the string denoting the email field in the database.
  40. FieldEmail = "email"
  41. // FieldAPIBase holds the string denoting the api_base field in the database.
  42. FieldAPIBase = "api_base"
  43. // FieldAPIKey holds the string denoting the api_key field in the database.
  44. FieldAPIKey = "api_key"
  45. // FieldAiInfo holds the string denoting the ai_info field in the database.
  46. FieldAiInfo = "ai_info"
  47. // FieldIntro holds the string denoting the intro field in the database.
  48. FieldIntro = "intro"
  49. // Table holds the table name of the wxcard in the database.
  50. Table = "wx_card"
  51. )
  52. // Columns holds all SQL columns for wxcard fields.
  53. var Columns = []string{
  54. FieldID,
  55. FieldCreatedAt,
  56. FieldUpdatedAt,
  57. FieldDeletedAt,
  58. FieldUserID,
  59. FieldWxUserID,
  60. FieldAvatar,
  61. FieldLogo,
  62. FieldName,
  63. FieldCompany,
  64. FieldAddress,
  65. FieldPhone,
  66. FieldOfficialAccount,
  67. FieldWechatAccount,
  68. FieldEmail,
  69. FieldAPIBase,
  70. FieldAPIKey,
  71. FieldAiInfo,
  72. FieldIntro,
  73. }
  74. // ValidColumn reports if the column name is valid (part of the table columns).
  75. func ValidColumn(column string) bool {
  76. for i := range Columns {
  77. if column == Columns[i] {
  78. return true
  79. }
  80. }
  81. return false
  82. }
  83. // Note that the variables below are initialized by the runtime
  84. // package on the initialization of the application. Therefore,
  85. // it should be imported in the main as follows:
  86. //
  87. // import _ "wechat-api/ent/runtime"
  88. var (
  89. Hooks [1]ent.Hook
  90. Interceptors [1]ent.Interceptor
  91. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  92. DefaultCreatedAt func() time.Time
  93. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  94. DefaultUpdatedAt func() time.Time
  95. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  96. UpdateDefaultUpdatedAt func() time.Time
  97. // DefaultUserID holds the default value on creation for the "user_id" field.
  98. DefaultUserID uint64
  99. // DefaultWxUserID holds the default value on creation for the "wx_user_id" field.
  100. DefaultWxUserID uint64
  101. // DefaultAvatar holds the default value on creation for the "avatar" field.
  102. DefaultAvatar string
  103. // DefaultLogo holds the default value on creation for the "logo" field.
  104. DefaultLogo string
  105. // DefaultName holds the default value on creation for the "name" field.
  106. DefaultName string
  107. // DefaultCompany holds the default value on creation for the "company" field.
  108. DefaultCompany string
  109. // DefaultAddress holds the default value on creation for the "address" field.
  110. DefaultAddress string
  111. // DefaultPhone holds the default value on creation for the "phone" field.
  112. DefaultPhone string
  113. // DefaultOfficialAccount holds the default value on creation for the "official_account" field.
  114. DefaultOfficialAccount string
  115. // DefaultWechatAccount holds the default value on creation for the "wechat_account" field.
  116. DefaultWechatAccount string
  117. // DefaultEmail holds the default value on creation for the "email" field.
  118. DefaultEmail string
  119. // DefaultIntro holds the default value on creation for the "intro" field.
  120. DefaultIntro string
  121. )
  122. // OrderOption defines the ordering options for the WxCard queries.
  123. type OrderOption func(*sql.Selector)
  124. // ByID orders the results by the id field.
  125. func ByID(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldID, opts...).ToFunc()
  127. }
  128. // ByCreatedAt orders the results by the created_at field.
  129. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  131. }
  132. // ByUpdatedAt orders the results by the updated_at field.
  133. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldUpdatedAt, 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. // ByUserID orders the results by the user_id field.
  141. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  143. }
  144. // ByWxUserID orders the results by the wx_user_id field.
  145. func ByWxUserID(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldWxUserID, opts...).ToFunc()
  147. }
  148. // ByAvatar orders the results by the avatar field.
  149. func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldAvatar, opts...).ToFunc()
  151. }
  152. // ByLogo orders the results by the logo field.
  153. func ByLogo(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldLogo, opts...).ToFunc()
  155. }
  156. // ByName orders the results by the name field.
  157. func ByName(opts ...sql.OrderTermOption) OrderOption {
  158. return sql.OrderByField(FieldName, opts...).ToFunc()
  159. }
  160. // ByCompany orders the results by the company field.
  161. func ByCompany(opts ...sql.OrderTermOption) OrderOption {
  162. return sql.OrderByField(FieldCompany, opts...).ToFunc()
  163. }
  164. // ByAddress orders the results by the address field.
  165. func ByAddress(opts ...sql.OrderTermOption) OrderOption {
  166. return sql.OrderByField(FieldAddress, opts...).ToFunc()
  167. }
  168. // ByPhone orders the results by the phone field.
  169. func ByPhone(opts ...sql.OrderTermOption) OrderOption {
  170. return sql.OrderByField(FieldPhone, opts...).ToFunc()
  171. }
  172. // ByOfficialAccount orders the results by the official_account field.
  173. func ByOfficialAccount(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldOfficialAccount, opts...).ToFunc()
  175. }
  176. // ByWechatAccount orders the results by the wechat_account field.
  177. func ByWechatAccount(opts ...sql.OrderTermOption) OrderOption {
  178. return sql.OrderByField(FieldWechatAccount, opts...).ToFunc()
  179. }
  180. // ByEmail orders the results by the email field.
  181. func ByEmail(opts ...sql.OrderTermOption) OrderOption {
  182. return sql.OrderByField(FieldEmail, opts...).ToFunc()
  183. }
  184. // ByAPIBase orders the results by the api_base field.
  185. func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
  186. return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
  187. }
  188. // ByAPIKey orders the results by the api_key field.
  189. func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
  190. return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
  191. }
  192. // ByAiInfo orders the results by the ai_info field.
  193. func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
  194. return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
  195. }
  196. // ByIntro orders the results by the intro field.
  197. func ByIntro(opts ...sql.OrderTermOption) OrderOption {
  198. return sql.OrderByField(FieldIntro, opts...).ToFunc()
  199. }