admin

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 Admin

type Admin struct {
	Account    string    `gorm:"column:account;primary_key;type:varchar(64)"`
	Password   string    `gorm:"column:password;type:varchar(64)"`
	FaceURL    string    `gorm:"column:face_url;type:varchar(255)"`
	Nickname   string    `gorm:"column:nickname;type:varchar(64)"`
	UserID     string    `gorm:"column:user_id;type:varchar(64)"` // openIM userID
	Level      int32     `gorm:"column:level;default:1"`
	CreateTime time.Time `gorm:"column:create_time"`
}

Admin 后台管理员.

func (Admin) TableName

func (Admin) TableName() string

type AdminInterface

type AdminInterface interface {
	Create(ctx context.Context, admin *Admin) error
	Take(ctx context.Context, account string) (*Admin, error)
	TakeUserID(ctx context.Context, userID string) (*Admin, error)
	Update(ctx context.Context, account string, update map[string]any) error
	ChangePassword(ctx context.Context, userID string, newPassword string) error
	Delete(ctx context.Context, userIDs []string) error
	Search(ctx context.Context, page, size int32) (uint32, []*Admin, error)
	InitAdmin(ctx context.Context) error
}

type Applet

type Applet struct {
	ID         string    `gorm:"column:id;primary_key;size:64"`
	Name       string    `gorm:"column:name;size:64"`
	AppID      string    `gorm:"column:app_id;uniqueIndex;size:255"`
	Icon       string    `gorm:"column:icon;size:255"`
	URL        string    `gorm:"column:url;size:255"`
	MD5        string    `gorm:"column:md5;size:255"`
	Size       int64     `gorm:"column:size"`
	Version    string    `gorm:"column:version;size:64"`
	Priority   uint32    `gorm:"column:priority;size:64"`
	Status     uint8     `gorm:"column:status"`
	CreateTime time.Time `gorm:"column:create_time;autoCreateTime;size:64"`
}

func (Applet) TableName

func (Applet) TableName() string

type AppletInterface

type AppletInterface interface {
	Create(ctx context.Context, applets ...*Applet) error
	Del(ctx context.Context, ids []string) error
	Update(ctx context.Context, id string, data map[string]any) error
	Take(ctx context.Context, id string) (*Applet, error)
	Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*Applet, error)
	FindOnShelf(ctx context.Context) ([]*Applet, error)
	FindID(ctx context.Context, ids []string) ([]*Applet, error)
}

type ClientConfig

type ClientConfig struct {
	Key   string `gorm:"column:key;primary_key;type:varchar(255)"`
	Value string `gorm:"column:value;not null;type:text"`
}

ClientConfig 客户端相关配置项.

func (ClientConfig) TableName

func (ClientConfig) TableName() string

type ClientConfigInterface

type ClientConfigInterface interface {
	NewTx(tx any) ClientConfigInterface
	Set(ctx context.Context, config map[string]string) error
	Get(ctx context.Context) (map[string]string, error)
	Del(ctx context.Context, keys []string) error
}

type ForbiddenAccount

type ForbiddenAccount struct {
	UserID         string    `gorm:"column:user_id;index:userID;primary_key;type:char(64)"`
	Reason         string    `gorm:"column:reason;type:varchar(255)" `
	OperatorUserID string    `gorm:"column:operator_user_id;type:varchar(255)"`
	CreateTime     time.Time `gorm:"column:create_time" `
}

ForbiddenAccount 封号表.

func (ForbiddenAccount) TableName

func (ForbiddenAccount) TableName() string

type ForbiddenAccountInterface

type ForbiddenAccountInterface interface {
	Create(ctx context.Context, ms []*ForbiddenAccount) error
	Take(ctx context.Context, userID string) (*ForbiddenAccount, error)
	Delete(ctx context.Context, userIDs []string) error
	Find(ctx context.Context, userIDs []string) ([]*ForbiddenAccount, error)
	Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*ForbiddenAccount, error)
	FindAllIDs(ctx context.Context) ([]string, error)
}

type IPForbidden

