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: 14 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.

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 CreateRouter = router.Handler(func(c router.Context) {
	var (
		input CreateParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return Create(helper.NewContext(&c), input)
	})
})
View Source
var DeleteRouter = router.Handler(func(c router.Context) {
	id := c.Param("id")

	c.ResponseFunc(nil, func() schema.Response {
		return Delete(helper.NewContext(&c), id)
	})
})
View Source
var GetNotificationListByAdminRouter = router.Handler(func(c router.Context) {
	var (
		input Query
	)

	c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response {
		return GetNotificationListByAdmin(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 UpdateRouter = router.Handler(func(c router.Context) {
	var (
		input UpdateParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return Update(helper.NewContext(&c), c.Param("id"), input)
	})
})

Functions

func Create

func Create(c helper.Context, input CreateParams) (res schema.Response)

func Delete

func Delete(c helper.Context, notificationId string) (res schema.Response)

func DeleteNotificationById

func DeleteNotificationById(id string)

func DeleteNotificationMarkById

func DeleteNotificationMarkById(id string)

func Get

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

Get notification detail

func GetNotificationListByAdmin

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

GetList get notification list

func Update

func Update(c helper.Context, notificationId string, input UpdateParams) (res schema.Response)

Types

type CreateParams

type CreateParams struct {
	Title   string  `json:"title" validate:"required,max=32" comment:"标题"`  // 公告标题
	Content string  `json:"content" validate:"required" comment:"内容"`       // 公告内容
	Note    *string `json:"note" validate:"omitempty,max=255" comment:"备注"` // 备注
}

type Query

type Query struct {
	schema.Query
}

Query params

type UpdateParams

type UpdateParams struct {
	Title   *string `json:"title" validate:"omitempty,max=32" comment:"标题"` // 公告标题
	Content *string `json:"content" validate:"omitempty" comment:"内容"`      // 公告内容
	Note    *string `json:"note" validate:"omitempty,max=255" comment:"备注"` // 备注
}

Jump to

Keyboard shortcuts

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