event

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 CreateEventRequest

type CreateEventRequest struct {
	Body struct {
		SpaceId   int `json:"spaceId" example:"123" doc:"Space ID"`
		UserId    int `json:"userId" example:"123" doc:"Event ID"`
		EventInfo struct {
			Name        string      `json:"name" example:"fun event" doc:"Event name"`
			Description string      `json:"description" example:"enormously fun event" doc:"Event description"`
			BeginDate   time.Time   `json:"beginDate" example:"2007-03-01T13:00:00" doc:"Event start date and time"`
			EndDate     time.Time   `json:"endDate" example:"2007-03-01T13:00:00" doc:"Event end date and time"`
			Tags        entity.Tags `json:"tags" doc:"Tags for this event"`
		}
	}
}

type EventByIdRequest

type EventByIdRequest struct {
	ID int `path:"id" json:"id" maxLength:"30" example:"1" doc:"event id"`
}

type EventHandler

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

func NewEventHandler

func NewEventHandler(uc IEventUseCase) *EventHandler

func (*EventHandler) CreateEvent

func (eh *EventHandler) CreateEvent(ctx context.Context, req *CreateEventRequest) (*EventResponse, error)

func (*EventHandler) DeleteEvent

func (eh *EventHandler) DeleteEvent(ctx context.Context, req *EventByIdRequest) (*struct{}, error)

func (*EventHandler) GetEvent

func (eh *EventHandler) GetEvent(ctx context.Context, req *EventByIdRequest) (*EventResponse, error)

func (*EventHandler) JoinEvent

func (eh *EventHandler) JoinEvent(ctx context.Context, req *JoinEventRequest) (*struct{}, error)

type EventResponse

type EventResponse struct {
	Body struct {
		entity.Event
	}
}

func ToEventOutputFromEntity

func ToEventOutputFromEntity(event *entity.Event) *EventResponse

Converters

type IEventUseCase

type IEventUseCase interface {
	CreateEvent(ctx context.Context, cmd commands.CreateEventCommand) (*entity.Event, error)
	GetEvent(ctx context.Context, cmd commands.EventByIdCommand) (*entity.Event, error)
	JoinEvent(ctx context.Context, cmd commands.JoinEventCommand) error
	DeleteEvent(ctx context.Context, cmd commands.EventByIdCommand) error
}

type JoinEventRequest

type JoinEventRequest struct {
	EventId int `path:"id" json:"eventId" example:"123" doc:"Event ID"`
	Body    struct {
		UserId int `json:"userId" example:"123" doc:"User ID"`
	}
}

Jump to

Keyboard shortcuts

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