model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API[T any] struct {
	Code APIStatus `json:"code"`
	Data T         `json:"data"`
	Msg  string    `json:"msg,omitempty"`
}

type APIStatus

type APIStatus int
const (
	ErrUnknown APIStatus = iota - 1
	OK
	ErrInput
	ErrService
	ErrExistUser
	ErrRegLimit
	ErrAuth
	ErrPassWord
	ErrExitsName
	ErrNotAdmin
	ErrUserDisable
	ErrCaptcha
	ErrEmailSend
)

type Captcha

type Captcha struct {
	Type    string `json:"type"`
	SiteKey string `json:"siteKey"`
}

type ChangeName

type ChangeName struct {
	Name string `json:"name" validate:"required,min=3,max=16"`
}

type ChangePasswd

type ChangePasswd struct {
	Old string `json:"old"`
	New string `json:"new" validate:"required,min=6,max=50"`
}

type Config

type Config struct {
	Captcha         Captcha `json:"captcha"`
	AllowChangeName bool
	ServerName      string `json:"serverName"`
	NeedEmail       bool
	AllowDomain     []string
	EmailReg        string
	EmailRegMsg     string
}

type EditUser

type EditUser struct {
	Email       string `json:"email" validate:"omitempty,email"`
	Name        string `json:"name" validate:"omitempty,min=3,max=16"`
	Password    string `json:"password"`
	IsAdmin     *bool  `json:"is_admin"`
	IsDisable   *bool  `json:"is_disable"`
	DelTextures bool   `json:"del_textures"`
}

type ForgotPassword added in v0.0.3

type ForgotPassword struct {
	Email    string `json:"email" validate:"required,email"`
	EmailJwt string `json:"emailJwt" validate:"required"`
	PassWord string `json:"passWord" validate:"required"`
}

type List

type List[T any] struct {
	Total int `json:"total"`
	List  []T `json:"list"`
}

type Login

type Login struct {
	Email        string `json:"email" validate:"required,email"`
	Password     string `json:"password"`
	CaptchaToken string
}

type LoginRep

type LoginRep struct {
	Token string `json:"token"`
	Name  string `json:"name"`
	UUID  string `json:"uuid"`
}

type SendRegEmail added in v0.0.3

type SendRegEmail struct {
	Email        string `json:"email" validate:"required,email"`
	CaptchaToken string `json:"captchaToken"`
}

type TokenClaims

type TokenClaims struct {
	// token id 验证 token 是否过期
	Tid string `json:"tid"`
	// ClientToken Yggdrasil 协议中使用
	CID string `json:"cid"`
	// 用户 id
	UID int `json:"uid"`
	jwt.RegisteredClaims
}

type UserInfo

type UserInfo struct {
	UID     int    `json:"uid"`
	UUID    string `json:"uuid"`
	IsAdmin bool   `json:"is_admin"`
}

type UserList

type UserList struct {
	UserInfo
	Email     string `json:"email"`
	RegIp     string `json:"reg_ip"`
	Name      string `json:"name"`
	IsDisable bool   `json:"is_disable"`
}

type UserReg

type UserReg struct {
	Email        string `validate:"required,email"`
	Password     string `validate:"required,min=6,max=50"`
	Name         string `validate:"required,min=3,max=16"`
	CaptchaToken string
	EmailJwt     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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