announcements

package
v0.0.0-...-aa13637 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *gin.Context)

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

func Destroy(c *gin.Context)

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

func Index(c *gin.Context)

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

func Show(c *gin.Context)

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

func Update(c *gin.Context)

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.

Jump to

Keyboard shortcuts

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