model

package
v0.0.0-...-c24f202 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactApply

type ContactApply struct {
	Id          int64          `gorm:"column:id;primaryKey;comment:自增id"`
	Uuid        string         `gorm:"column:uuid;uniqueIndex;type:char(20);comment:申请id"`
	UserId      string         `gorm:"column:user_id;index;type:char(20);not null;comment:申请人id"`
	ContactId   string         `gorm:"column:contact_id;index;type:char(20);not null;comment:被申请id"`
	ContactType int8           `gorm:"column:contact_type;not null;comment:被申请类型,0.用户,1.群聊"`
	Status      int8           `gorm:"column:status;not null;comment:申请状态,0.申请中,1.通过,2.拒绝,3.拉黑"`
	Message     string         `gorm:"column:message;type:varchar(100);comment:申请信息"`
	LastApplyAt time.Time      `gorm:"column:last_apply_at;type:datetime;not null;comment:最后申请时间"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;index;type:datetime;comment:删除时间"`
}

func (ContactApply) TableName

func (ContactApply) TableName() string

type GroupInfo

type GroupInfo struct {
	Id        int64           `gorm:"column:id;primaryKey;comment:自增id"`
	Uuid      string          `gorm:"column:uuid;uniqueIndex;type:char(20);not null;comment:群组唯一id"`
	Name      string          `gorm:"column:name;type:varchar(20);not null;comment:群名称"`
	Notice    string          `gorm:"column:notice;type:varchar(500);comment:群公告"`
	Members   json.RawMessage `gorm:"column:members;type:json;comment:群组成员"`
	MemberCnt int             `gorm:"column:member_cnt;default:1;comment:群人数"` // 默认群主1人
	OwnerId   string          `gorm:"column:owner_id;type:char(20);not null;comment:群主uuid"`
	AddMode   int8            `gorm:"column:add_mode;default:0;comment:加群方式,0.直接,1.审核"`
	Avatar    string          `` /* 135-byte string literal not displayed */
	Status    int8            `gorm:"column:status;default:0;comment:状态,0.正常,1.禁用,2.解散"`
	CreatedAt time.Time       `gorm:"column:created_at;index;type:datetime;not null;comment:创建时间"`
	UpdatedAt time.Time       `gorm:"column:updated_at;type:datetime;not null;comment:更新时间"`
	DeletedAt gorm.DeletedAt  `gorm:"column:deleted_at;index;comment:删除时间"`
}

func (GroupInfo) TableName

func (GroupInfo) TableName() string

type Message

type Message struct {
	Id         int64        `gorm:"column:id;primaryKey;comment:自增id"`
	Uuid       string       `gorm:"column:uuid;uniqueIndex;type:char(20);not null;comment:消息uuid"`
	SessionId  string       `gorm:"column:session_id;index;type:char(20);not null;comment:会话uuid"`
	Type       int8         `gorm:"column:type;not null;comment:消息类型,0.文本,1.语音,2.文件,3.通话"` // 通话不用存消息内容或者url
	Content    string       `gorm:"column:content;type:TEXT;comment:消息内容"`
	Url        string       `gorm:"column:url;type:char(255);comment:消息url"`
	SendId     string       `gorm:"column:send_id;index;type:char(20);not null;comment:发送者uuid"`
	SendName   string       `gorm:"column:send_name;type:varchar(20);not null;comment:发送者昵称"`
	SendAvatar string       `gorm:"column:send_avatar;type:varchar(255);not null;comment:发送者头像"`
	ReceiveId  string       `gorm:"column:receive_id;index;type:char(20);not null;comment:接受者uuid"`
	FileType   string       `gorm:"column:file_type;type:char(10);comment:文件类型"`
	FileName   string       `gorm:"column:file_name;type:varchar(50);comment:文件名"`
	FileSize   string       `gorm:"column:file_size;type:char(20);comment:文件大小"`
	Status     int8         `gorm:"column:status;not null;comment:状态,0.未发送,1.已发送"`
	CreatedAt  time.Time    `gorm:"column:created_at;not null;comment:创建时间"`
	SendAt     sql.NullTime `gorm:"column:send_at;comment:发送时间"`
	AVdata     string       `gorm:"column:av_data;comment:通话传递数据"`
}

