role.api
2.5 KB
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
84
85
86
87
88
89
90
91
92
syntax = "v1"
info(
title: "天联鹰蜓"
desc: "天联鹰蜓"
author: "email"
email: "email"
version: "v1"
)
@server(
prefix: v1
group: role
middleware: LoginStatusCheck,LogRequest
jwt: SystemAuth
)
service Core {
@doc "角色详情"
@handler systemGetRole
get /system/role/:id (RoleGetRequest) returns (RoleGetResponse)
@doc "角色新增"
@handler systemSaveRole
post /system/role (RoleSaveRequest) returns (RoleSaveResponse)
@doc "角色删除"
@handler systemDeleteRole
delete /system/role/:id (RoleDeleteRequest) returns (RoleDeleteResponse)
@doc "角色更新"
@handler systemUpdateRole
put /system/role/:id (RoleUpdateRequest) returns (RoleUpdateResponse)
@doc "角色列表搜索"
@handler systemSearchRole
post /system/role/search (RoleSearchRequest) returns (RoleSearchResponse)
@doc "角色权限列表"
@handler systemGetRoleAuths
get /system/role/auths
}
type (
RoleGetRequest {
Id int64 `path:"id"`
}
RoleGetResponse {
Role RoleItem `json:"role"`
AuthList []Auth `json:"authList"`
}
RoleSaveRequest {
Role RoleItem `json:"role"`
}
RoleSaveResponse struct{}
RoleDeleteRequest {
Id int64 `path:"id"`
}
RoleDeleteResponse struct{}
RoleUpdateRequest {
Id int64 `path:"id"`
Role RoleItem `json:"role"`
}
RoleUpdateResponse struct{}
RoleSearchRequest {
Page int `json:"page,optional"`
Size int `json:"size,optional"`
Style string `json:"style,options=[simple,,full]"` // simple:只返回角色ID名称 full:所有字段都返回
}
RoleSearchResponse {
List []RoleItem `json:"list"`
Total int64 `json:"total"`
}
RoleItem {
Id int64 `json:"id,optional"` // 角色ID
CompanyId int64 `json:"companyId,optional,string,omitempty"` // 公司ID
Name string `json:"name"` // 角色名称
AuthIds []int64 `json:"authIds,optional,omitempty"` // 角色权限列表
AuthsDesc string `json:"authsDesc,optional,omitempty"` // 权限列表描述
UsersDesc string `json:"usersDesc,optional,omitempty"` // 用户列表描述
Remark string `json:"remark,optional,omitempty"` // 备注
Users []RoleUser `json:"users,optional,omitempty"` // 绑定的用户
UpdatedAt int64 `json:"updatedAt,optional,omitempty"` // 更新时间
}
RoleUser {
Id int64 `json:"id"`
Name string `json:"name"`
}
Auth {
Id int64 `json:"id"` // ID
Name string `json:"name"` // 名称
Code string `json:"code"` // 编码
}
)