package com.ruoyi.ibs.grid.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.ibs.grid.domain.dto.DeptUserSearchDTO;
import com.ruoyi.ibs.grid.domain.vo.GridUserVO;
import com.ruoyi.ibs.grid.service.SysUserDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @Author 吴凯程
 * @Date 2024/10/21
 **/
@Api(tags = "机构与客户经理查询")
@RestController
@RequestMapping("/dept/user")
public class SysUserDeptController extends BaseController {

    @Resource
    private SysUserDeptService sysUserDeptService;

    @ApiOperation("获取机构下的用户列表")
    @GetMapping("/list")
    public R<List<GridUserVO>> test(@Valid DeptUserSearchDTO deptUserSearchDTO) {
        return R.ok(sysUserDeptService.getUserListByDeptIds(deptUserSearchDTO.getDeptIds()));
    }

}
