add system notiry

This commit is contained in:
LinkLeong
2022-09-13 07:22:24 +01:00
parent 9f938f65b1
commit 4776b76b16
4 changed files with 40 additions and 6 deletions

View File

@@ -244,6 +244,8 @@ func InitRouter() *gin.Engine {
v1NotifyGroup.Use()
{
v1NotifyGroup.POST("/:path", v1.PostNotifyMssage)
//merge to system
v1NotifyGroup.POST("", v1.PostSystemNotyfiy)
}
}
return r

View File

@@ -14,3 +14,9 @@ func PostNotifyMssage(c *gin.Context) {
service.MyService.Notify().SendNotify(path, message)
c.JSON(common_err.SUCCESS, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS)})
}
func PostSystemNotyfiy(c *gin.Context) {
message := make(map[string]interface{})
c.ShouldBind(&message)
service.MyService.Notify().SettingSystemTempData(message)
c.JSON(common_err.SUCCESS, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS)})
}