Help us shape the future of Go! Take the 2026 Go Developer Survey

feedback

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller handles HTTP requests for feedback endpoints

func NewController

func NewController(service Service, logger *zap.Logger) *Controller

NewController creates a new feedback controller

func (*Controller) SubmitFeedback

func (c *Controller) SubmitFeedback(ctx *gin.Context)

SubmitFeedback godoc @Summary Submit student feedback @Description Process student feedback about task difficulty. @Tags feedback @Accept json @Produce json @Param feedback body FeedbackRequest true "Feedback request" @Success 200 {object} StrategyUpdate @Failure 400 {object} apierror.Response @Failure 500 {object} apierror.Response @Router /api/v1/feedback [post]

type Feedback

type Feedback struct {
	ID                  uuid.UUID       `json:"id"`
	StudentID           uuid.UUID       `json:"student_id"`
	Message             string          `json:"message"`
	PerceivedDifficulty string          `json:"perceived_difficulty"`
	StrategySnapshot    json.RawMessage `json:"strategy_snapshot"`
	CreatedAt           time.Time       `json:"created_at"`
}

Feedback represents student feedback with perceived difficulty and strategy snapshot

type FeedbackRequest

type FeedbackRequest struct {
	StudentID uuid.UUID `json:"student_id" binding:"required"`
	TaskID    string    `json:"task_id" binding:"required"`
	Message   string    `json:"message" binding:"required,max=5000"`
}

FeedbackRequest is the HTTP request DTO for submitting feedback

type Repository

type Repository interface {
	Save(ctx context.Context, feedback *Feedback) error
	GetLatestByStudent(ctx context.Context, studentID uuid.UUID, limit int) ([]Feedback, error)
}

Repository defines the interface for feedback data access

func NewRepository

func NewRepository(db database.DB) Repository

NewRepository creates a new feedback repository backed by the given database.

type Service

type Service interface {
	ProcessFeedback(ctx context.Context, req *FeedbackRequest) (*StrategyUpdate, error)
}

Service defines the interface for feedback processing

func NewService

func NewService(
	repo Repository,
	llmClient clients.LLMClient,
	llmTimeout time.Duration,
	logger *zap.Logger,
) Service

NewService creates a new feedback service

type StrategyUpdate

type StrategyUpdate struct {
	StudentID            uuid.UUID              `json:"student_id"`
	TaskID               string                 `json:"task_id"`
	DifficultyAdjustment float64                `json:"difficulty_adjustment"`
	TopicWeights         map[string]float64     `json:"topic_weights"`
	Sentiment            string                 `json:"sentiment"`
	StrategySnapshot     map[string]interface{} `json:"strategy_snapshot"`
	Timestamp            time.Time              `json:"timestamp"`
}

StrategyUpdate is the response DTO returned after processing feedback

Jump to

Keyboard shortcuts

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