Documentation ¶
Index ¶
- Variables
- type AdminService
- func (w *AdminService) Auth(ctx context.Context, token string) (*model.TokenClaims, error)
- func (w *AdminService) EditUser(ctx context.Context, u model.EditUser, uid int) error
- func (w *AdminService) IsAdmin(ctx context.Context, t *model.TokenClaims) error
- func (w *AdminService) ListUser(ctx context.Context, page int, email, name string) ([]model.UserList, int, error)
- type TextureService
- type UserService
- func (w *UserService) ChangeName(ctx context.Context, newName string, t *model.TokenClaims) error
- func (w *UserService) ChangePasswd(ctx context.Context, p model.ChangePasswd, uid int, validOldPass bool) error
- func (w *UserService) ForgotPassword(ctx context.Context, email, passWord, emailJwt string) error
- func (w *UserService) Info(ctx context.Context, t *model.TokenClaims) (model.UserInfo, error)
- func (w *UserService) Login(ctx context.Context, l model.Login, ip string) (model.LoginRep, error)
- func (w *UserService) Reg(ctx context.Context, u model.UserReg, ipPrefix, ip string) (model.LoginRep, error)
- func (w *UserService) SendChangePasswordEmail(ctx context.Context, email, CaptchaToken, host, ip string) error
- func (w *UserService) SendRegEmail(ctx context.Context, email, CaptchaToken, host, ip string) error
- type WebService
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("无权限")
View Source
var Service = wire.NewSet(NewUserSerice, NewTextureService, NewAdminService, NewWebService)
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) IsAdmin ¶ added in v0.0.3
func (w *AdminService) IsAdmin(ctx context.Context, t *model.TokenClaims) error
type TextureService ¶ added in v0.0.3
type TextureService struct {
// contains filtered or unexported fields
}
func NewTextureService ¶ added in v0.0.3
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 (w *UserService) Info(ctx context.Context, t *model.TokenClaims) (model.UserInfo, 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
Click to show internal directories.
Click to hide internal directories.