Commit f240c990 by 水库浪子

根据员工id获取员工群

1 parent e201ceeb
package com.linkwechat.web.controller.wecom;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
......@@ -11,6 +12,7 @@ import com.linkwechat.wecom.service.IWeGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -40,6 +42,8 @@ public class WeGroupController extends BaseController {
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('customerManage:group:view')")
@GetMapping({"/members"})
public TableDataInfo list(WeGroupMember weGroupMember) {
......@@ -61,4 +65,19 @@ public class WeGroupController extends BaseController {
return AjaxResult.success(WeConstans.SYNCH_TIP);
}
/**
* 根据员工id获取员工相关群
* @param userId
* @return
*/
@PreAuthorize("@ss.hasPermi('customerManage:group:sync')")
@GetMapping({"/getGroupsByUserId/{userId}"})
public AjaxResult getGroupsByUserId(@PathVariable String userId){
return AjaxResult.success(weGroupService
.list(new LambdaQueryWrapper<WeGroup>().eq(WeGroup::getOwner,userId)));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!