notification

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var GetNotificationListByUserRouter = router.Handler(func(c router.Context) {
	var input Query

	c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response {
		return GetNotificationListByUser(helper.NewContext(&c), input)
	})
})

GetListRouter get list router

View Source
var GetRouter = router.Handler(func(c router.Context) {
	id := c.Param("id")

	c.ResponseFunc(nil, func() schema.Response {
		return Get(helper.NewContext(&c), id)
	})
})

GetRouter get notification detail router

View Source
var MarkReadBatchRouter = router.Handler(func(c router.Context) {
	var params MarkReadBatchParams

	c.ResponseFunc(c.ShouldBindJSON(&params), func() schema.Response {
		return MarkReadBatch(helper.NewContext(&c), params.IDs)
	})
})
View Source
var ReadRouter = router.Handler(func(c router.Context) {
	notificationID := c.Param("id")

	c.ResponseFunc(nil, func() schema.Response {
		return MarkRead(helper.NewContext(&c), notificationID)
	})
})

Functions

func Get

func Get(c helper.Context, id string) (res schema.Response)

Get notification detail

func GetNotificationListByUser

func GetNotificationListByUser(c helper.Context, query Query) (res schema.Response)

GetList get notification list

func MarkRead

func MarkRead(c helper.Context, notificationID string) (res schema.Response)

标记已读

func MarkReadBatch added in v0.7.0

func MarkReadBatch(c helper.Context, notificationIDs []string) (res schema.Response)

批量标记已读

Types

type MarkReadBatchParams added in v0.7.0

type MarkReadBatchParams struct {
	IDs []string `json:"ids"`
}

type Query

type Query struct {
	schema.Query
}

Query params

Jump to

Keyboard shortcuts

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