Documentation ¶
Index ¶
- func CreateNews(w http.ResponseWriter, r *http.Request)
- func Ctx(next http.Handler) http.Handler
- func DeleteNews(w http.ResponseWriter, r *http.Request)
- func ListNews(w http.ResponseWriter, r *http.Request)
- func NewNewsListResponse(news []models.News) []render.Renderer
- func PatchNews(w http.ResponseWriter, r *http.Request)
- func Router(r chi.Router)
- func UpdateNews(w http.ResponseWriter, r *http.Request)
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNews ¶
func CreateNews(w http.ResponseWriter, r *http.Request)
CreateNews godoc @Summary Create a new news entry @Description Create a new news entry @Tags news @Accept json @Produce json @Param news body Request true "News Entry" @Param FacilityID path string true "Facility ID" @Success 201 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/news [post]
func DeleteNews ¶
func DeleteNews(w http.ResponseWriter, r *http.Request)
DeleteNews godoc @Summary Delete a news entry @Description Delete a news entry @Tags news @Accept json @Produce json @Param id path string true "News ID" @Param FacilityID path string true "Facility ID" @Success 204 @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/news/{id} [delete]
func ListNews ¶
func ListNews(w http.ResponseWriter, r *http.Request)
ListNews godoc @Summary List all news entries @Description List all news entries @Tags news @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Success 200 {object} []Response @Failure 422 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/news [get]
func PatchNews ¶
func PatchNews(w http.ResponseWriter, r *http.Request)
PatchNews godoc @Summary Patch a news entry @Description Patch a news entry @Tags news @Accept json @Produce json @Param id path string true "News ID" @Param news body Request true "News Entry" @Param FacilityID path string true "Facility ID" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/news/{id} [patch]
func UpdateNews ¶
func UpdateNews(w http.ResponseWriter, r *http.Request)
UpdateNews godoc @Summary Update a news entry @Description Update a news entry @Tags news @Accept json @Produce json @Param id path string true "News ID" @Param news body Request true "News Entry" @Param FacilityID path string true "Facility ID" @Success 200 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/news/{id} [put]