1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package schema
- import (
- "entgo.io/ent"
- "entgo.io/ent/dialect/entsql"
- "entgo.io/ent/schema"
- "entgo.io/ent/schema/field"
- "entgo.io/ent/schema/index"
- "github.com/suyuan32/simple-admin-common/orm/ent/mixins"
- "wechat-api/ent/schema/localmixin"
- )
- type Contact struct {
- ent.Schema
- }
- func (Contact) Fields() []ent.Field {
- return []ent.Field{
- field.String("wx_wxid").Optional().Default("").
- Annotations(entsql.WithComments(true)).
- Comment("属主微信id"),
- field.Int("type").Optional().Default(1).
- Annotations(entsql.WithComments(true)).
- Comment("联系人类型:1好友,2群组,3公众号,4企业微信联系人"),
- field.String("wxid").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("微信id 公众号微信ID"),
- field.String("account").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("微信账号"),
- field.String("nickname").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("微信昵称 群备注名称"),
- field.String("markname").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("备注名"),
- field.String("headimg").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("头像"),
- field.Int("sex").Default(0).
- Annotations(entsql.WithComments(true)).
- Comment("性别 0未知 1男 2女"),
- field.String("starrole").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("星标 65/67=星标 1/3=未星标"),
- field.Int("dontseeit").Default(0).
- Annotations(entsql.WithComments(true)).
- Comment("不让他看我的朋友圈 0可以看 1不让看"),
- field.Int("dontseeme").Default(0).
- Annotations(entsql.WithComments(true)).
- Comment("不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天"),
- field.String("lag").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("所属标签id清单,多开会用逗号隔开"),
- field.String("gid").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("群组id"),
- field.String("gname").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("群组名称"),
- field.String("v3").Default("").
- Annotations(entsql.WithComments(true)).
- Comment("v3数据"),
- }
- }
- func (Contact) Mixin() []ent.Mixin {
- return []ent.Mixin{
- mixins.IDMixin{},
- mixins.StatusMixin{},
- localmixin.SoftDeleteMixin{},
- }
- }
- func (Contact) Indexes() []ent.Index {
- return []ent.Index{
- index.Fields("wx_wxid", "wxid").Unique(),
- index.Fields("wxid"),
- index.Fields("type"),
- index.Fields("gid"),
- }
- }
- func (Contact) Edges() []ent.Edge {
- return nil
- }
- func (Contact) Annotations() []schema.Annotation {
- return []schema.Annotation{entsql.Annotation{Table: "contact"}}
- }
|