Documentation ¶
Index ¶
- func CreateRatingChange(w http.ResponseWriter, r *http.Request)
- func Ctx(next http.Handler) http.Handler
- func DeleteRatingChange(w http.ResponseWriter, r *http.Request)
- func ListRatingChanges(w http.ResponseWriter, r *http.Request)
- func NewRatingChangeListResponse(rc []models.RatingChange) []render.Renderer
- func PatchRatingChange(w http.ResponseWriter, r *http.Request)
- func Router(r chi.Router)
- func UpdateRatingChange(w http.ResponseWriter, r *http.Request)
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRatingChange ¶
func CreateRatingChange(w http.ResponseWriter, r *http.Request)
CreateRatingChange godoc @Summary Create a new rating change @Description Create a new rating change @Tags rating-change @Accept json @Produce json @Param cid path int true "CID" @Param rating_change body Request true "Rating Change" @Success 201 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/rating-change [post]
func DeleteRatingChange ¶
func DeleteRatingChange(w http.ResponseWriter, r *http.Request)
DeleteRatingChange godoc @Summary Delete a rating change @Description Delete a rating change @Tags rating-change @Accept json @Produce json @Param id path int true "Rating Change ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/rating-change/{id} [delete]
func ListRatingChanges ¶
func ListRatingChanges(w http.ResponseWriter, r *http.Request)
ListRatingChanges godoc @Summary List rating changes @Description List rating changes @Tags rating-change @Accept json @Produce json @Param cid path int true "CID" @Success 200 {object} []Response @Failure 422 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/rating-change [get]
func NewRatingChangeListResponse ¶
func NewRatingChangeListResponse(rc []models.RatingChange) []render.Renderer
func PatchRatingChange ¶
func PatchRatingChange(w http.ResponseWriter, r *http.Request)
PatchRatingChange godoc @Summary Patch a rating change @Description Patch a rating change @Tags rating-change @Accept json @Produce json @Param cid path int true "CID" @Param id path int true "Rating Change ID" @Param rating_change body Request true "Rating Change" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/rating-change/{id} [patch]
func UpdateRatingChange ¶
func UpdateRatingChange(w http.ResponseWriter, r *http.Request)
UpdateRatingChange godoc @Summary Update a rating change @Description Update a rating change @Tags rating-change @Accept json @Produce json @Param cid path int true "CID" @Param id path int true "Rating Change ID" @Param rating_change body Request true "Rating Change" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/rating-change/{id} [put]
Types ¶
type Request ¶
type Response ¶
type Response struct {
*models.RatingChange
}
func NewRatingChangeResponse ¶
func NewRatingChangeResponse(rc *models.RatingChange) *Response