model

package
v0.0.0-...-efd9455 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultGroup = &Group{
		Id:     "supergroup_0",
		Name:   "炒鸡大群",
		Avatar: "https://go.dev/images/gophers/ladder.svg",
	}
)

Functions

This section is empty.

Types

type Blacklist

type Blacklist struct {
	UserId string `gorm:"column:user_id;primary_key;type:char(32);comment:主键 用户id;"`
	SelfId string `gorm:"column:self_id;type:char(32);comment:自己id,分表键;"`
	// 拉黑时间
	CreatedAt int64 `gorm:"column:created_at;type:int(10);comment:拉黑时间 秒级时间戳;index;"`
}

func (*Blacklist) TableName

func (b *Blacklist) TableName() string

type FriendApplyRecord

type FriendApplyRecord struct {
	Id     string `gorm:"column:id;primary_key;type:char(32);comment:主键"`
	UserId string `gorm:"column:user_id;index;type:char(32);comment:主键 用户id 申请人的id;"`
	SelfId string `gorm:"column:self_id;type:char(32);comment:自己id,分表键;"`
	// 申请时间
	CreatedAt int64 `gorm:"column:created_at;type:int(10);comment:加好友时间 秒级时间戳;index;"`
	// 申请状态
	Status int `gorm:"column:status;type:tinyint(1);comment:申请状态 0:申请中 1:同意 2:拒绝;default:0;"`
	// 申请消息
	Message string `gorm:"column:message;type:varchar(255);comment:申请消息;"`
}

func (*FriendApplyRecord) TableName

func (f *FriendApplyRecord) TableName() string

type Friendlist

type Friendlist struct {
	UserId string `gorm:"column:user_id;primary_key;type:char(32);comment:主键 用户id;"`
	SelfId string `gorm:"column:self_id;type:char(32);comment:自己id,分表键;"`
	// 加好友时间
	CreatedAt int64  `gorm:"column:created_at;type:int(10);comment:加好友时间 秒级时间戳;"`
	Remark    string `gorm:"column:remark;type:varchar(255);comment:备注;"`
}

func (*Friendlist) TableName

func (b *Friendlist) TableName() string

type Group

type Group struct {
	Id     string `gorm:"column:id;primary_key;comment:主键id"`
	Name   string `gorm:"column:name;comment:群组名称"`
	Avatar string `gorm:"column:avatar;comment:群组头像"`
}

func (*Group) TableName

func (g *Group) TableName() string

type SingleConversationRecord

type SingleConversationRecord struct {
	ConversationId string `gorm:"column:conversation_id;primary_key;type:varchar(127);comment:主键 会话id;"`
	UserId         string `gorm:"column:user_id;type:char(32);comment:用户id;"`
	RecvMsgOpt     int8   `` /* 147-byte string literal not displayed */
	Remark         string `gorm:"column:remark;type:varchar(255);comment:备注;default:'';"`
}

func (*SingleConversationRecord) GetIdString

func (s *SingleConversationRecord) GetIdString() string

func (*SingleConversationRecord) TableName

func (s *SingleConversationRecord) TableName() string

type SuperGroupConversationRecord

type SuperGroupConversationRecord struct {
	UserId     string `gorm:"column:user_id;primary_key;type:char(32);comment:主键 用户id;"`
	GroupId    string `gorm:"column:group_id;type:char(32);comment:群组id;"`
	RecvMsgOpt int8   `` /* 147-byte string literal not displayed */
	Remark     string `gorm:"column:remark;type:varchar(255);comment:备注;default:'';"`
	CreatedAt  int64  `gorm:"column:created_at;type:bigint(20);comment:创建时间;index;"`
}

func (*SuperGroupConversationRecord) BeforeCreate

func (s *SuperGroupConversationRecord) BeforeCreate(tx *gorm.DB) error

func (*SuperGroupConversationRecord) GetIdString

func (s *SuperGroupConversationRecord) GetIdString() string

func (*SuperGroupConversationRecord) TableName

func (s *SuperGroupConversationRecord) TableName() string

type User

type User struct {
	Id string `gorm:"column:id;primary_key;comment:主键id;type:char(32);"`
	// 账户
	Username string `gorm:"column:username;comment:用户名;type:char(31);uniqueIndex;"`
	Password string `gorm:"column:password;comment:密码;type:char(64);not null;"`
	// 用户信息显示
	Nickname     string `gorm:"column:nickname;comment:昵称;type:varchar(31);not null;"`
	Sign         string `gorm:"column:sign;comment:个性签名;type:varchar(63);default:'';not null;"`
	Avatar       string `gorm:"column:avatar;comment:头像;type:varchar(255);default:'';not null;"`
	Province     string `gorm:"column:province;index;comment:省;type:varchar(63);default:'';not null;"`
	City         string `gorm:"column:city;index;comment:市;type:varchar(63);default:'';not null;"`
	District     string `gorm:"column:district;index;comment:区;type:varchar(63);default:'';not null;"`
	Birthday     string `gorm:"column:birthday;comment:生日;type:char(10);default:'';not null;"`
	RegisterTime string `gorm:"column:register_time;comment:注册时间;type:char(19);not null;"`
	IsMale       bool   `gorm:"column:is_male;comment:是否是男性;default:1;notnull;"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) error

func (*User) GetIdString

func (u *User) GetIdString() string

func (*User) TableName

func (u *User) TableName() string

func (*User) Value

func (u *User) Value(field string) interface{}

Jump to

Keyboard shortcuts

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