comment

package
v0.0.0-...-8491d02 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

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

Handlers provides HTTP handlers for comment management

func NewHandlers

func NewHandlers(service Service) *Handlers

NewHandlers creates a new Handlers

func (*Handlers) Create

func (h *Handlers) Create(c echo.Context) error

Create handles the creation of a new comment

func (*Handlers) Delete

func (h *Handlers) Delete(c echo.Context) error

Delete handles deleting a comment

func (*Handlers) GetByID

func (h *Handlers) GetByID(c echo.Context) error

GetByID handles retrieving a comment by ID

func (*Handlers) List

func (h *Handlers) List(c echo.Context) error

List handles retrieving comments based on filter parameters

func (*Handlers) RegisterRoutes

func (h *Handlers) RegisterRoutes(g *echo.Group, rbacMiddleware *middleware.RBACMiddleware)

RegisterRoutes registers the comment routes

func (*Handlers) Update

func (h *Handlers) Update(c echo.Context) error

Update handles updating a comment

type Service

type Service interface {
	// Create creates a new comment
	Create(ctx context.Context, req models.CommentRequest, userID uuid.UUID) (*models.CommentResponse, error)

	// GetByID retrieves a comment by ID
	GetByID(ctx context.Context, id uuid.UUID) (*models.CommentResponse, error)

	// List retrieves comments based on filter parameters
	List(ctx context.Context, params models.CommentListParams) ([]models.CommentResponse, int, error)

	// Update updates a comment
	Update(ctx context.Context, id uuid.UUID, req models.CommentRequest) (*models.CommentResponse, error)

	// Delete deletes a comment
	Delete(ctx context.Context, id uuid.UUID) error
}

Service provides comment management functionality

func NewService

func NewService(
	commentRepo repository.CommentRepository,
	taskRepo repository.TaskRepository,
	userRepo repository.UserRepository,
	notificationSvc notification.Service,
) Service

NewService creates a new comment service

Jump to

Keyboard shortcuts

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