package com.fjhx.feign;

import com.fjhx.service.IUserService;
import org.springblade.core.tool.api.R;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@ApiIgnore
@RestController
public class UserClient implements IUserClient {

    @Autowired
    private IUserService userService;

    @PostMapping(GET_USER_LIST_BY_ROLE_ID_LIST)
    @Override
    public R<List<User>> getUserListByRoleIdList(List<Long> roleIdList) {
        List<User> result = userService.getUserListByRoleIdList(roleIdList);
        return R.success(result);
    }

    @PostMapping(GET_USER_LIST_BY_DEPT_ID_LIST)
    @Override
    public R<List<User>> getUserListByDeptIdList(List<Long> deptIdList) {
        List<User> result = userService.getUserListByDeptIdList(deptIdList);
        return R.success(result);
    }

}
