Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create parse a ann from request and create a new record in DB
Create godoc @Summary Create Announcement @Description Create an announcement from post json object @ID Announcements.Create @Security ApiKeyAuth @Tags Announcements @Accept json @Produce json @Param Annoucement body annRequest true "Announcement Object" @Param Authorization header string true "Access Token" @Success 200 {object} annResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /announcements [post]
func Destroy ¶
Destroy receive a id from request and delete in from DB
Destroy godoc @Summary Destroy Announcement @Description Destroy an announcement according to nid @ID Announcements.Destroy @Security ApiKeyAuth @Tags Announcements @Accept json @Produce json @Param aid path uint true "Announcement ID" @Param Authorization header string true "Access Token" @Success 200 {object} destroyResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /announcements/{aid} [delete]
func Index ¶
Index gets all anns and return to http in json
Index godoc @Summary All Announcements @Description Simply list out all announcements @ID Announcements.Index @Security ApiKeyAuth @Tags Announcements @Accept json @Produce json @Param Authorization header string true "Access Token" @Success 200 {object} indexResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /announcements [get]
func Show ¶
Show receive a id from request and find the ann of the specific id
Show godoc @Summary Show Announcements @Description Show a announcement according to id @ID Announcements.Show @Security ApiKeyAuth @Tags Announcements @Accept json @Produce json @Param aid path uint true "Announcement ID" @Param Authorization header string true "Access Token" @Success 200 {object} annResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /announcements/{aid} [get]
func Update ¶
Update receive a id and a ann from request and update the specific record in DB
Update godoc @Summary Update Announcement @Description Update a announcement @ID Announcements.Update @Security ApiKeyAuth @Tags Announcements @Accept json @Produce json @Param aid path uint true "Announcement ID" @Param Announcement body annRequest true "Announcement Object" @Param Authorization header string true "Access Token" @Success 200 {object} annResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /announcements/{aid} [patch]
Types ¶
This section is empty.