model

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPassword          = errors.New("empty password")
	ErrPasswordTooLong        = errors.New("password too long")
	ErrPasswordHasInvalidChar = errors.New("password has invalid char")

	ErrEmptyUserId            = errors.New("empty user id")
	ErrEmptyUsername          = errors.New("empty username")
	ErrUsernameTooLong        = errors.New("username too long")
	ErrUsernameHasInvalidChar = errors.New("username has invalid char")
)

Functions

func GetPageAndSize added in v0.2.1

func GetPageAndSize(ctx *gin.Context) (page int, size int, err error)

Types

type ApiResp

type ApiResp struct {
	Error string `json:"error,omitempty"`
	Data  any    `json:"data,omitempty"`
}

func NewApiDataResp

func NewApiDataResp(data any) *ApiResp

func NewApiErrorResp

func NewApiErrorResp(err error) *ApiResp

func NewApiErrorStringResp

func NewApiErrorStringResp(err string) *ApiResp

func (*ApiResp) SetDate

func (ar *ApiResp) SetDate(data any)

func (*ApiResp) SetError

func (ar *ApiResp) SetError(err error)

type BindEmailReq added in v0.3.0

type BindEmailReq struct {
	Email   string `json:"email" binding:"required"`
	Captcha string `json:"captcha" binding:"required"`
}

type CreateUserReq

type CreateUserReq user.CreateUserReq

func (*CreateUserReq) Validate

func (r *CreateUserReq) Validate() error

type DeviceIDReq added in v0.3.0

type DeviceIDReq struct {
	DeviceID uint64 `json:"deviceId" binding:"required"`
}

type GetDeviceDetailReq added in v0.2.1

type GetDeviceDetailReq struct {
	ID uint64 `form:"id" binding:"required"`
}

type GetDeviceDetailResp added in v0.2.1

type GetDeviceDetailResp struct {
	*device.DeviceInfo
	*device.DeviceLastSeen
	*collection.CollectionRecord
}

type ListUserReq

type ListUserReq user.ListUserReq

func (*ListUserReq) Validate

func (r *ListUserReq) Validate() error

type LoginUserReq

type LoginUserReq struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*LoginUserReq) Validate

func (l *LoginUserReq) Validate() error

type SendBindEmailCaptchaReq added in v0.3.0

type SendBindEmailCaptchaReq struct {
	Email string `json:"email" binding:"required"`
}

type SendBindEmailCaptchaResp added in v0.3.0

type SendBindEmailCaptchaResp struct {
	Captcha string `json:"captcha"`
}

type SetUserPasswordReq

type SetUserPasswordReq struct {
	Password string `json:"password"`
}

func (*SetUserPasswordReq) Validate

func (s *SetUserPasswordReq) Validate() error

type SetUsernameReq

type SetUsernameReq struct {
	Username string `json:"username"`
}

func (*SetUsernameReq) Validate

func (s *SetUsernameReq) Validate() error

type UserIDReq

type UserIDReq struct {
	ID string `json:"id"`
}

func (*UserIDReq) Validate

func (u *UserIDReq) Validate() error

Jump to

Keyboard shortcuts

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