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"`
|
||||
Client pkgdto.IdNameResponse `json:"client"`
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
menus = append(menus, pkgdto.IdNameResponse{
|
||||
ID: m.ID.String(),
|
||||
Name: m.Name,
|
||||
menus = append(menus, dto.RoleMenuResponse{
|
||||
ID: m.ID.String(),
|
||||
Name: m.Name,
|
||||
IconUrl: m.IconUrl,
|
||||
Url: m.Url,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue