Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllowedNotificationsSortFields = []string{dtos.NameField, dtos.DescriptionFieldName, dtos.OccurrenceFieldName, dtos.LevelFieldName, dtos.OriginFieldName}
View Source
var DefaultSortingRequest = &sorting.Request{ SortColumn: dtos.OccurrenceFieldName, SortDirection: sorting.DirectionDescending, }
View Source
var NotificationsRequestOptions = []filter.RequestOption{ { Name: web.NameFilterRequestName, Control: filter.RequestOptionType{ Type: filter.ControlTypeString, }, Operators: filter.SortedReadableValues( web.OperatorEqual, web.OperatorContains, web.OperatorBeginsWith, ), MultiSelect: true, }, { Name: web.DescriptionFilterRequestName, Control: filter.RequestOptionType{ Type: filter.ControlTypeString, }, Operators: filter.SortedReadableValues( web.OperatorEqual, web.OperatorContains, web.OperatorBeginsWith, ), MultiSelect: true, }, { Name: web.OriginFilterRequestName, Control: filter.RequestOptionType{ Type: filter.ControlTypeString, }, Operators: filter.SortedReadableValues( web.OperatorEqual, web.OperatorContains, web.OperatorBeginsWith, ), MultiSelect: true, }, { Name: web.OccurrenceFilterRequestName, Control: filter.RequestOptionType{ Type: filter.ControlTypeDateTime, }, Operators: filter.SortedReadableValues( web.OperatorBefore, web.OperatorAfter, ), }, { Name: web.LevelFilterRequestName, Control: filter.RequestOptionType{ Type: filter.ControlTypeEnum, }, Operators: filter.SortedReadableValues( web.OperatorEqual, ), Values: []string{"info", "warning", "error"}, MultiSelect: true, }, }
Functions ¶
func AddNotificationController ¶ added in v0.12.0
func AddNotificationController( router gin.IRouter, notificationService notificationservice.NotificationService, auth gin.HandlerFunc, )
Types ¶
type NotificationController ¶
type NotificationController struct {
// contains filtered or unexported fields
}
func (*NotificationController) CreateNotification ¶
func (c *NotificationController) CreateNotification(gc *gin.Context)
CreateNotification
@Summary Create Notification
@Description Create a new notification. It will always be stored by the notification service and it will possibly also trigger actions like sending mails, depending on the cofigured rules.
@Tags notification
@Accept json
@Produce json
@Security KeycloakAuth
@Param Notification body models.Notification true "notification to add"
@Success 201 {object} query.ResponseWithMetadata[models.Notification]
@Header all {string} api-version "API version"
@Router /notifications [post]
func (*NotificationController) GetOptions ¶
func (c *NotificationController) GetOptions(gc *gin.Context)
GetOptions
@Summary Notification filter options
@Description Get filter options for listing notifications
@Tags notification
@Produce json
@Security KeycloakAuth
@Success 200 {object} query.ResponseWithMetadata[[]query.FilterOption]
@Header all {string} api-version "API version"
@Router /notifications/options [get]
func (*NotificationController) ListNotifications ¶
func (c *NotificationController) ListNotifications(gc *gin.Context)
ListNotifications
@Summary List Notifications
@Description Returns a list of notifications matching the provided filters
@Tags notification
@Accept json
@Produce json
@Security KeycloakAuth
@Param MatchCriterias body query.ResultSelector true "filters, paging and sorting"
@Success 200 {object} query.ResponseListWithMetadata[models.Notification]
@Header all {string} api-version "API version"
@Router /notifications [put]
Click to show internal directories.
Click to hide internal directories.