space

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSpaceRequest

type CreateSpaceRequest struct {
	Body struct {
		UserId      int         `json:"userId" example:"123" doc:"User ID"`
		Name        string      `json:"name" example:"MAI" doc:"Space Name"`
		Description string      `json:"description" example:"university" doc:"Space description"`
		Tags        entity.Tags `json:"tags" doc:"Tags options for this space"`
	}
}

type ISpaceUseCase

type ISpaceUseCase interface {
	CreateSpace(ctx context.Context, cmd commands.CreateSpaceCommand) (*entity.Space, error)
	GetSpace(ctx context.Context, cmd commands.SpaceByIdCommand) (*entity.Space, error)
	JoinSpace(ctx context.Context, cmd commands.JoinSpaceCommand) error
	UpdateSpace(ctx context.Context, cmd commands.UpdateSpaceCommand) (*entity.Space, error)
	DeleteSpace(ctx context.Context, cmd commands.SpaceByIdCommand) error
}

type JoinSpaceRequest

type JoinSpaceRequest struct {
	Body struct {
		SpaceId int `json:"spaceId" example:"123" doc:"Space ID"`
		UserId  int `json:"userId" example:"123" doc:"Space ID"`
	}
}

type SpaceByIdRequest

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

type SpaceHandler

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

func NewSpaceHandler

func NewSpaceHandler(uc ISpaceUseCase) *SpaceHandler

func (*SpaceHandler) CreateSpace

func (sh *SpaceHandler) CreateSpace(ctx context.Context, req *CreateSpaceRequest) (*SpaceResponse, error)

func (*SpaceHandler) DeleteSpace

func (sh *SpaceHandler) DeleteSpace(ctx context.Context, req *SpaceByIdRequest) (*struct{}, error)

func (*SpaceHandler) GetSpace

func (sh *SpaceHandler) GetSpace(ctx context.Context, req *SpaceByIdRequest) (*SpaceResponse, error)

func (*SpaceHandler) JoinSpace

func (sh *SpaceHandler) JoinSpace(ctx context.Context, req *JoinSpaceRequest) (*struct{}, error)

func (*SpaceHandler) UpdateSpace

func (sh *SpaceHandler) UpdateSpace(ctx context.Context, req *UpdateSpaceRequest) (*SpaceResponse, error)

type SpaceResponse

type SpaceResponse struct {
	Body struct {
		entity.Space
	}
}

func ToSpaceOutputFromEntity

func ToSpaceOutputFromEntity(space *entity.Space) *SpaceResponse

Converters

type UpdateSpaceRequest

type UpdateSpaceRequest struct {
	ID   int `path:"id" maxLength:"30" example:"1" doc:"space id"`
	Body struct {
		Name        string `json:"name" example:"MAI" doc:"Space Name"`
		Description string `json:"description" example:"university" doc:"Space description"`
	}
}

Jump to

Keyboard shortcuts

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