123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- package contact
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "contact"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldStatus = "status"
-
- FieldDeletedAt = "deleted_at"
-
- FieldWxWxid = "wx_wxid"
-
- FieldType = "type"
-
- FieldWxid = "wxid"
-
- FieldAccount = "account"
-
- FieldNickname = "nickname"
-
- FieldMarkname = "markname"
-
- FieldHeadimg = "headimg"
-
- FieldSex = "sex"
-
- FieldStarrole = "starrole"
-
- FieldDontseeit = "dontseeit"
-
- FieldDontseeme = "dontseeme"
-
- FieldLag = "lag"
-
- FieldGid = "gid"
-
- FieldGname = "gname"
-
- FieldV3 = "v3"
-
- FieldOrganizationID = "organization_id"
-
- EdgeContactRelationships = "contact_relationships"
-
- EdgeContactMessages = "contact_messages"
-
- Table = "contact"
-
- ContactRelationshipsTable = "label_relationship"
-
-
- ContactRelationshipsInverseTable = "label_relationship"
-
- ContactRelationshipsColumn = "contact_id"
-
- ContactMessagesTable = "message_records"
-
-
- ContactMessagesInverseTable = "message_records"
-
- ContactMessagesColumn = "contact_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldDeletedAt,
- FieldWxWxid,
- FieldType,
- FieldWxid,
- FieldAccount,
- FieldNickname,
- FieldMarkname,
- FieldHeadimg,
- FieldSex,
- FieldStarrole,
- FieldDontseeit,
- FieldDontseeme,
- FieldLag,
- FieldGid,
- FieldGname,
- FieldV3,
- FieldOrganizationID,
- }
- 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
-
- DefaultStatus uint8
-
- DefaultWxWxid string
-
- DefaultType int
-
- DefaultWxid string
-
- DefaultAccount string
-
- DefaultNickname string
-
- DefaultMarkname string
-
- DefaultHeadimg string
-
- DefaultSex int
-
- DefaultStarrole string
-
- DefaultDontseeit int
-
- DefaultDontseeme int
-
- DefaultLag string
-
- DefaultGid string
-
- DefaultGname string
-
- DefaultV3 string
-
- DefaultOrganizationID uint64
- )
- 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 ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByWxWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxWxid, opts...).ToFunc()
- }
- func ByType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldType, opts...).ToFunc()
- }
- func ByWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxid, opts...).ToFunc()
- }
- func ByAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAccount, opts...).ToFunc()
- }
- func ByNickname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldNickname, opts...).ToFunc()
- }
- func ByMarkname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldMarkname, opts...).ToFunc()
- }
- func ByHeadimg(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldHeadimg, opts...).ToFunc()
- }
- func BySex(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSex, opts...).ToFunc()
- }
- func ByStarrole(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStarrole, opts...).ToFunc()
- }
- func ByDontseeit(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDontseeit, opts...).ToFunc()
- }
- func ByDontseeme(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDontseeme, opts...).ToFunc()
- }
- func ByLag(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLag, opts...).ToFunc()
- }
- func ByGid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldGid, opts...).ToFunc()
- }
- func ByGname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldGname, opts...).ToFunc()
- }
- func ByV3(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldV3, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByContactRelationshipsCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newContactRelationshipsStep(), opts...)
- }
- }
- func ByContactRelationships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newContactRelationshipsStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func ByContactMessagesCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newContactMessagesStep(), opts...)
- }
- }
- func ByContactMessages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newContactMessagesStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func newContactRelationshipsStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(ContactRelationshipsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, ContactRelationshipsTable, ContactRelationshipsColumn),
- )
- }
- func newContactMessagesStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(ContactMessagesInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, ContactMessagesTable, ContactMessagesColumn),
- )
- }
|