service

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: 27 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

View Source
var (
	ErrExistUser  = errors.New("邮箱已存在")
	ErrExitsName  = errors.New("用户名已存在")
	ErrRegLimit   = errors.New("超过注册 ip 限制")
	ErrPassWord   = errors.New("错误的密码或用户名")
	ErrChangeName = errors.New("离线模式 uuid 不允许修改用户名")
	ErrUsername   = errors.New("邮箱不存在")
)
View Source
var ErrNotAdmin = errors.New("无权限")

Functions

This section is empty.

Types

type AdminService added in v0.0.3

type AdminService struct {
	// contains filtered or unexported fields
}

func NewAdminService added in v0.0.3

func NewAdminService(authService *auth.AuthService, client *ent.Client,
	config config.Config, cache cache.Cache) *AdminService

func (*AdminService) Auth added in v0.0.3

func (w *AdminService) Auth(ctx context.Context, token string) (*model.TokenClaims, error)

func (*AdminService) EditUser added in v0.0.3

func (w *AdminService) EditUser(ctx context.Context, u model.EditUser, uid int) error

func (*AdminService) IsAdmin added in v0.0.3

func (w *AdminService) IsAdmin(ctx context.Context, t *model.TokenClaims) error

func (*AdminService) ListUser added in v0.0.3

func (w *AdminService) ListUser(ctx context.Context, page int, email, name string) ([]model.UserList, int, error)

type TextureService added in v0.0.3

type TextureService struct {
	// contains filtered or unexported fields
}

func NewTextureService added in v0.0.3

func NewTextureService(client *ent.Client, config config.Config, cache cache.Cache) *TextureService

func (*TextureService) PutTexture added in v0.0.3

func (w *TextureService) PutTexture(ctx context.Context, t *model.TokenClaims, texturebyte []byte, model string, textureType string) error

type UserService added in v0.0.3

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserSerice added in v0.0.3

func NewUserSerice(config config.Config, client *ent.Client, captchaService *captcha.CaptchaService,
	authService *auth.AuthService, cache cache.Cache, emailService *email.EmailService) *UserService

func (*UserService) ChangeName added in v0.0.3

func (w *UserService) ChangeName(ctx context.Context, newName string, t *model.TokenClaims) error

func (*UserService) ChangePasswd added in v0.0.3

func (w *UserService) ChangePasswd(ctx context.Context, p model.ChangePasswd, uid int, validOldPass bool) error

func (*UserService) ForgotPassword added in v0.0.3

func (w *UserService) ForgotPassword(ctx context.Context, email, passWord, emailJwt string) error

func (*UserService) Info added in v0.0.3

func (*UserService) Login added in v0.0.3

func (w *UserService) Login(ctx context.Context, l model.Login, ip string) (model.LoginRep, error)

func (*UserService) Reg added in v0.0.3

func (w *UserService) Reg(ctx context.Context, u model.UserReg, ipPrefix, ip string) (model.LoginRep, error)

func (*UserService) SendChangePasswordEmail added in v0.0.3

func (w *UserService) SendChangePasswordEmail(ctx context.Context, email, CaptchaToken, host, ip string) error

func (*UserService) SendRegEmail added in v0.0.3

func (w *UserService) SendRegEmail(ctx context.Context, email, CaptchaToken, host, ip string) error

type WebService

type WebService struct {
	// contains filtered or unexported fields
}

func NewWebService

func NewWebService(c config.Config) *WebService

func (*WebService) GetConfig

func (w *WebService) GetConfig(ctx context.Context) model.Config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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