Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(validator *validation.Validator, repo Repository, logger *zerolog.Logger) *Handler
func (*Handler) GetPreferences ¶
func (h *Handler) GetPreferences(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdatePreferences ¶
func (h *Handler) UpdatePreferences(w http.ResponseWriter, r *http.Request)
type Repository ¶
type Repository interface {
// GetPreferencesByUserId retrieves preferences for a specific user
GetPreferencesByUserId(ctx context.Context, userID uuid.UUID) (repository.GetPreferencesByUserIdRow, error)
// UpdatePreferences updates a user's preferences
UpdatePreferences(ctx context.Context, params repository.UpdatePreferencesParams) (repository.Preference, error)
}
Repository defines the interface for user preferences data operations
func NewRepository ¶
func NewRepository(queries *repository.Queries) Repository
NewRepository creates a new preferences repository
type UpdateUserPreferencesReq ¶
type UpdateUserPreferencesReq struct {
Currency *string `json:"currency"`
Locale *string `json:"locale"`
Theme *string `json:"theme"`
Timezone *string `json:"timezone"`
TimeFormat *string `json:"time_format"`
DateFormat *string `json:"date_format"`
StartWeekOnMonday *bool `json:"start_week_on_monday"`
DarkSidebar *bool `json:"dark_sidebar"`
}
UserPreferences holds the user preferences data structure
Click to show internal directories.
Click to hide internal directories.