feat(role): Update RoleResponse to include detailed menu information with IconUrl and Url
Deploy Application / deploy (push) Successful in 22s
Details
Deploy Application / deploy (push) Successful in 22s
Details
This commit is contained in:
parent
8ff66d3775
commit
e83a114390
|
|
@ -96,7 +96,14 @@ type RoleResponse struct {
|
||||||
// ClientID string `json:"client_id"`
|
// ClientID string `json:"client_id"`
|
||||||
Client pkgdto.IdNameResponse `json:"client"`
|
Client pkgdto.IdNameResponse `json:"client"`
|
||||||
Permissions []RolePermissionsResponse `json:"permissions,omitempty"`
|
Permissions []RolePermissionsResponse `json:"permissions,omitempty"`
|
||||||
Menus []pkgdto.IdNameResponse `json:"menus,omitempty"`
|
Menus []RoleMenuResponse `json:"menus,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type RoleMenuResponse struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
IconUrl string `json:"icon_url"`
|
||||||
|
Url string `json:"url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RolePermissionsResponse struct {
|
type RolePermissionsResponse struct {
|
||||||
|
|
|
||||||
|
|
@ -479,11 +479,13 @@ func ToRoleResponse(role entities.M_Role) dto.RoleResponse {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var menus []pkgdto.IdNameResponse
|
var menus []dto.RoleMenuResponse
|
||||||
for _, m := range role.Menus {
|
for _, m := range role.Menus {
|
||||||
menus = append(menus, pkgdto.IdNameResponse{
|
menus = append(menus, dto.RoleMenuResponse{
|
||||||
ID: m.ID.String(),
|
ID: m.ID.String(),
|
||||||
Name: m.Name,
|
Name: m.Name,
|
||||||
|
IconUrl: m.IconUrl,
|
||||||
|
Url: m.Url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue