Documentation ¶
Overview ¶
Copyright (c) 2021 Amirhossein Movahedi (@qolzam)
This software is released under the MIT License. https://opensource.org/licenses/MIT
Index ¶
- func CheckNotifyEmailHandle(c *fiber.Ctx) error
- func CreateNotificationHandle(c *fiber.Ctx) error
- func DeleteNotificationByUserIdHandle(c *fiber.Ctx) error
- func DeleteNotificationHandle(c *fiber.Ctx) error
- func GetNotificationHandle(c *fiber.Ctx) error
- func GetNotificationsByUserIdHandle(c *fiber.Ctx) error
- func SeenAllNotificationsHandle(c *fiber.Ctx) error
- func SeenNotificationHandle(c *fiber.Ctx) error
- func UpdateNotificationHandle(c *fiber.Ctx) error
- type NotificationAction
- type UserInfoInReq
- type UserProfileQueryModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNotifyEmailHandle ¶
func CheckNotifyEmailHandle(c *fiber.Ctx) error
CheckNotifyEmailHandle godoc @Summary Check and send notification emails @Description Checks the latest notifications and sends emails to the users if necessary @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Success 200 {string} string "OK" @Failure 500 {object} utils.TelarError @Router /check [post]
func CreateNotificationHandle ¶
func CreateNotificationHandle(c *fiber.Ctx) error
CreateNotificationHandle godoc @Summary Create a new notification @Description Handles creating a new notification and sending it to the user @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param body body models.CreateNotificationModel true "Create Notification Model" @Success 200 {object} object{objectId=string} @Failure 400 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router / [post]
func DeleteNotificationByUserIdHandle ¶
func DeleteNotificationByUserIdHandle(c *fiber.Ctx) error
DeleteNotificationHandle godoc @Summary Delete a notification @Description Handles deleting a notification by its ID @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param notificationId path string true "Notification ID" @Success 200 {string} string "OK" @Failure 400 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router /id/{notificationId} [delete]
func DeleteNotificationHandle ¶
func DeleteNotificationHandle(c *fiber.Ctx) error
DeleteNotificationHandle godoc @Summary Delete a notification @Description Handles deleting a notification by its ID @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param notificationId path string true "Notification ID" @Success 200 {string} string "OK" @Failure 400 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router /id/{notificationId} [delete]
func GetNotificationHandle ¶
func GetNotificationHandle(c *fiber.Ctx) error
GetNotificationHandle godoc @Summary Get a notification @Description Handles retrieving a notification by its ID @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param notificationId path string true "Notification ID" @Success 200 {object} models.NotificationModel @Failure 400 {object} utils.TelarError @Failure 401 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router /{notificationId} [get]
func GetNotificationsByUserIdHandle ¶
func GetNotificationsByUserIdHandle(c *fiber.Ctx) error
GetNotificationsByUserIdHandle godoc @Summary Get notifications by user ID @Description Handles querying notifications by user ID @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param page query int false "Page number" @Param limit query int false "Items per page" @Success 200 {array} dto.Notification @Failure 400 {object} utils.TelarError @Failure 401 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router / [get]
func SeenAllNotificationsHandle ¶
func SeenAllNotificationsHandle(c *fiber.Ctx) error
@Summary Set all notifications as seen @Description Set all notifications as seen by current user @Tags notifications @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Success 200 @Failure 500 {object} utils.TelarError "Error happened while creating notificationService!" @Failure 401 {object} utils.TelarError "Can not get current user" @Failure 500 {object} utils.TelarError "Can not update notification!" @Router /seenall [put]
func SeenNotificationHandle ¶
func SeenNotificationHandle(c *fiber.Ctx) error
@Summary Set notification as seen @Description Set notification as seen by current user @Tags notifications @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param notificationId path string true "Notification ID" @Success 200 @Failure 400 {object} utils.TelarError "Notification Id is required!" @Failure 400 {object} utils.TelarError "Can not parse UUID!" @Failure 500 {object} utils.TelarError "Error happened while creating notificationService!" @Failure 401 {object} utils.TelarError "Can not get current user" @Failure 500 {object} utils.TelarError "Can not update notification!" @Router /seen/{notificationId} [put]
func UpdateNotificationHandle ¶
func UpdateNotificationHandle(c *fiber.Ctx) error
UpdateNotificationHandle godoc @Summary Update a notification @Description Handles updating a notification by its ID @Tags Notification @Accept json @Produce json @Security JWT @Param Authorization header string true "Authentication" default(Bearer <Add_token_here>) @Param body body models.NotificationModel true "Notification Model" @Success 200 {string} string "OK" @Failure 400 {object} utils.TelarError @Failure 401 {object} utils.TelarError @Failure 500 {object} utils.TelarError @Router / [put]
Types ¶
type NotificationAction ¶
type NotificationAction struct { Type string `json:"type"` Payload interface{} `json:"payload"` }