refactor creating busi group
This commit is contained in:
parent
d5050338f3
commit
caa33c29e9
|
@ -42,6 +42,7 @@ var (
|
|||
"The business group must retain at least one team": "业务组下要保留至少一个团队",
|
||||
"At least one team have rw permission": "业务组下至少要有一个具备读写权限的团队",
|
||||
"duplicate tagkey(%s)": "标签KEY(%s)重复了",
|
||||
"Failed to create BusiGroup(%s)": "创建业务(%s)组失败",
|
||||
}
|
||||
langDict = map[string]map[string]string{
|
||||
"zh": dict,
|
||||
|
|
|
@ -37,7 +37,18 @@ func busiGroupAdd(c *gin.Context) {
|
|||
}
|
||||
|
||||
username := c.MustGet("username").(string)
|
||||
ginx.NewRender(c).Message(models.BusiGroupAdd(f.Name, f.Members, username))
|
||||
ginx.Dangerous(models.BusiGroupAdd(f.Name, f.Members, username))
|
||||
|
||||
// 如果创建成功,拿着name去查,应该可以查到
|
||||
newbg, err := models.BusiGroupGet("name=?", f.Name)
|
||||
ginx.Dangerous(err)
|
||||
|
||||
if newbg == nil {
|
||||
ginx.NewRender(c).Message("Failed to create BusiGroup(%s)", f.Name)
|
||||
return
|
||||
}
|
||||
|
||||
ginx.NewRender(c).Data(newbg.Id, nil)
|
||||
}
|
||||
|
||||
func busiGroupPut(c *gin.Context) {
|
||||
|
|
Loading…
Reference in New Issue