mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 10:12:59 +00:00
路由注册修改
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
type Dict struct{}
|
||||
|
||||
//字典列表
|
||||
func (c *Dict) DictList(r *ghttp.Request) {
|
||||
func (c *Dict) List(r *ghttp.Request) {
|
||||
var req *sys_dict_type.SelectPageReq
|
||||
//获取参数
|
||||
if err := r.Parse(&req); err != nil {
|
||||
@@ -35,7 +35,7 @@ func (c *Dict) DictList(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//添加字典
|
||||
func (c *Dict) DictAdd(r *ghttp.Request) {
|
||||
func (c *Dict) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_type.AddReq
|
||||
//获取参数
|
||||
@@ -56,7 +56,7 @@ func (c *Dict) DictAdd(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//修改字典
|
||||
func (c *Dict) DictEdit(r *ghttp.Request) {
|
||||
func (c *Dict) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_type.EditReq
|
||||
//获取参数
|
||||
@@ -82,7 +82,7 @@ func (c *Dict) DictEdit(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//字典数据列表
|
||||
func (c *Dict) DictDataList(r *ghttp.Request) {
|
||||
func (c *Dict) DataList(r *ghttp.Request) {
|
||||
var req *sys_dict_data.SelectDataPageReq
|
||||
//获取参数
|
||||
if err := r.Parse(&req); err != nil {
|
||||
@@ -103,7 +103,7 @@ func (c *Dict) DictDataList(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//添加数据字典
|
||||
func (c *Dict) DictDataAdd(r *ghttp.Request) {
|
||||
func (c *Dict) DataAdd(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_data.AddDataReq
|
||||
//获取参数
|
||||
@@ -127,7 +127,7 @@ func (c *Dict) DictDataAdd(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//修改字典数据
|
||||
func (c *Dict) DictDataEdit(r *ghttp.Request) {
|
||||
func (c *Dict) DataEdit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_data.EditDataReq
|
||||
//获取参数
|
||||
@@ -157,7 +157,7 @@ func (c *Dict) DictDataEdit(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//删除字典
|
||||
func (c *Dict) DictDelete(r *ghttp.Request) {
|
||||
func (c *Dict) Delete(r *ghttp.Request) {
|
||||
dictIds := r.GetInts("dictIds")
|
||||
if len(dictIds) == 0 {
|
||||
response.FailJson(true, r, "删除失败")
|
||||
@@ -170,7 +170,7 @@ func (c *Dict) DictDelete(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//删除字典数据
|
||||
func (c *Dict) DictDataDelete(r *ghttp.Request) {
|
||||
func (c *Dict) DataDelete(r *ghttp.Request) {
|
||||
dictCodes := r.GetInts("dictCode")
|
||||
if len(dictCodes) == 0 {
|
||||
response.FailJson(true, r, "删除失败")
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
type Params struct{}
|
||||
|
||||
//参数列表
|
||||
func (c *Params) ParamsList(r *ghttp.Request) {
|
||||
func (c *Params) List(r *ghttp.Request) {
|
||||
var req *sys_config.SelectPageReq
|
||||
//获取参数
|
||||
if err := r.Parse(&req); err != nil {
|
||||
@@ -33,7 +33,7 @@ func (c *Params) ParamsList(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//添加参数
|
||||
func (c *Params) ParamsAdd(r *ghttp.Request) {
|
||||
func (c *Params) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_config.AddReq
|
||||
//获取参数
|
||||
@@ -54,7 +54,7 @@ func (c *Params) ParamsAdd(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//修改参数
|
||||
func (c *Params) ParamsEdit(r *ghttp.Request) {
|
||||
func (c *Params) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_config.EditReq
|
||||
//获取参数
|
||||
@@ -81,7 +81,7 @@ func (c *Params) ParamsEdit(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
//删除参数
|
||||
func (c *Params) ParamsDelete(r *ghttp.Request) {
|
||||
func (c *Params) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
response.FailJson(true, r, "删除失败")
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package admin
|
||||
|
||||
type SurveillanceOnline struct{}
|
||||
|
||||
func (c *SurveillanceOnline) List() {
|
||||
|
||||
}
|
||||
+24
-10
@@ -3,6 +3,7 @@ package router
|
||||
import (
|
||||
"gfast/app/controller/admin"
|
||||
"github.com/gogf/gf/frame/g"
|
||||
"github.com/gogf/gf/net/ghttp"
|
||||
)
|
||||
|
||||
// 统一路由注册.
|
||||
@@ -10,14 +11,27 @@ func init() {
|
||||
s := g.Server()
|
||||
s.Use(MiddlewareCORS)
|
||||
group := s.Group("/")
|
||||
sysLoginGroup := group.Group("/sysLogin")
|
||||
sysLoginGroup.ALL("/public", new(admin.Public))
|
||||
systemGroup := group.Group("/system")
|
||||
systemGroup.Middleware(MiddlewareAuth) //后台权限验证
|
||||
systemGroup.ALL("/index", new(admin.Index))
|
||||
systemGroup.ALL("/auth", new(admin.Auth))
|
||||
systemGroup.ALL("/cms", new(admin.CmsMenu))
|
||||
systemGroup.ALL("/cms", new(admin.CmsNews))
|
||||
systemGroup.ALL("/config", new(admin.Dict))
|
||||
systemGroup.ALL("/config", new(admin.Params))
|
||||
group.Group("/sysLogin", func(group *ghttp.RouterGroup) {
|
||||
group.ALL("/public", new(admin.Public))
|
||||
})
|
||||
group.Group("/system", func(group *ghttp.RouterGroup) {
|
||||
group.Middleware(MiddlewareAuth) //后台权限验证
|
||||
group.ALL("/index", new(admin.Index))
|
||||
group.ALL("/auth", new(admin.Auth))
|
||||
|
||||
group.Group("/cms", func(group *ghttp.RouterGroup) {
|
||||
group.ALL("/menu", new(admin.CmsMenu))
|
||||
group.ALL("/news", new(admin.CmsNews))
|
||||
})
|
||||
|
||||
group.Group("/config", func(group *ghttp.RouterGroup) {
|
||||
group.ALL("/dict", new(admin.Dict))
|
||||
group.ALL("/params", new(admin.Params))
|
||||
})
|
||||
|
||||
group.Group("/surveillance", func(group *ghttp.RouterGroup) {
|
||||
group.ALL("/online", new(admin.SurveillanceOnline))
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user