123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- package wxcard
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- )
- const (
-
- Label = "wx_card"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldDeletedAt = "deleted_at"
-
- FieldUserID = "user_id"
-
- FieldWxUserID = "wx_user_id"
-
- FieldAvatar = "avatar"
-
- FieldLogo = "logo"
-
- FieldName = "name"
-
- FieldCompany = "company"
-
- FieldAddress = "address"
-
- FieldPhone = "phone"
-
- FieldOfficialAccount = "official_account"
-
- FieldWechatAccount = "wechat_account"
-
- FieldEmail = "email"
-
- FieldAPIBase = "api_base"
-
- FieldAPIKey = "api_key"
-
- FieldAiInfo = "ai_info"
-
- FieldIntro = "intro"
-
- Table = "wx_card"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldUserID,
- FieldWxUserID,
- FieldAvatar,
- FieldLogo,
- FieldName,
- FieldCompany,
- FieldAddress,
- FieldPhone,
- FieldOfficialAccount,
- FieldWechatAccount,
- FieldEmail,
- FieldAPIBase,
- FieldAPIKey,
- FieldAiInfo,
- FieldIntro,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- DefaultUserID uint64
-
- DefaultWxUserID uint64
-
- DefaultAvatar string
-
- DefaultLogo string
-
- DefaultName string
-
- DefaultCompany string
-
- DefaultAddress string
-
- DefaultPhone string
-
- DefaultOfficialAccount string
-
- DefaultWechatAccount string
-
- DefaultEmail string
-
- DefaultIntro string
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUserID, opts...).ToFunc()
- }
- func ByWxUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxUserID, opts...).ToFunc()
- }
- func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAvatar, opts...).ToFunc()
- }
- func ByLogo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLogo, opts...).ToFunc()
- }
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- func ByCompany(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCompany, opts...).ToFunc()
- }
- func ByAddress(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAddress, opts...).ToFunc()
- }
- func ByPhone(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPhone, opts...).ToFunc()
- }
- func ByOfficialAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOfficialAccount, opts...).ToFunc()
- }
- func ByWechatAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWechatAccount, opts...).ToFunc()
- }
- func ByEmail(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEmail, opts...).ToFunc()
- }
- func ByAPIBase(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAPIBase, opts...).ToFunc()
- }
- func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
- }
- func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
- }
- func ByIntro(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldIntro, opts...).ToFunc()
- }
|