1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: add swagger docs (resolve #40)

This commit is contained in:
Ferdinand Mütsch
2021-02-07 11:54:07 +01:00
parent 6f30272b8c
commit 8fc39f23fa
33 changed files with 2303 additions and 57 deletions

View File

@ -43,6 +43,14 @@ func (h *HeartbeatApiHandler) RegisterRoutes(router *mux.Router) {
r.Methods(http.MethodPost).HandlerFunc(h.Post)
}
// @Summary Push a new heartbeat
// @ID post-heartbeat
// @Tags heartbeat
// @Accept json
// @Param heartbeat body models.Heartbeat true "A heartbeat"
// @Security ApiKeyAuth
// @Success 201
// @Router /heartbeat [post]
func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
var heartbeats []*models.Heartbeat
user := r.Context().Value(models.UserKey).(*models.User)