package admin import ( "blazing/cool" "blazing/modules/config/service" "context" "github.com/gogf/gf/v2/frame/g" ) type BossController struct { *cool.Controller } func init() { var task_info_controller = &BossController{ &cool.Controller{ Prefix: "/admin/config/boss", Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"}, Service: service.NewBossService(), }, } // 注册路由 cool.RegisterController(task_info_controller) } type GetListReq struct { g.Meta `path:"/getlist" method:"POST"` Id uint32 `json:"id" v:"required#请选择要查询的数据"` } func (this *BossController) GetList(ctx context.Context, req *GetListReq) (res *cool.BaseRes, err error) { res = &cool.BaseRes{} res.Data = service.NewBossService().GetList(req.Id) return res, nil }