type IPForbidden struct {
	IP            string    `gorm:"column:ip;primary_key;type:char(32)"`
	LimitRegister bool      `gorm:"column:limit_register"`
	LimitLogin    bool      `gorm:"column:limit_login"`
	CreateTime    time.Time `gorm:"column:create_time"`
}

禁止ip登录 注册.

func (IPForbidden) IPForbidden

func (IPForbidden) IPForbidden() string

type IPForbiddenInterface

type IPForbiddenInterface interface {
	NewTx(tx any) IPForbiddenInterface
	Take(ctx context.Context, ip string) (*IPForbidden, error)
	Find(ctx context.Context, ips []string) ([]*IPForbidden, error)
	Search(ctx context.Context, keyword string, state int32, page int32, size int32) (uint32, []*IPForbidden, error)
	Create(ctx context.Context, ms []*IPForbidden) error
	Delete(ctx context.Context, ips []string) error
}

type InvitationRegister

type InvitationRegister struct {
	InvitationCode string    `gorm:"column:invitation_code;primary_key;type:char(32)"`
	UsedByUserID   string    `gorm:"column:user_id;index:userID;type:char(64)"`
	CreateTime     time.Time `gorm:"column:create_time"`
}

邀请码被注册使用.

func (InvitationRegister) TableName

func (InvitationRegister) TableName() string

type InvitationRegisterInterface

type InvitationRegisterInterface interface {
	NewTx(tx any) InvitationRegisterInterface
	Find(ctx context.Context, codes []string) ([]*InvitationRegister, error)
	Del(ctx context.Context, codes []string) error
	Create(ctx context.Context, v ...*InvitationRegister) error
	Take(ctx context.Context, code string) (*InvitationRegister, error)
	Update(ctx context.Context, code string, data map[string]any) error
	Search(ctx context.Context, keyword string, state int32, userIDs []string, codes []string, page int32, size int32) (uint32, []*InvitationRegister, error)
}

type LimitUserLoginIP

type LimitUserLoginIP struct {
	UserID     string    `gorm:"column:user_id;primary_key;type:char(64)"`
	IP         string    `gorm:"column:ip;primary_key;type:char(32)"`
	CreateTime time.Time `gorm:"column:create_time" `
}

限制userID只能在某些ip登录.

func (LimitUserLoginIP) TableName

func (LimitUserLoginIP) TableName() string

type LimitUserLoginIPInterface

type LimitUserLoginIPInterface interface {
	Create(ctx context.Context, ms []*LimitUserLoginIP) error
	Delete(ctx context.Context, ms []*LimitUserLoginIP) error
	Count(ctx context.Context, userID string) (uint32, error)
	Take(ctx context.Context, userID string, ip string) (*LimitUserLoginIP, error)
	Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*LimitUserLoginIP, error)
}

type RegisterAddFriend

type RegisterAddFriend struct {
	UserID     string    `gorm:"column:user_id;primary_key;type:char(64)"`
	CreateTime time.Time `gorm:"column:create_time"`
}

RegisterAddFriend 注册时默认好友.

func (RegisterAddFriend) TableName

func (RegisterAddFriend) TableName() string

type RegisterAddFriendInterface

type RegisterAddFriendInterface interface {
	Add(ctx context.Context, registerAddFriends []*RegisterAddFriend) error
	Del(ctx context.Context, userIDs []string) error
	FindUserID(ctx context.Context, userIDs []string) ([]string, error)
	Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*RegisterAddFriend, error)
}

type RegisterAddGroup

type RegisterAddGroup struct {
	GroupID    string    `gorm:"column:group_id;primary_key;type:char(64)"`
	CreateTime time.Time `gorm:"column:create_time"`
}

RegisterAddGroup 注册时默认群组.

func (RegisterAddGroup) TableName

func (RegisterAddGroup) TableName() string

type RegisterAddGroupInterface

type RegisterAddGroupInterface interface {
	Add(ctx context.Context, registerAddGroups []*RegisterAddGroup) error
	Del(ctx context.Context, userIDs []string) error
	FindGroupID(ctx context.Context, userIDs []string) ([]string, error)
	Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*RegisterAddGroup, error)
}

Jump to

Keyboard shortcuts

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