123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- // Code generated by ent, DO NOT EDIT.
- package wxcard
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- )
- const (
- // Label holds the string label denoting the wxcard type in the database.
- Label = "wx_card"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // FieldCreatedAt holds the string denoting the created_at field in the database.
- FieldCreatedAt = "created_at"
- // FieldUpdatedAt holds the string denoting the updated_at field in the database.
- FieldUpdatedAt = "updated_at"
- // FieldDeletedAt holds the string denoting the deleted_at field in the database.
- FieldDeletedAt = "deleted_at"
- // FieldUserID holds the string denoting the user_id field in the database.
- FieldUserID = "user_id"
- // FieldWxUserID holds the string denoting the wx_user_id field in the database.
- FieldWxUserID = "wx_user_id"
- // FieldAvatar holds the string denoting the avatar field in the database.
- FieldAvatar = "avatar"
- // FieldLogo holds the string denoting the logo field in the database.
- FieldLogo = "logo"
- // FieldName holds the string denoting the name field in the database.
- FieldName = "name"
- // FieldCompany holds the string denoting the company field in the database.
- FieldCompany = "company"
- // FieldAddress holds the string denoting the address field in the database.
- FieldAddress = "address"
- // FieldPhone holds the string denoting the phone field in the database.
- FieldPhone = "phone"
- // FieldOfficialAccount holds the string denoting the official_account field in the database.
- FieldOfficialAccount = "official_account"
- // FieldWechatAccount holds the string denoting the wechat_account field in the database.
- FieldWechatAccount = "wechat_account"
- // FieldEmail holds the string denoting the email field in the database.
- FieldEmail = "email"
- // FieldAPIBase holds the string denoting the api_base field in the database.
- FieldAPIBase = "api_base"
- // FieldAPIKey holds the string denoting the api_key field in the database.
- FieldAPIKey = "api_key"
- // FieldAiInfo holds the string denoting the ai_info field in the database.
- FieldAiInfo = "ai_info"
- // FieldIntro holds the string denoting the intro field in the database.
- FieldIntro = "intro"
- // Table holds the table name of the wxcard in the database.
- Table = "wx_card"
- )
- // Columns holds all SQL columns for wxcard fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldUserID,
- FieldWxUserID,
- FieldAvatar,
- FieldLogo,
- FieldName,
- FieldCompany,
- FieldAddress,
- FieldPhone,
- FieldOfficialAccount,
- FieldWechatAccount,
- FieldEmail,
- FieldAPIBase,
- FieldAPIKey,
- FieldAiInfo,
- FieldIntro,
- }
- // ValidColumn reports if the column name is valid (part of the table columns).
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- // Note that the variables below are initialized by the runtime
- // package on the initialization of the application. Therefore,
- // it should be imported in the main as follows:
- //
- // import _ "wechat-api/ent/runtime"
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
- // DefaultCreatedAt holds the default value on creation for the "created_at" field.
- DefaultCreatedAt func() time.Time
- // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
- DefaultUpdatedAt func() time.Time
- // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
- UpdateDefaultUpdatedAt func() time.Time
- // DefaultUserID holds the default value on creation for the "user_id" field.
- DefaultUserID uint64
- // DefaultWxUserID holds the default value on creation for the "wx_user_id" field.
- DefaultWxUserID uint64
- // DefaultAvatar holds the default value on creation for the "avatar" field.
- DefaultAvatar string
- // DefaultLogo holds the default value on creation for the "logo" field.
- DefaultLogo string
- // DefaultName holds the default value on creation for the "name" field.
- DefaultName string
- // DefaultCompany holds the default value on creation for the "company" field.
- DefaultCompany string
- // DefaultAddress holds the default value on creation for the "address" field.
- DefaultAddress string
- // DefaultPhone holds the default value on creation for the "phone" field.
- DefaultPhone string
- // DefaultOfficialAccount holds the default value on creation for the "official_account" field.
- DefaultOfficialAccount string
- // DefaultWechatAccount holds the default value on creation for the "wechat_account" field.
- DefaultWechatAccount string
- // DefaultEmail holds the default value on creation for the "email" field.
- DefaultEmail string
- // DefaultIntro holds the default value on creation for the "intro" field.
- DefaultIntro string
- )
- // OrderOption defines the ordering options for the WxCard queries.
- type OrderOption func(*sql.Selector)
- // ByID orders the results by the id field.
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- // ByCreatedAt orders the results by the created_at field.
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- // ByUpdatedAt orders the results by the updated_at field.
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- // ByDeletedAt orders the results by the deleted_at field.
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- // ByUserID orders the results by the user_id field.
- func ByUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUserID, opts...).ToFunc()
- }
- // ByWxUserID orders the results by the wx_user_id field.
- func ByWxUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxUserID, opts...).ToFunc()
- }
- // ByAvatar orders the results by the avatar field.
- func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAvatar, opts...).ToFunc()
- }
- // ByLogo orders the results by the logo field.
- func ByLogo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLogo, opts...).ToFunc()
- }
- // ByName orders the results by the name field.
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- // ByCompany orders the results by the company field.
- func ByCompany(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCompany, opts...).ToFunc()
- }
- // ByAddress orders the results by the address field.
- func ByAddress(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAddress, opts...).ToFunc()
- }
- // ByPhone orders the results by the phone field.
- func ByPhone(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPhone, opts...).ToFunc()
- }
- // ByOfficialAccount orders the results by the official_account field.
- func ByOfficialAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOfficialAccount, opts...).ToFunc()
- }
- // ByWechatAccount orders the results by the wechat_account field.
- func ByWechatAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWechatAccount, opts...).ToFunc()
- }
- // ByEmail orders the results by the email field.
- func ByEmail(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEmail, opts...).ToFunc()
- }
- // ByAPIBase orders the results by the api_base field.
- func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
- }
- // ByAPIKey orders the results by the api_key field.
- func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
- }
- // ByAiInfo orders the results by the ai_info field.
- func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
- }
- // ByIntro orders the results by the intro field.
- func ByIntro(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldIntro, opts...).ToFunc()
- }
|