|
@@ -127,6 +127,14 @@ public class QwMsgController extends BaseController
|
|
|
@GetMapping("/conversationList/{userId}")
|
|
@GetMapping("/conversationList/{userId}")
|
|
|
@ApiOperation("获取会话")
|
|
@ApiOperation("获取会话")
|
|
|
public R conversations(@PathVariable("userId")Long qwUserId){
|
|
public R conversations(@PathVariable("userId")Long qwUserId){
|
|
|
|
|
+ //校验归属:仅允许查看当前登录员工名下的企微用户会话
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ Long employeeUserId = loginUser.getUser().getUserId();
|
|
|
|
|
+ List<QwUser> qwUsers = qwMsgService.qwUserList(employeeUserId);
|
|
|
|
|
+ boolean owned = qwUsers.stream().anyMatch(qwUser -> qwUser.getId().equals(qwUserId));
|
|
|
|
|
+ if (!owned) {
|
|
|
|
|
+ return R.error("无权限访问该会话");
|
|
|
|
|
+ }
|
|
|
List<QwContactListVO> list = qwMsgService.selectQwConversationByUserId(qwUserId);
|
|
List<QwContactListVO> list = qwMsgService.selectQwConversationByUserId(qwUserId);
|
|
|
for (QwContactListVO contract:list) {
|
|
for (QwContactListVO contract:list) {
|
|
|
if(StringUtils.isEmpty(contract.getDisplayName())){
|
|
if(StringUtils.isEmpty(contract.getDisplayName())){
|