user_flag

package
v0.0.0-...-48f5382 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ctx

func Ctx(next http.Handler) http.Handler

func DeleteUserFlag

func DeleteUserFlag(w http.ResponseWriter, r *http.Request)

DeleteUserFlag godoc @Summary Delete a user flag @Description Delete a user flag @Tags user-flag @Accept json @Produce json @Param cid path int true "CID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/user-flag [delete]

func GetUserFlag

func GetUserFlag(w http.ResponseWriter, r *http.Request)

GetUserFlag godoc @Summary Get a user flag @Description Get a user flag @Tags user-flag @Accept json @Produce json @Param cid path int true "CID" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/user-flag [get]

func NewUserFlagListResponse

func NewUserFlagListResponse(userFlags []models.UserFlag) []render.Renderer

func PatchUserFlag

func PatchUserFlag(w http.ResponseWriter, r *http.Request)

PatchUserFlag godoc @Summary Patch a user flag @Description Patch a user flag @Tags user-flag @Accept json @Produce json @Param cid path int true "CID" @Param user_flag body Request true "User Flag" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/user-flag [patch]

func Router

func Router(r chi.Router)

func UpdateUserFlag

func UpdateUserFlag(w http.ResponseWriter, r *http.Request)

UpdateUserFlag godoc @Summary Update a user flag @Description Update a user flag @Tags user-flag @Accept json @Produce json @Param cid path int true "CID" @Param user_flag body Request true "User Flag" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/user-flag [put]

Types

type Request

type Request struct {
	NoStaffRole              bool `json:"no_staff_role" example:"false"`
	NoStaffLogEntryID        uint `json:"no_staff_log_entry_id" example:"1"`
	NoVisiting               bool `json:"no_visiting" example:"false"`
	NoVisitingLogEntryID     uint `json:"no_visiting_log_entry_id" example:"1"`
	NoTransferring           bool `json:"no_transferring" example:"false"`
	NoTransferringLogEntryID uint `json:"no_transferring_log_entry_id" example:"1"`
	NoTraining               bool `json:"no_training" example:"false"`
	NoTrainingLogEntryID     uint `json:"no_training_log_entry_id" example:"1"`
	UsedTransferOverride     bool `json:"used_transfer_override" example:"false"`
}

func (*Request) Bind

func (req *Request) Bind(r *http.Request) error

func (*Request) Validate

func (req *Request) Validate() error

type Response

type Response struct {
	*models.UserFlag
}

func NewUserFlagResponse

func NewUserFlagResponse(r *models.UserFlag) *Response

func (*Response) Render

func (res *Response) Render(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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