-
Notifications
You must be signed in to change notification settings - Fork 0
/
sys_role.go
83 lines (68 loc) · 2.21 KB
/
sys_role.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* @desc:角色api
* @url:www.ddsiot.cn
* @Author: dwx<dwxdyx@qq.com>
* @Date: 2022/5/30 9:16
* @Ref: 参考于https://gitee.com/tiger1103/gfast/
*/
package system
import (
commonApi "github.com/morgeq/iotfast/api/v1/common"
"github.com/morgeq/iotfast/internal/app/system/model"
"github.com/morgeq/iotfast/internal/app/system/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type RoleListReq struct {
g.Meta `path:"/role/list" tags:"角色管理" method:"get" summary:"角色列表"`
RoleName string `p:"roleName"` //参数名称
Status string `p:"roleStatus"` //状态
commonApi.PageReq
}
type RoleListRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*entity.SysRole `json:"list"`
}
type RoleGetParamsReq struct {
g.Meta `path:"/role/getParams" tags:"角色管理" method:"get" summary:"角色编辑参数"`
}
type RoleGetParamsRes struct {
g.Meta `mime:"application/json"`
Menu []*model.SysAuthRuleInfoRes `json:"menu"`
}
type RoleAddReq struct {
g.Meta `path:"/role/add" tags:"角色管理" method:"post" summary:"添加角色"`
Name string `p:"name" v:"required#角色名称不能为空"`
Status uint `p:"status" `
ListOrder uint `p:"listOrder" `
Remark string `p:"remark" `
MenuIds []uint `p:"menuIds"`
}
type RoleAddRes struct {
}
type RoleGetReq struct {
g.Meta `path:"/role/get" tags:"角色管理" method:"get" summary:"获取角色信息"`
Id uint `p:"id" v:"required#角色id不能为空""`
}
type RoleGetRes struct {
g.Meta `mime:"application/json"`
Role *entity.SysRole `json:"role"`
MenuIds []int `json:"menuIds"`
}
type RoleEditReq struct {
g.Meta `path:"/role/edit" tags:"角色管理" method:"put" summary:"修改角色"`
Id int64 `p:"id" v:"required#角色id必须"`
Name string `p:"name" v:"required#角色名称不能为空"`
Status uint `p:"status" `
ListOrder uint `p:"listOrder" `
Remark string `p:"remark" `
MenuIds []uint `p:"menuIds"`
}
type RoleEditRes struct {
}
type RoleDeleteReq struct {
g.Meta `path:"/role/delete" tags:"角色管理" method:"delete" summary:"删除角色"`
Ids []int64 `p:"ids" v:"required#角色id不能为空"`
}
type RoleDeleteRes struct {
}