From 98de0ef7e9f8fb31b74cf3502777638dd455d7eb Mon Sep 17 00:00:00 2001 From: Cubicroot Date: Mon, 11 Oct 2021 19:44:29 +0200 Subject: [PATCH] add tags and id --- internal/api/application.go | 10 ++++++++++ internal/api/health.go | 2 ++ internal/api/notification.go | 4 ++++ internal/api/user.go | 10 ++++++++++ 4 files changed, 26 insertions(+) diff --git a/internal/api/application.go b/internal/api/application.go index 5ee6707..9914924 100644 --- a/internal/api/application.go +++ b/internal/api/application.go @@ -112,6 +112,8 @@ func (h *ApplicationHandler) updateApplication(ctx *gin.Context, a *model.Applic // CreateApplication godoc // @Summary Create Application // @Description Create a new application +// @ID post-application +// @Tags Application // @Accept json,mpfd // @Produce json // @Param name query string true "Name of the application" @@ -144,6 +146,8 @@ func (h *ApplicationHandler) CreateApplication(ctx *gin.Context) { // GetApplications godoc // @Summary Get Applications // @Description Get all applications from current user +// @ID get-application +// @Tags Application // @Accept json,mpfd // @Produce json // @Success 200 {array} model.Application @@ -167,6 +171,8 @@ func (h *ApplicationHandler) GetApplications(ctx *gin.Context) { // GetApplication godoc // @Summary Get Application // @Description Get single application by ID +// @ID get-application-id +// @Tags Application // @Accept json,mpfd // @Produce json // @Param id path int true "ID of the application" @@ -197,6 +203,8 @@ func (h *ApplicationHandler) GetApplication(ctx *gin.Context) { // DeleteApplication godoc // @Summary Delete Application // @Description Delete an application +// @ID delete-application-id +// @Tags Application // @Accept json,mpfd // @Produce json // @Param id path int true "ID of the application" @@ -224,6 +232,8 @@ func (h *ApplicationHandler) DeleteApplication(ctx *gin.Context) { // UpdateApplication godoc // @Summary Update Application // @Description Update an application +// @ID put-application-id +// @Tags Application // @Accept json,mpfd // @Produce json // @Param id path int true "ID of the application" diff --git a/internal/api/health.go b/internal/api/health.go index 9c3ff65..b9b42ad 100644 --- a/internal/api/health.go +++ b/internal/api/health.go @@ -13,6 +13,8 @@ type HealthHandler struct { // Health godoc // @Summary Health of the application +// @ID get-health +// @Tags Health // @Accept json,mpfd // @Produce json // @Success 200 "" diff --git a/internal/api/notification.go b/internal/api/notification.go index bca42de..c04df4d 100644 --- a/internal/api/notification.go +++ b/internal/api/notification.go @@ -32,6 +32,8 @@ type NotificationHandler struct { // CreateNotification godoc // @Summary Create a Notification // @Description Creates a new notification for the given channel +// @ID post-message +// @Tags Application // @Accept json,mpfd // @Produce json // @Param message query string true "The message to send" @@ -73,6 +75,8 @@ func (h *NotificationHandler) CreateNotification(ctx *gin.Context) { // DeleteNotification godoc // @Summary Delete a Notification // @Description Informs the channel that the notification is deleted +// @ID deƶete-message-id +// @Tags Application // @Accept json,mpfd // @Produce json // @Param message_id path string true "ID of the message to delete" diff --git a/internal/api/user.go b/internal/api/user.go index b61af59..385c443 100644 --- a/internal/api/user.go +++ b/internal/api/user.go @@ -116,6 +116,8 @@ func (h *UserHandler) updateUser(ctx *gin.Context, u *model.User, updateUser mod // This method assumes that the requesting user has privileges. // @Summary Create a User // @Description Creates a new user +// @ID post-user +// @Tags User // @Accept json,mpfd // @Produce json // @Param name query string true "Name of the user" @@ -153,6 +155,8 @@ func (h *UserHandler) CreateUser(ctx *gin.Context) { // This method assumes that the requesting user has privileges. // @Summary Get Users // @Description Gets a list of all users +// @ID get-user +// @Tags User // @Accept json,mpfd // @Produce json // @Success 200 {object} []model.ExternalUser @@ -178,6 +182,8 @@ func (h *UserHandler) GetUsers(ctx *gin.Context) { // This method assumes that the requesting user has privileges. // @Summary Get User // @Description Gets single user +// @ID get-user-id +// @Tags User // @Accept json,mpfd // @Produce json // @Param id path integer true "The users id" @@ -198,6 +204,8 @@ func (h *UserHandler) GetUser(ctx *gin.Context) { // This method assumes that the requesting user has privileges. // @Summary Delete User // @Description Delete user +// @ID delete-user-id +// @Tags User // @Accept json,mpfd // @Produce json // @Param id path integer true "The users id" @@ -236,6 +244,8 @@ func (h *UserHandler) DeleteUser(ctx *gin.Context) { // cannot give themselves privileges. // @Summary Update User // @Description Update user information +// @ID put-user-id +// @Tags User // @Accept json,mpfd // @Produce json // @Param id path integer true "The users id"