游戏商户后台添加分组的页面逻辑

This commit is contained in:
kongyuebin
2021-05-17 22:15:59 +08:00
parent 8bd7067c2f
commit f7a7eb737d
12 changed files with 380 additions and 44 deletions

View File

@@ -0,0 +1,53 @@
package controllers
import (
"legend/controllers/base"
"legend/service"
)
type GroupController struct {
base.BasicController
}
func (c *GroupController) AddGroup() {
groupName := c.GetString("groupName")
se := new(service.GroupService)
resp := se.GroupAdd(groupName)
c.Data["json"] = resp
_ = c.ServeJSON()
}
func (c *GroupController) ListGroup() {
page, _ := c.GetInt("page")
limit, _ := c.GetInt("limit")
se := new(service.GroupService)
list := se.GroupList(page, limit)
c.Data["json"] = list
_ = c.ServeJSON()
}
func (c *GroupController) DeleteGroup() {
uid := c.GetString("uid")
se := new(service.GroupService)
resp := se.GroupDelete(uid)
c.Data["json"] = resp
_ = c.ServeJSON()
}
func (c *GroupController) EditGroup() {
uid := c.GetString("uid")
groupName := c.GetString("groupName")
se := new(service.GroupService)
resp := se.GroupEdit(uid, groupName)
c.Data["json"] = resp
_ = c.ServeJSON()
}