|
|
@@ -24,16 +24,17 @@ public class DashBoardMenuService {
|
|
|
@Autowired
|
|
|
private DashBoardMenuMapper dashBoardMenuMapper;
|
|
|
|
|
|
- public List<DashboardMenuRespDTO> list(){
|
|
|
- return getData(0);
|
|
|
+ public List<DashboardMenuRespDTO> list(String token){
|
|
|
+ int userId = Integer.parseInt(GetTokenDataUtil.getTokenData(token).get("id"));
|
|
|
+ return getData(userId, 0);
|
|
|
}
|
|
|
|
|
|
- private List<DashboardMenuRespDTO> getData(int id){
|
|
|
- List<DashboardMenuRespDTO> dashboardMenuRespDTOList = dashBoardMenuMapper.getMenuById(id);
|
|
|
+ private List<DashboardMenuRespDTO> getData(int userId, int id){
|
|
|
+ List<DashboardMenuRespDTO> dashboardMenuRespDTOList = dashBoardMenuMapper.getMenuById(userId, id);
|
|
|
if (!CollectionUtils.isEmpty(dashboardMenuRespDTOList)) {
|
|
|
for (DashboardMenuRespDTO dashboardMenuRespDTO : dashboardMenuRespDTOList) {
|
|
|
if ("menu".equals(dashboardMenuRespDTO.getType())) {
|
|
|
- dashboardMenuRespDTO.setChildren(getData(dashboardMenuRespDTO.getId()));
|
|
|
+ dashboardMenuRespDTO.setChildren(getData(userId, dashboardMenuRespDTO.getId()));
|
|
|
}
|
|
|
}
|
|
|
}
|