user

package
v0.0.0-...-26d71a5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Body struct {
		FirstName string `json:"first_name" example:"ivan" doc:"User first name"`
		LastName  string `json:"last_name" example:"ivanov" doc:"User last nam"`
		Username  string `json:"username" example:"ivanko228" doc:"Username"`
		PhotoURL  string `json:"photo_url" example:"https://telegram/photo_ivan.png" doc:"User photo url"`
	}
}

Schemas

type DeleteUserRequest

type DeleteUserRequest struct {
	UserId  int `path:"userId" maxLength:"30" example:"123" doc:"user id"`
	SpaceId int `path:"spaceId" maxLength:"30" example:"123" doc:"space id"`
}

Schemas

type FormByIdRequest

type FormByIdRequest struct {
	UserID  int `path:"userId" maxLength:"30" example:"1" doc:"user id"`
	SpaceID int `path:"spaceId" maxLength:"30" example:"1" doc:"space id"`
}

Schemas

type FormResponse

type FormResponse struct {
	Body struct {
		*entity.Form
	}
}

Schemas

func ToFormOutputFromEntity

func ToFormOutputFromEntity(form *entity.Form) *FormResponse

type IUserUseCase

type IUserUseCase interface {
	GetUser(ctx context.Context, cmd commands.UserByIdCommand) (*entity.User, []*entity.Form, error)
	CreateUser(ctx context.Context, cmd commands.CreateUserCommand) (*entity.User, error)
	UpdateUser(ctx context.Context, cmd commands.UpdateUserCommand) (*entity.User, error)
	DeleteUser(ctx context.Context, cmd commands.FormByIdCommand) error
	GetForm(ctx context.Context, cmd commands.FormByIdCommand) (*entity.Form, error)
	UpdateForm(ctx context.Context, cmd commands.UpdateFormCommand) (*entity.User, []*entity.Form, error)
}

type UpdateFormRequest

type UpdateFormRequest struct {
	UserID  int `path:"userId" maxLength:"30" example:"1" doc:"user id"`
	SpaceID int `path:"spaceId" maxLength:"30" example:"1" doc:"space id"`
	Body    struct {
		UserTags entity.Tags
		PairTags entity.Tags
	}
}

Schemas

type UpdateUserRequest

type UpdateUserRequest struct {
	ID   int `path:"id" maxLength:"30" example:"1" doc:"user id"`
	Body struct {
		FirstName string `json:"first_name" example:"ivan" doc:"User first name"`
		LastName  string `json:"last_name" example:"ivanov" doc:"User last nam"`
		Username  string `json:"username" example:"ivanko228" doc:"Username"`
		PhotoURL  string `json:"photo_url" example:"https://telegram/photo_ivan.png" doc:"User photo url"`
	}
}

Schemas

type UserByIdRequest

type UserByIdRequest struct {
	ID int `path:"id" maxLength:"30" example:"1" doc:"user id"`
}

Schemas

type UserHandler

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

func NewUserHandler

func NewUserHandler(uc IUserUseCase) *UserHandler

func (*UserHandler) CreateUser

func (uh *UserHandler) CreateUser(ctx context.Context, req *CreateUserRequest) (*UserResponse, error)

func (*UserHandler) DeleteUser

func (uh *UserHandler) DeleteUser(ctx context.Context, req *DeleteUserRequest) (*struct{}, error)

func (*UserHandler) GetForm

func (uh *UserHandler) GetForm(ctx context.Context, req *FormByIdRequest) (*FormResponse, error)

func (*UserHandler) GetUserWithForms

func (uh *UserHandler) GetUserWithForms(ctx context.Context, req *UserByIdRequest) (*UserWithFormsResponse, error)

func (*UserHandler) UpdateForm

func (*UserHandler) UpdateUser

func (uh *UserHandler) UpdateUser(ctx context.Context, req *UpdateUserRequest) (*UserResponse, error)

type UserResponse

type UserResponse struct {
	Body struct {
		*entity.User
	}
}

Schemas

func ToUserOutputFromEntity

func ToUserOutputFromEntity(user *entity.User) *UserResponse

Converters

type UserWithFormsResponse

type UserWithFormsResponse struct {
	Body struct {
		*entity.User
		Forms []*entity.Form
	}
}

Schemas

func ToUserWithFormsOutputFromEntity

func ToUserWithFormsOutputFromEntity(user *entity.User, forms []*entity.Form) *UserWithFormsResponse

Jump to

Keyboard shortcuts

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