mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-08 06:00:24 +08:00
增加消息管理
This commit is contained in:
22
internal/web/actions/default/messages/badge.go
Normal file
22
internal/web/actions/default/messages/badge.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package messages
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
type BadgeAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *BadgeAction) RunPost(params struct{}) {
|
||||
countResp, err := this.RPC().MessageRPC().CountUnreadMessages(this.AdminContext(), &pb.CountUnreadMessagesRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Data["count"] = countResp.Count
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user