model

package
v0.0.0-...-e9f8cd1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationORM

type ConversationORM struct {
	orm.Model

	Type       chatpb.Conversation_Type
	Status     chatpb.Conversation_Status
	CreatorUid string
	ManagerUid string
	// 当前成员列表的冗余数据
	MemberUids pq.StringArray `gorm:"type:text[]"`
}

func (*ConversationORM) ApplyPb

func (t *ConversationORM) ApplyPb(pb *chatpb.Conversation)

func (*ConversationORM) TableName

func (t *ConversationORM) TableName() string

func (*ConversationORM) ToPb

func (t *ConversationORM) ToPb() *chatpb.Conversation

type MessageORM

type MessageORM struct {
	orm.Model

	Cid       string
	SenderUid string
	Type      chatpb.Body_Type
	Body      *chatpb.Body `gorm:"type:json"`
}

func (*MessageORM) ApplyPb

func (t *MessageORM) ApplyPb(pb *chatpb.Message) error

func (*MessageORM) TableName

func (t *MessageORM) TableName() string

func (*MessageORM) ToPb

func (t *MessageORM) ToPb() (*chatpb.Message, error)

type UidConversationORM

type UidConversationORM struct {
	orm.Model

	Uid          string
	Cid          string
	Conversation *ConversationORM `gorm:"foreignkey:Cid;association_foreignkey:Id;"`
	Mute         bool             // 此对话是否静音
	EnterTime    time.Time
	QuitTime     *time.Time
}

对于同一个uid-cid,可能存在多个,但是QuitTime为NULL的肯定只有一个 每条记录是一个区间的意思

func (*UidConversationORM) TableName

func (t *UidConversationORM) TableName() string

func (*UidConversationORM) ToPb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL