model

package
v0.0.0-...-eeb3a9e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OWNER   = 1
	ADMAIN  = 2
	SPEAKER = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMyGroupResp

type GetMyGroupResp struct {
	GroupId      int64     `json:"group_id"`
	OwnerId      int64     `json:"owner_id"`
	Name         string    `json:"name"`
	Introduction string    `json:"introduction"`
	UserNum      int32     `json:"user_num"`
	CreateTime   time.Time `json:"create_time"`
}

type Group

type Group struct {
	GroupId      int64 `gorm:"primarykey"` // 群组id
	OwnerId      int64
	Name         string    // 组名
	Introduction string    // 群简介
	UserNum      int32     // 群组人数
	CreateTime   time.Time // 创建时间
	UpdateTime   time.Time // 更新时间
	MaxSeq       int64
}

Group 群组

type GroupMessageInput

type GroupMessageInput struct {
	UserId  int64  `json:"user_id4"`  // 发送人userid
	GroupId int64  `json:"group_id4"` // 群组id
	Data    string `json:"data4"`
	ReplyTo int64  `json:"reply_to4"`
	Type    int64  `json:"type4"`
}

type GroupMessageOutput

type GroupMessageOutput struct {
	UserId   int64     `json:"user_id"`  // 接受者user_id
	GroupId  int64     `json:"group_id"` // 群组id
	Data     string    `json:"data"`
	SenderId int64     `json:"sender_id"` // 发送者账户id
	Seq      int64     `json:"seq"`       // 该条消息的正确seq
	ReplyTo  int64     `json:"reply_to"`
	Type     int64     `json:"type"`
	Time     time.Time `json:"time"`
}

type GroupMessageSyncInput

type GroupMessageSyncInput struct {
	UserId  int64 `json:"user_id2"`  // 发送人userid
	GroupId int64 `json:"group_id2"` // 群组id
	SyncSeq int64 `json:"sync_seq2"` // 开始同步的seq,是用户的本地seq+1
	Limit   int64 `json:"limit2"`
	IsNew   int64 `json:"is_new2"`
}

type GroupMessageSyncOutput

type GroupMessageSyncOutput struct {
	UserId  int64                `json:"user_id"`  // 接受者user_id
	GroupId int64                `json:"group_id"` // 群组id
	Data    []GroupMessageOutput `json:"data"`
	MaxSeq  int64                `json:"max_seq"` // 该群组最新Seq
}

type GroupUser

type GroupUser struct {
	GroupUserId int64 `gorm:"primarykey"` // 自增主键
	GroupId     int64
	UserId      int64     // 用户id
	MemberType  int       // 用户在当前群组的role
	Status      int       // 状态
	CreateTime  time.Time // 创建时间
	UpdateTime  time.Time // 更新时间
}

type Message

type Message struct {
	MessageId  int64     `gorm:"primarykey"` // 自增主键
	SenderId   int64     // 发送者账户id
	ReceiverId int64     `gorm:"unique_index:u_meg"` // 接收者id,均为group_id
	Content    string    // 消息内容
	Seq        int64     `gorm:"unique_index:u_meg"` // 消息同步序列
	SendTime   time.Time // 消息发送时间(落库时间)
	Type       int64
	ReplyTo    int64
}

type Role

type Role interface {
	GetAuthByGroupID(int) bool
}

type User

type User struct {
	UserId         int64 `gorm:"primarykey"`
	UserName       string
	Password       string
	Email          string
	InvitationCode string
	CreateAt       time.Time
	DeleteAt       sql.NullTime
	UpdateAt       time.Time
}

type UserJoinGroupInput

type UserJoinGroupInput struct {
	UserId  int64 `json:"user_id5"` // 发送人userid
	GroupId int64 `json:"group_id5"`
}

type UserJoinGroupOutput

type UserJoinGroupOutput struct {
	GroupId      int64     `json:"group_id"` // 群组id
	OwnerId      int64     `json:"owner_id"`
	Name         string    `json:"name"`         // 组名
	Introduction string    `json:"introduction"` // 群简介
	UserNum      int32     `json:"user_num"`     // 群组人数
	CreateTime   time.Time `json:"create_time"`  // 创建时间
}

Jump to

Keyboard shortcuts

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