feat: ue事件推入ws

This commit is contained in:
TsMask
2024-01-26 17:35:17 +08:00
parent c3b76462b1
commit 37ebadd487
2 changed files with 15 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ import (
"ems.agt/lib/global"
"ems.agt/lib/log"
"ems.agt/lib/services"
wsService "ems.agt/src/modules/ws/service"
"github.com/gin-gonic/gin"
)
@@ -17,12 +18,12 @@ var (
)
type UEEvent struct {
NeType string `json:"-" xorm:"ne_type"`
NeName string `json:"-" xorm:"ne_name"`
RmUID string `json:"-" xorm:"rm_uid"`
Timestamp int `json:"-" xorm:"timestamp"`
EventType string `json:"-" xorm:"event_type"`
EventJson map[string]any `json:"-" xorm:"event_json"`
NeType string `json:"neType" xorm:"ne_type"`
NeName string `json:"neName" xorm:"ne_name"`
RmUID string `json:"rmUID" xorm:"rm_uid"`
Timestamp int `json:"timestamp" xorm:"timestamp"`
EventType string `json:"eventType" xorm:"event_type"`
EventJson map[string]any `json:"eventJSON" xorm:"event_json"`
}
func PostUEEventFromAMF(c *gin.Context) {
@@ -61,5 +62,8 @@ func PostUEEventFromAMF(c *gin.Context) {
return
}
// 推送到ws订阅组
wsService.NewWSSendImpl.ByGroupID(wsService.GROUP_UE, ueEvent)
services.ResponseStatusOK204NoContent(c.Writer)
}