From 8341eda1fa8d33f90e35eed76a091bfff6dc1fa8 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Fri, 10 Apr 2020 14:15:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9Brestful=E7=A4=BA=E4=BE=8B=20?= =?UTF-8?q?=E5=8F=82=E8=80=83=20customer=20=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=88=E8=B5=84=E6=BA=90=E7=A4=BA=E4=BE=8B=EF=BC=89?= =?UTF-8?q?=E7=89=88=E5=9D=97=20=E6=B6=89=E5=8F=8A=E5=88=B0=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=8F=98=E5=8A=A8=20=E8=AF=B7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=20sys=5Fapi=E5=92=8Ccasbin=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-zh_CN.md | 3 ++- README.md | 2 ++ server/service/sys_api.go | 4 ++++ web/src/view/superAdmin/api/api.vue | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 7957bec5..c2bad299 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -179,7 +179,8 @@ go run main.go; - api管理:不同用户可调用的api接口的权限不同。 - 配置管理:配置文件可前台修改(测试环境不开放此功能)。 - 富文本编辑器:MarkDown编辑器功能嵌入。 -- 条件搜索:增加条件搜索示例。 +- 条件搜索:增加条件搜索示例。 +- restful示例:参考客户管理功能,customer组api。 ``` 前端文件参考: src\view\superAdmin\api\api.vue 后台文件参考: model\dnModel\api.go diff --git a/README.md b/README.md index eb09d47e..a97469af 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,8 @@ go run main.go; - Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function). - Rich text editor: Embed MarkDown editor function. - Conditional search: Add an example of conditional search. +- Restful example: refer to customer management function and apidcustomer group. + ``` fontend code file: src\view\superAdmin\api\api.vue backend code file: model\dnModel\api.go diff --git a/server/service/sys_api.go b/server/service/sys_api.go index cec3ab92..71e25897 100644 --- a/server/service/sys_api.go +++ b/server/service/sys_api.go @@ -61,6 +61,10 @@ func GetAPIInfoList(api model.SysApi, info request.PageInfo, order string, desc db = db.Where("method = ?", api.Method) } + if api.ApiGroup != "" { + db = db.Where("api_group = ?", api.ApiGroup) + } + err = db.Find(&apiList).Count(&total).Error if err != nil { diff --git a/web/src/view/superAdmin/api/api.vue b/web/src/view/superAdmin/api/api.vue index 6925a37d..98d383fc 100644 --- a/web/src/view/superAdmin/api/api.vue +++ b/web/src/view/superAdmin/api/api.vue @@ -8,6 +8,9 @@ + + +