message

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 10 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.

Index

Constants

This section is empty.

Variables

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

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

	c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response {
		return GetMessageListByUser(helper.NewContext(&c), input)
	})
})
View Source
var GetRouter = router.Handler(func(c router.Context) {
	id := c.Param("message_id")

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

GetRouter get Message detail router

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

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

Functions

func DeleteByUser

func DeleteByUser(c helper.Context, messageId string) (res schema.Response)

func DeleteMessageById

func DeleteMessageById(id string)

func Get

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

Get Message detail

func GetMessageListByUser

func GetMessageListByUser(c helper.Context, input Query) (res schema.Response)

用户获取自己的消息列表

func MarkRead

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

Types

type Query

type Query struct {
	schema.Query
	Status *model.MessageStatus `json:"status" form:"status"`
	Read   *bool                `json:"read" form:"read"`
}

type QueryAdmin

type QueryAdmin struct {
	Query
	Uid *string `json:"uid" form:"uid"` // 指定某个用户ID
}

Jump to

Keyboard shortcuts

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