package com.tuoheng.admin.controller;

import com.tuoheng.admin.service.user.IUserService;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * 用户前端控制器
 *
 * @author wanjing
 * @team tuoheng
 * @date 2022-12-08
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * 根据部门id查询用户列表
     */
    @GetMapping("/list/dept/{deptId}")
    public JsonResult getListByDeptId(@PathVariable("deptId") String deptId) {
        log.info("进入根据部门id查询用户列表接口, deptId:{}", deptId);
        return userService.getListByDeptId(deptId);
    }

}