func (Message) TableName

func (Message) TableName() string

type Session

type Session struct {
	Id            int64          `gorm:"column:id;primaryKey;comment:自增id"`
	Uuid          string         `gorm:"column:uuid;uniqueIndex;type:char(20);comment:会话uuid"`
	SendId        string         `gorm:"column:send_id;Index;type:char(20);not null;comment:创建会话人id"`
	ReceiveId     string         `gorm:"column:receive_id;Index;type:char(20);not null;comment:接受会话人id"`
	ReceiveName   string         `gorm:"column:receive_name;type:varchar(20);not null;comment:名称"`
	Avatar        string         `gorm:"column:avatar;type:char(255);default:default_avatar.png;not null;comment:头像"`
	LastMessage   string         `gorm:"column:last_message;type:TEXT;comment:最新的消息"`
	LastMessageAt sql.NullTime   `gorm:"column:last_message_at;type:datetime;comment:最近接收时间"`
	CreatedAt     time.Time      `gorm:"column:created_at;Index;type:datetime;comment:创建时间"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at;Index;type:datetime;comment:删除时间"`
}

func (Session) TableName

func (Session) TableName() string

type UserContact

type UserContact struct {
	Id          int64          `gorm:"column:id;primaryKey;comment:自增id"`
	UserId      string         `gorm:"column:user_id;index;type:char(20);not null;comment:用户唯一id"`
	ContactId   string         `gorm:"column:contact_id;index;type:char(20);not null;comment:对应联系id"`
	ContactType int8           `gorm:"column:contact_type;not null;comment:联系类型,0.用户,1.群聊"`
	Status      int8           `` /* 174-byte string literal not displayed */
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime;not null;comment:创建时间"`
	UpdateAt    time.Time      `gorm:"column:update_at;type:datetime;not null;comment:更新时间"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index;comment:删除时间"`
}

func (UserContact) TableName

func (UserContact) TableName() string

type UserInfo

type UserInfo struct {
	Id            int64          `gorm:"column:id;primaryKey;comment:自增id"`
	Uuid          string         `gorm:"column:uuid;uniqueIndex;type:char(20);comment:用户唯一id"`
	Nickname      string         `gorm:"column:nickname;type:varchar(20);not null;comment:昵称"`
	Telephone     string         `gorm:"column:telephone;index;not null;type:char(11);comment:电话"`
	Email         string         `gorm:"column:email;type:char(30);comment:邮箱"`
	Avatar        string         `` /* 135-byte string literal not displayed */
	Gender        int8           `gorm:"column:gender;comment:性别,0.男,1.女"`
	Signature     string         `gorm:"column:signature;type:varchar(100);comment:个性签名"`
	Password      string         `gorm:"column:password;type:char(18);not null;comment:密码"`
	Birthday      string         `gorm:"column:birthday;type:char(8);comment:生日"`
	CreatedAt     time.Time      `gorm:"column:created_at;index;type:datetime;not null;comment:创建时间"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;comment:删除时间"`
	LastOnlineAt  sql.NullTime   `gorm:"column:last_online_at;type:datetime;comment:上次登录时间"`
	LastOfflineAt sql.NullTime   `gorm:"column:last_offline_at;type:datetime;comment:最近离线时间"`
	IsAdmin       int8           `gorm:"column:is_admin;not null;comment:是否是管理员,0.不是,1.是"`
	Status        int8           `gorm:"column:status;index;not null;comment:状态,0.正常,1.禁用"`
}

func (UserInfo) TableName

func (UserInfo) TableName() string

Jump to

Keyboard shortcuts

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