message

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

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 GetStatusRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return Status(helper.NewContext(&c))
	})
})

GetRouter get Message detail router

View Source
var ReadAllRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return MarkAllRead(helper.NewContext(&c))
	})
})
View Source
var ReadBatchRouter = router.Handler(func(c router.Context) {
	var input MarkBatchParams
	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return MarkBatchRead(helper.NewContext(&c), input)
	})
})
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, query Query) (res schema.Response)

用户获取自己的消息列表

func MarkAllRead added in v0.5.4

func MarkAllRead(c helper.Context) (res schema.Response)

func MarkBatchRead added in v0.5.4

func MarkBatchRead(c helper.Context, input MarkBatchParams) (res schema.Response)

func MarkRead

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

func Status added in v0.5.4

func Status(c helper.Context) (res schema.Response)

Types

type MarkBatchParams added in v0.5.4

type MarkBatchParams struct {
	IDs []string `json:"ids" validate:"required" comment:"ID组"`
}

type Query

type Query struct {
	schema.Query
	Status *model.MessageStatus `json:"status" url:"status" validate:"omitempty,number" comment:"状态"`
	Read   *bool                `json:"read" url:"read" validate:"omitempty" comment:"是否已读"`
}

Jump to

Keyboard shortcuts

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