Skip to content

Commit

Permalink
refactor: menu properties
Browse files Browse the repository at this point in the history
fix: bug in mysql group
  • Loading branch information
suyuan32 committed Sep 13, 2022
1 parent 5546470 commit 30fc5ea
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 18 deletions.
11 changes: 8 additions & 3 deletions api/api_desc/menu.api
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type (
// ID
ID uint32 `json:"id"`
// Menu ID | 菜单ID
MenuID uint32 `json:"menuID"`
MenuId uint32 `json:"menuId"`
// Data Type | 数据类型
DataType string `json:"dataType"`
// Key | 键
Expand All @@ -146,7 +146,7 @@ type (
// in: body
BaseInfo
// Menu ID | 菜单ID
MenuID uint32 `json:"menuID"`
MenuId uint32 `json:"menuId"`
// Data Type | 数据类型
DataType string `json:"dataType"`
// Key | 键
Expand Down Expand Up @@ -233,8 +233,13 @@ service core {
@handler createOrUpdateMenuParam
post /menu/param (CreateOrUpdateMenuParamReq) returns (SimpleMsg)

// swagger:route GET /menu/param/list menu getMenuParamListByMenuId
// swagger:route POST /menu/param/list menu getMenuParamListByMenuId
// Get menu extra parameters by menu ID | 获取某个菜单的额外参数列表
// Parameters:
// + name: body
// require: true
// in: body
// type: IDReq
// Responses:
// 200: MenuParamListByMenuIdResp
// 401: SimpleMsg
Expand Down
7 changes: 6 additions & 1 deletion api/internal/handler/menu/getmenuparamlistbymenuidhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ import (
"github.com/zeromicro/go-zero/rest/httpx"
)

// swagger:route GET /menu/param/list menu getMenuParamListByMenuId
// swagger:route POST /menu/param/list menu getMenuParamListByMenuId
// Get menu extra parameters by menu ID | 获取某个菜单的额外参数列表
// Parameters:
// + name: body
// require: true
// in: body
// type: IDReq
// Responses:
// 200: MenuParamListByMenuIdResp
// 401: SimpleMsg
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/menu/createorupdatemenuparamlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewCreateOrUpdateMenuParamLogic(ctx context.Context, svcCtx *svc.ServiceCon
func (l *CreateOrUpdateMenuParamLogic) CreateOrUpdateMenuParam(req *types.CreateOrUpdateMenuParamReq) (resp *types.SimpleMsg, err error) {
result, err := l.svcCtx.CoreRpc.CreateOrUpdateMenuParam(l.ctx, &core.CreateOrUpdateMenuParamReq{
Id: uint64(req.ID),
MenuId: uint64(req.MenuID),
MenuId: uint64(req.MenuId),
Type: req.DataType,
Key: req.Key,
Value: req.Value,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/menu/getmenuparamlistbymenuidlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (l *GetMenuParamListByMenuIdLogic) GetMenuParamListByMenuId(req *types.IDRe
for _, v := range result.Data {
resp.Data = append(resp.Data, types.MenuParamResp{
BaseInfo: types.BaseInfo{ID: uint(v.Id), CreatedAt: v.CreateAt, UpdatedAt: v.UpdateAt},
MenuID: uint32(v.MenuId),
MenuId: uint32(v.MenuId),
DataType: v.Type,
Key: v.Key,
Value: v.Value,
Expand Down
4 changes: 2 additions & 2 deletions api/internal/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ definitions:
description: Key | 键
type: string
x-go-name: Key
menuID:
menuId:
description: Menu ID | 菜单ID
format: uint32
type: integer
x-go-name: MenuID
x-go-name: MenuId
value:
description: Value | 值
type: string
Expand Down Expand Up @@ -397,7 +397,7 @@ definitions:
description: User's role ID | 用户的角色Id
format: uint64
type: integer
x-go-name: RoleID
x-go-name: RoleId
username:
description: User Name | 用户名
type: string
Expand Down Expand Up @@ -610,11 +610,11 @@ definitions:
description: Key | 键
type: string
x-go-name: Key
menuID:
menuId:
description: Menu ID | 菜单ID
format: uint32
type: integer
x-go-name: MenuID
x-go-name: MenuId
updatedAt:
description: Update date | 更新日期
format: int64
Expand Down Expand Up @@ -1162,9 +1162,15 @@ paths:
tags:
- menu
/menu/param/list:
get:
post:
description: Get menu extra parameters by menu ID | 获取某个菜单的额外参数列表
operationId: getMenuParamListByMenuId
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/IDReq'
type: object
responses:
"200":
$ref: '#/responses/MenuParamListByMenuIdResp'
Expand Down Expand Up @@ -1745,7 +1751,7 @@ responses:
key:
description: Key | 键
type: string
menuID:
menuId:
description: Menu ID | 菜单ID
format: uint32
type: integer
Expand Down
2 changes: 1 addition & 1 deletion docs/simple-admin/en/docs/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
simple-admin-core/

```shell
swagger generate spec --output=./core.yml
swagger generate spec --output=./core.yml --scan-models

swagger serve --no-open -F=swagger --port 36666 core.yaml
```
Expand Down
2 changes: 1 addition & 1 deletion docs/simple-admin/zh-cn/docs/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
simple-admin-core/

```shell
swagger generate spec --output=./core.yml
swagger generate spec --output=./core.yml --scan-models

swagger serve --no-open -F=swagger --port 36666 core.yaml
```
Expand Down
2 changes: 1 addition & 1 deletion rpc/internal/logic/getapilistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (l *GetApiListLogic) GetApiList(in *core.ApiPageReq) (*core.ApiListResp, er
}

if in.Group != "" {
db = db.Where("group = ?", in.Group)
db = db.Where("api_group = ?", in.Group)
}

result := db.Limit(int(in.Page.PageSize)).Offset(int((in.Page.Page - 1) * in.Page.PageSize)).
Expand Down

0 comments on commit 30fc5ea

Please sign in to comment.