postbox

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusInit   = "INIT"
	StatusOpened = "OPENED"
)
View Source
const (
	ResourceQueryNotification  = "postbox:notification:query"
	ResourceCreateNotification = "postbox:notification:create"
)

Variables

View Source
var (
	ErrUserNotFound = miso.NewErrf("User not found").WithCode(api.CodeUserNotFound)
)
View Source
var (
	PostboxPool *miso.AsyncPool
)

Functions

func BootstrapServer

func BootstrapServer(args []string)

func CountNotification

func CountNotification(rail miso.Rail, db *gorm.DB, user common.User) (int, error)

func CountNotificationEp

func CountNotificationEp(inb *miso.Inbound) (any, error)

func CreateNotification

func CreateNotification(rail miso.Rail, db *gorm.DB, req api.CreateNotificationReq, user common.User) error

func CreateNotificationEp

func CreateNotificationEp(inb *miso.Inbound, req api.CreateNotificationReq) (any, error)

func NotifiNo

func NotifiNo() string

func OpenAllNotification added in v0.0.4

func OpenAllNotification(rail miso.Rail, db *gorm.DB, user common.User) error

func OpenAllNotificationEp added in v0.0.4

func OpenAllNotificationEp(inb *miso.Inbound) (any, error)

func OpenNotification

func OpenNotification(rail miso.Rail, db *gorm.DB, req OpenNotificationReq, user common.User) error

func OpenNotificationEp

func OpenNotificationEp(inb *miso.Inbound, req OpenNotificationReq) (any, error)

func QueryNotification

func QueryNotification(rail miso.Rail, db *gorm.DB, req QueryNotificationReq, user common.User) (miso.PageRes[ListedNotification], error)

func QueryNotificationEp

func QueryNotificationEp(inb *miso.Inbound, req QueryNotificationReq) (any, error)

func RegisterRoutes

func RegisterRoutes(rail miso.Rail) error

func SaveNotification

func SaveNotification(rail miso.Rail, db *gorm.DB, req SaveNotifiReq, user common.User) error

Types

type ListedNotification

type ListedNotification struct {
	Id         int
	NotifiNo   string
	Title      string
	Message    string
	Status     string
	CreateTime miso.ETime
}

type OpenNotificationReq

type OpenNotificationReq struct {
	NotifiNo string `valid:"notEmpty"`
}

type QueryNotificationReq

type QueryNotificationReq struct {
	Page   miso.Paging
	Status string
}

type SaveNotifiReq

type SaveNotifiReq struct {
	UserNo  string
	Title   string
	Message string
}

Jump to

Keyboard shortcuts

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