Commit 3579affe by wangxin

消息数量接口

parent e0229eb9
...@@ -33,4 +33,7 @@ public interface SystemMailboxClients { ...@@ -33,4 +33,7 @@ public interface SystemMailboxClients {
@GetMapping("/systemMailbox/selectMyPage") @GetMapping("/systemMailbox/selectMyPage")
Page<SystemMailboxParamVo> selectMyPage(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type); Page<SystemMailboxParamVo> selectMyPage(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type);
}
@GetMapping("/systemMailbox/hasPermission")
Boolean hasPermission();
}
\ No newline at end of file
...@@ -46,4 +46,15 @@ public class SystemMailboxController { ...@@ -46,4 +46,15 @@ public class SystemMailboxController {
public Page<SystemMailboxParamVo> selectMyPage(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type){ public Page<SystemMailboxParamVo> selectMyPage(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type){
return systemMailboxService.selectMyPage(pageNo,pageSize, type); return systemMailboxService.selectMyPage(pageNo,pageSize, type);
} }
}
@GetMapping("hasPermission")
public Boolean hasPermission(){
Page<SystemMailboxParamVo> page = systemMailboxService.selectMyPage(1, 1, 2);
// 如果能正常获取到数据且total大于0,说明用户有权限
if (page != null && page.getTotal() > 0) {
return true;
}
// 如果total为0,说明用户没有权限查看信箱
return false;
}
}
\ No newline at end of file
...@@ -24,5 +24,6 @@ public interface SystemMailboxService extends IService<SystemMailbox> { ...@@ -24,5 +24,6 @@ public interface SystemMailboxService extends IService<SystemMailbox> {
Boolean removeById(Long id); Boolean removeById(Long id);
Page<SystemMailboxParamVo> selectMyPage(Integer pageNo, Integer pageSize, Integer type); Page<SystemMailboxParamVo> selectMyPage(Integer pageNo, Integer pageSize, Integer type);
} Boolean hasPermission();
}
\ No newline at end of file
...@@ -166,4 +166,15 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -166,4 +166,15 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
page.setRecords(this.baseMapper.selectMyPage(accountId, roleType, type, pageNo, pageSize)); page.setRecords(this.baseMapper.selectMyPage(accountId, roleType, type, pageNo, pageSize));
return page; return page;
} }
}
@Override
public Boolean hasPermission() {
Page<SystemMailboxParamVo> page = selectMyPage(1, 1, 2);
// 如果能正常获取到数据且total大于0,说明用户有权限
if (page != null && page.getTotal() > 0) {
return true;
}
// 如果total为0,说明用户没有权限查看信箱
return false;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment