chat

package
v0.0.0-...-5e1152d Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UserID         string    `gorm:"column:user_id;primary_key;type:char(64)"`
	Password       string    `gorm:"column:password;type:varchar(32)"`
	CreateTime     time.Time `gorm:"column:create_time;autoCreateTime"`
	ChangeTime     time.Time `gorm:"column:change_time;autoUpdateTime"`
	OperatorUserID string    `gorm:"column:operator_user_id;type:varchar(64)"`
	Address        string    `gorm:"column:address;type:varchar(512)"`
	PublicKey      string    `gorm:"column:public_key;type:text"`
}

Account 账号密码表.

func (Account) TableName

func (Account) TableName() string

type AccountInterface

type AccountInterface interface {
	NewTx(tx any) AccountInterface
	Create(ctx context.Context, accounts ...*Account) error
	Take(ctx context.Context, userId string) (*Account, error)
	TakeByAddress(ctx context.Context, address string) (*Account, error)
	Update(ctx context.Context, userID string, data map[string]any) error
	UpdatePassword(ctx context.Context, userId string, password string) error
}

type Attribute

type Attribute struct {
	UserID           string    `gorm:"column:user_id;primary_key;type:char(64)"`
	Account          string    `gorm:"column:account;type:char(64)"`
	PhoneNumber      string    `gorm:"column:phone_number;type:varchar(32)"`
	AreaCode         string    `gorm:"column:area_code;type:varchar(8)"`
	Email            string    `gorm:"column:email;type:varchar(64)" `
	Nickname         string    `gorm:"column:nickname;type:varchar(64)" `
	FaceURL          string    `gorm:"column:face_url;type:varchar(255)" `
	Gender           int32     `gorm:"column:gender"`
	CreateTime       time.Time `gorm:"column:create_time"`
	ChangeTime       time.Time `gorm:"column:change_time"`
	BirthTime        time.Time `gorm:"column:birth_time"`
	Level            int32     `gorm:"column:level;default:1"`
	AllowVibration   int32     `gorm:"column:allow_vibration;default:1"`
	AllowBeep        int32     `gorm:"column:allow_beep;default:1"`
	AllowAddFriend   int32     `gorm:"column:allow_add_friend;default:1"`
	GlobalRecvMsgOpt int32     `gorm:"column:global_recv_msg_opt;default:0"`
	RegisterType     int32     `gorm:"column:register_type"`
	Address          string    `gorm:"column:address;type:varchar(512)"`
}

Attribute 用户属性表.

func (Attribute) TableName

func (Attribute) TableName() string

type AttributeInterface

type AttributeInterface interface {
	NewTx(tx any) AttributeInterface
	Create(ctx context.Context, attribute ...*Attribute) error
	Update(ctx context.Context, userID string, data map[string]any) error
	Find(ctx context.Context, userIds []string) ([]*Attribute, error)
	FindAccount(ctx context.Context, accounts []string) ([]*Attribute, error)
	Search(ctx context.Context, keyword string, genders []int32, page int32, size int32) (uint32, []*Attribute, error)
	TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*Attribute, error)
	TakeEmail(ctx context.Context, email string) (*Attribute, error)
	TakeAccount(ctx context.Context, account string) (*Attribute, error)
	Take(ctx context.Context, userID string) (*Attribute, error)
	SearchNormalUser(ctx context.Context, keyword string, forbiddenID []string, gender int32, page int32, size int32) (uint32, []*Attribute, error)
	SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pageNumber int32, showNumber int32) (uint32, []*Attribute, error)
}

type Log

type Log struct {
	LogID      string    `gorm:"column:log_id;primary_key;type:char(64)"`
	Platform   string    `gorm:"column:platform;type:varchar(32)"`
	UserID     string    `gorm:"column:user_id;type:char(64)"`
	CreateTime time.Time `gorm:"index:,sort:desc"`
	Url        string    `gorm:"column:url;type varchar(255)"`
	FileName   string    `gorm:"column:filename;type varchar(255)"`
	SystemType string    `gorm:"column:system_type;type varchar(255)"`
	Version    string    `gorm:"column:version;type varchar(255)"`
	Ex         string    `gorm:"column:ex;type varchar(255)"`
}

type LogInterface

type LogInterface interface {
	Create(ctx context.Context, log []*Log) error
	Search(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*Log, error)
	Delete(ctx context.Context, logID []string, userID string) error
	Get(ctx context.Context, logIDs []string, userID string) ([]*Log, error)
}

type Register

type Register struct {
	UserID      string    `gorm:"column:user_id;primary_key;type:char(64)"`
	DeviceID    string    `gorm:"column:device_id;type:varchar(255)"`
	IP          string    `gorm:"column:ip;type:varchar(64)"`
	Platform    string    `gorm:"column:platform;type:varchar(32)"`
	AccountType string    `gorm:"column:account_type;type:varchar(32)"` // email phone account
	Mode        string    `gorm:"column:mode;type:varchar(32)"`         // user admin
	CreateTime  time.Time `gorm:"column:create_time"`
}

Register 注册信息表.

func (Register) TableName

func (Register) TableName() string

type RegisterInterface

type RegisterInterface interface {
	NewTx(tx any) RegisterInterface
	Create(ctx context.Context, registers ...*Register) error
	CountTotal(ctx context.Context, before *time.Time) (int64, error)
}

type UserLoginRecord

type UserLoginRecord struct {
	UserID    string    `gorm:"column:user_id;size:64"`
	LoginTime time.Time `gorm:"column:login_time"`
	IP        string    `gorm:"column:ip;type:varchar(32)"`
	DeviceID  string    `gorm:"column:device_id;type:varchar(255)"`
	Platform  string    `gorm:"column:platform;type:varchar(32)"`
}

用户登录信息表.

func (UserLoginRecord) TableName

func (UserLoginRecord) TableName() string

type UserLoginRecordInterface

type UserLoginRecordInterface interface {
	NewTx(tx any) UserLoginRecordInterface
	Create(ctx context.Context, records ...*UserLoginRecord) error
	CountTotal(ctx context.Context, before *time.Time) (int64, error)
	CountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error)
}

type VerifyCode

type VerifyCode struct {
	ID         uint      `gorm:"column:id;primary_key;autoIncrement"`
	Account    string    `gorm:"column:account;type:char(64)"`
	Platform   string    `gorm:"column:platform;type:varchar(32)"`
	Code       string    `gorm:"column:verify_code;type:varchar(16)"`
	Duration   uint      `gorm:"column:duration;type:int(11)"`
	Count      int       `gorm:"column:count;type:int(11)"`
	Used       bool      `gorm:"column:used"`
	CreateTime time.Time `gorm:"column:create_time;autoCreateTime"`
}

func (VerifyCode) TableName

func (VerifyCode) TableName() string

type VerifyCodeInterface

type VerifyCodeInterface interface {
	NewTx(tx any) VerifyCodeInterface
	Add(ctx context.Context, ms []*VerifyCode) error
	RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (uint32, error)
	TakeLast(ctx context.Context, account string) (*VerifyCode, error)
	Incr(ctx context.Context, id uint) error
	Delete(ctx context.Context, id uint) error
}

Jump to

Keyboard shortcuts

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