dto

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoPrivateUser

type InfoPrivateUser struct {
	ID            primitive.ObjectID `json:"_id" binding:"required" validate:"required"`
	Email         string             `json:"email" binding:"required" validate:"required,email"`
	Name          string             `json:"name" binding:"required" validate:"required"`
	ProfilePicURL *string            `json:"profilePicUrl,omitempty" validate:"omitempty,url"`
	Roles         []*InfoRole        `json:"roles" validate:"required,dive,required"`
}

func NewInfoPrivateUser

func NewInfoPrivateUser(user *model.User) *InfoPrivateUser

func (*InfoPrivateUser) GetValue

func (d *InfoPrivateUser) GetValue() *InfoPrivateUser

func (*InfoPrivateUser) ValidateErrors

func (d *InfoPrivateUser) ValidateErrors(errs validator.ValidationErrors) ([]string, error)

type InfoPublicUser

type InfoPublicUser struct {
	ID            primitive.ObjectID `json:"_id" binding:"required" validate:"required"`
	Name          string             `json:"name" binding:"required" validate:"required"`
	ProfilePicURL *string            `json:"profilePicUrl,omitempty" validate:"omitempty,url"`
}

func NewInfoPublicUser

func NewInfoPublicUser(user *model.User) *InfoPublicUser

func (*InfoPublicUser) GetValue

func (d *InfoPublicUser) GetValue() *InfoPublicUser

func (*InfoPublicUser) ValidateErrors

func (d *InfoPublicUser) ValidateErrors(errs validator.ValidationErrors) ([]string, error)

type InfoRole

type InfoRole struct {
	ID   primitive.ObjectID `json:"_id" binding:"required" validate:"required"`
	Code model.RoleCode     `json:"code" binding:"required" validate:"required,rolecode"`
}

func EmptyInfoRole

func EmptyInfoRole() *InfoRole

func NewInfoRole

func NewInfoRole(role *model.Role) *InfoRole

func (*InfoRole) GetValue

func (d *InfoRole) GetValue() *InfoRole

func (*InfoRole) ValidateErrors

func (d *InfoRole) ValidateErrors(errs validator.ValidationErrors) ([]string, error)

Jump to

Keyboard shortcuts

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