notification

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) Delete

func (*Handler) Delete() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) MarkRead

func (*Handler) MarkRead() gin.HandlerFunc

func (*Handler) New

func (*Handler) New() gin.HandlerFunc

type RNotification

type RNotification struct {
	ID         uint      `json:"id"`
	UserID     uint      `json:"user_id"`
	Content    string    `json:"content"`
	IsRead     bool      `json:"is_read"`
	CreateTime time.Time `json:"create_time"`
}

func BindList

func BindList(notifications []cpt.Notification) []*RNotification

func BindNotification

func BindNotification(n *cpt.Notification) *RNotification

type ReqNew

type ReqNew struct {
	UserID  uint   `json:"user_id" validate:"required" binding:"required"`
	Content string `json:"content" validate:"required" binding:"required"`
}

type RespList

type RespList struct {
	Response
	Notifications []*RNotification `json:"notifications"`
}

type RespNew

type RespNew struct {
	Response
	NotificationID uint `json:"notification_id,omitempty"`
}

Jump to

Keyboard shortcuts

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