This commit is contained in:
UlricQin 2021-11-29 19:56:36 +08:00
parent 4ddbba1400
commit c17ade64e1
1 changed files with 4 additions and 4 deletions

View File

@ -32,15 +32,15 @@ func alertSubscribeAdd(c *gin.Context) {
var f models.AlertSubscribe var f models.AlertSubscribe
ginx.BindJSON(c, &f) ginx.BindJSON(c, &f)
if f.GroupId <= 0 {
ginx.Bomb(http.StatusBadRequest, "group_id invalid")
}
username := c.MustGet("username").(string) username := c.MustGet("username").(string)
f.CreateBy = username f.CreateBy = username
f.UpdateBy = username f.UpdateBy = username
f.GroupId = ginx.UrlParamInt64(c, "id") f.GroupId = ginx.UrlParamInt64(c, "id")
if f.GroupId <= 0 {
ginx.Bomb(http.StatusBadRequest, "group_id invalid")
}
ginx.NewRender(c).Message(f.Add()) ginx.NewRender(c).Message(f.Add())
} }