class RoleService extends AbstractRoleService {

    @Override
    public QueryResult<Role> query(int page, int size, Role model) {
        QueryResult<Role> result = super.query(page, size, model);
        for (Role role : result.getList()) {
            List<Menu> menus = role.getMenus();
            menus = TreeEntityUtil.flatData(menus);
            role.setMenus(menus);
        }
        return result;
    }

}