123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- // Code generated by ent, DO NOT EDIT.
- package contact
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
- // Label holds the string label denoting the contact type in the database.
- Label = "contact"
- // 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"
- // FieldStatus holds the string denoting the status field in the database.
- FieldStatus = "status"
- // FieldDeletedAt holds the string denoting the deleted_at field in the database.
- FieldDeletedAt = "deleted_at"
- // FieldWxWxid holds the string denoting the wx_wxid field in the database.
- FieldWxWxid = "wx_wxid"
- // FieldType holds the string denoting the type field in the database.
- FieldType = "type"
- // FieldWxid holds the string denoting the wxid field in the database.
- FieldWxid = "wxid"
- // FieldAccount holds the string denoting the account field in the database.
- FieldAccount = "account"
- // FieldNickname holds the string denoting the nickname field in the database.
- FieldNickname = "nickname"
- // FieldMarkname holds the string denoting the markname field in the database.
- FieldMarkname = "markname"
- // FieldHeadimg holds the string denoting the headimg field in the database.
- FieldHeadimg = "headimg"
- // FieldSex holds the string denoting the sex field in the database.
- FieldSex = "sex"
- // FieldStarrole holds the string denoting the starrole field in the database.
- FieldStarrole = "starrole"
- // FieldDontseeit holds the string denoting the dontseeit field in the database.
- FieldDontseeit = "dontseeit"
- // FieldDontseeme holds the string denoting the dontseeme field in the database.
- FieldDontseeme = "dontseeme"
- // FieldLag holds the string denoting the lag field in the database.
- FieldLag = "lag"
- // FieldGid holds the string denoting the gid field in the database.
- FieldGid = "gid"
- // FieldGname holds the string denoting the gname field in the database.
- FieldGname = "gname"
- // FieldV3 holds the string denoting the v3 field in the database.
- FieldV3 = "v3"
- // FieldOrganizationID holds the string denoting the organization_id field in the database.
- FieldOrganizationID = "organization_id"
- // FieldCtype holds the string denoting the ctype field in the database.
- FieldCtype = "ctype"
- // FieldCage holds the string denoting the cage field in the database.
- FieldCage = "cage"
- // FieldCname holds the string denoting the cname field in the database.
- FieldCname = "cname"
- // FieldCarea holds the string denoting the carea field in the database.
- FieldCarea = "carea"
- // FieldCbirthday holds the string denoting the cbirthday field in the database.
- FieldCbirthday = "cbirthday"
- // FieldCbirtharea holds the string denoting the cbirtharea field in the database.
- FieldCbirtharea = "cbirtharea"
- // FieldCidcardNo holds the string denoting the cidcard_no field in the database.
- FieldCidcardNo = "cidcard_no"
- // FieldCtitle holds the string denoting the ctitle field in the database.
- FieldCtitle = "ctitle"
- // FieldCc holds the string denoting the cc field in the database.
- FieldCc = "cc"
- // FieldPhone holds the string denoting the phone field in the database.
- FieldPhone = "phone"
- // EdgeContactRelationships holds the string denoting the contact_relationships edge name in mutations.
- EdgeContactRelationships = "contact_relationships"
- // EdgeContactMessages holds the string denoting the contact_messages edge name in mutations.
- EdgeContactMessages = "contact_messages"
- // Table holds the table name of the contact in the database.
- Table = "contact"
- // ContactRelationshipsTable is the table that holds the contact_relationships relation/edge.
- ContactRelationshipsTable = "label_relationship"
- // ContactRelationshipsInverseTable is the table name for the LabelRelationship entity.
- // It exists in this package in order to avoid circular dependency with the "labelrelationship" package.
- ContactRelationshipsInverseTable = "label_relationship"
- // ContactRelationshipsColumn is the table column denoting the contact_relationships relation/edge.
- ContactRelationshipsColumn = "contact_id"
- // ContactMessagesTable is the table that holds the contact_messages relation/edge.
- ContactMessagesTable = "message_records"
- // ContactMessagesInverseTable is the table name for the MessageRecords entity.
- // It exists in this package in order to avoid circular dependency with the "messagerecords" package.
- ContactMessagesInverseTable = "message_records"
- // ContactMessagesColumn is the table column denoting the contact_messages relation/edge.
- ContactMessagesColumn = "contact_id"
- )
- // Columns holds all SQL columns for contact fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldDeletedAt,
- FieldWxWxid,
- FieldType,
- FieldWxid,
- FieldAccount,
- FieldNickname,
- FieldMarkname,
- FieldHeadimg,
- FieldSex,
- FieldStarrole,
- FieldDontseeit,
- FieldDontseeme,
- FieldLag,
- FieldGid,
- FieldGname,
- FieldV3,
- FieldOrganizationID,
- FieldCtype,
- FieldCage,
- FieldCname,
- FieldCarea,
- FieldCbirthday,
- FieldCbirtharea,
- FieldCidcardNo,
- FieldCtitle,
- FieldCc,
- FieldPhone,
- }
- // 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
- // DefaultStatus holds the default value on creation for the "status" field.
- DefaultStatus uint8
- // DefaultWxWxid holds the default value on creation for the "wx_wxid" field.
- DefaultWxWxid string
- // DefaultType holds the default value on creation for the "type" field.
- DefaultType int
- // DefaultWxid holds the default value on creation for the "wxid" field.
- DefaultWxid string
- // DefaultAccount holds the default value on creation for the "account" field.
- DefaultAccount string
- // DefaultNickname holds the default value on creation for the "nickname" field.
- DefaultNickname string
- // DefaultMarkname holds the default value on creation for the "markname" field.
- DefaultMarkname string
- // DefaultHeadimg holds the default value on creation for the "headimg" field.
- DefaultHeadimg string
- // DefaultSex holds the default value on creation for the "sex" field.
- DefaultSex int
- // DefaultStarrole holds the default value on creation for the "starrole" field.
- DefaultStarrole string
- // DefaultDontseeit holds the default value on creation for the "dontseeit" field.
- DefaultDontseeit int
- // DefaultDontseeme holds the default value on creation for the "dontseeme" field.
- DefaultDontseeme int
- // DefaultLag holds the default value on creation for the "lag" field.
- DefaultLag string
- // DefaultGid holds the default value on creation for the "gid" field.
- DefaultGid string
- // DefaultGname holds the default value on creation for the "gname" field.
- DefaultGname string
- // DefaultV3 holds the default value on creation for the "v3" field.
- DefaultV3 string
- // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
- DefaultOrganizationID uint64
- // DefaultCtype holds the default value on creation for the "ctype" field.
- DefaultCtype uint64
- // DefaultCage holds the default value on creation for the "cage" field.
- DefaultCage int
- // DefaultCname holds the default value on creation for the "cname" field.
- DefaultCname string
- // DefaultCarea holds the default value on creation for the "carea" field.
- DefaultCarea string
- // DefaultCbirthday holds the default value on creation for the "cbirthday" field.
- DefaultCbirthday string
- // DefaultCbirtharea holds the default value on creation for the "cbirtharea" field.
- DefaultCbirtharea string
- // DefaultCidcardNo holds the default value on creation for the "cidcard_no" field.
- DefaultCidcardNo string
- // DefaultCtitle holds the default value on creation for the "ctitle" field.
- DefaultCtitle string
- // DefaultCc holds the default value on creation for the "cc" field.
- DefaultCc string
- // DefaultPhone holds the default value on creation for the "phone" field.
- DefaultPhone string
- )
- // OrderOption defines the ordering options for the Contact 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()
- }
- // ByStatus orders the results by the status field.
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- // ByDeletedAt orders the results by the deleted_at field.
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- // ByWxWxid orders the results by the wx_wxid field.
- func ByWxWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxWxid, opts...).ToFunc()
- }
- // ByType orders the results by the type field.
- func ByType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldType, opts...).ToFunc()
- }
- // ByWxid orders the results by the wxid field.
- func ByWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxid, opts...).ToFunc()
- }
- // ByAccount orders the results by the account field.
- func ByAccount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAccount, opts...).ToFunc()
- }
- // ByNickname orders the results by the nickname field.
- func ByNickname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldNickname, opts...).ToFunc()
- }
- // ByMarkname orders the results by the markname field.
- func ByMarkname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldMarkname, opts...).ToFunc()
- }
- // ByHeadimg orders the results by the headimg field.
- func ByHeadimg(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldHeadimg, opts...).ToFunc()
- }
- // BySex orders the results by the sex field.
- func BySex(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSex, opts...).ToFunc()
- }
- // ByStarrole orders the results by the starrole field.
- func ByStarrole(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStarrole, opts...).ToFunc()
- }
- // ByDontseeit orders the results by the dontseeit field.
- func ByDontseeit(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDontseeit, opts...).ToFunc()
- }
- // ByDontseeme orders the results by the dontseeme field.
- func ByDontseeme(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDontseeme, opts...).ToFunc()
- }
- // ByLag orders the results by the lag field.
- func ByLag(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLag, opts...).ToFunc()
- }
- // ByGid orders the results by the gid field.
- func ByGid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldGid, opts...).ToFunc()
- }
- // ByGname orders the results by the gname field.
- func ByGname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldGname, opts...).ToFunc()
- }
- // ByV3 orders the results by the v3 field.
- func ByV3(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldV3, opts...).ToFunc()
- }
- // ByOrganizationID orders the results by the organization_id field.
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- // ByCtype orders the results by the ctype field.
- func ByCtype(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCtype, opts...).ToFunc()
- }
- // ByCage orders the results by the cage field.
- func ByCage(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCage, opts...).ToFunc()
- }
- // ByCname orders the results by the cname field.
- func ByCname(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCname, opts...).ToFunc()
- }
- // ByCarea orders the results by the carea field.
- func ByCarea(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCarea, opts...).ToFunc()
- }
- // ByCbirthday orders the results by the cbirthday field.
- func ByCbirthday(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCbirthday, opts...).ToFunc()
- }
- // ByCbirtharea orders the results by the cbirtharea field.
- func ByCbirtharea(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCbirtharea, opts...).ToFunc()
- }
- // ByCidcardNo orders the results by the cidcard_no field.
- func ByCidcardNo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCidcardNo, opts...).ToFunc()
- }
- // ByCtitle orders the results by the ctitle field.
- func ByCtitle(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCtitle, opts...).ToFunc()
- }
- // ByCc orders the results by the cc field.
- func ByCc(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCc, opts...).ToFunc()
- }
- // ByPhone orders the results by the phone field.
- func ByPhone(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPhone, opts...).ToFunc()
- }
- // ByContactRelationshipsCount orders the results by contact_relationships count.
- func ByContactRelationshipsCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newContactRelationshipsStep(), opts...)
- }
- }
- // ByContactRelationships orders the results by contact_relationships terms.
- func ByContactRelationships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newContactRelationshipsStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- // ByContactMessagesCount orders the results by contact_messages count.
- func ByContactMessagesCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newContactMessagesStep(), opts...)
- }
- }
- // ByContactMessages orders the results by contact_messages terms.
- 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),
- )
- }
|