wp_chatroom_member.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package schema
  2. import (
  3. "entgo.io/ent"
  4. "entgo.io/ent/dialect/entsql"
  5. "entgo.io/ent/schema"
  6. "entgo.io/ent/schema/field"
  7. "entgo.io/ent/schema/index"
  8. "github.com/suyuan32/simple-admin-common/orm/ent/mixins"
  9. )
  10. type WpChatroomMember struct {
  11. ent.Schema
  12. }
  13. func (WpChatroomMember) Fields() []ent.Field {
  14. return []ent.Field{
  15. field.String("wx_wxid").Default("").
  16. Default("").
  17. Annotations(entsql.WithComments(true)).
  18. Comment("所属微信id"),
  19. field.String("wxid").Default("").
  20. Annotations(entsql.WithComments(true)).
  21. Comment("微信id"),
  22. field.String("nickname").Default("").
  23. Annotations(entsql.WithComments(true)).
  24. Comment("群昵称"),
  25. field.String("avatar").Default("").
  26. Annotations(entsql.WithComments(true)).
  27. Comment("群头像"),
  28. }
  29. }
  30. func (WpChatroomMember) Mixin() []ent.Mixin {
  31. return []ent.Mixin{
  32. mixins.IDMixin{},
  33. mixins.StatusMixin{},
  34. }
  35. }
  36. func (WpChatroomMember) Indexes() []ent.Index {
  37. return []ent.Index{
  38. index.Fields("wx_wxid", "wxid"),
  39. }
  40. }
  41. func (WpChatroomMember) Edges() []ent.Edge { return []ent.Edge{} }
  42. func (WpChatroomMember) Annotations() []schema.Annotation {
  43. return []schema.Annotation{
  44. entsql.WithComments(true),
  45. entsql.Annotation{Table: "wp_chatroom_member"},
  46. }
  47. }