package com.usky.system;


import com.usky.common.core.bean.ApiResult;
import com.usky.system.domain.SysUser;
import com.usky.system.domain.SysUserVO;
import com.usky.system.factory.RemoteUserFallbackFactory;
import com.usky.system.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteUserService", value = "usky-system", fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @GetMapping("/user/info/{username}")
    public ApiResult<LoginUser> getUserInfo(@PathVariable("username") String username);

    /**
     * 注册用户信息
     *
     * @param sysUser 用户信息
     * @return 结果
     */
    @PostMapping("/user/register")
    public ApiResult<Boolean> registerUserInfo(@RequestBody SysUserVO sysUser);

    /**
     * 用户列表查询
     * @return
     */
    @GetMapping("/user/userList")
    public ApiResult<List<SysUser>> userList();

    /**
     * 根据ID集合查询用户列表
     * @return
     */
    @PostMapping("/user/userByIdList")
    public ApiResult<List<SysUser>> userByIdList(List<Integer> userIds);

    /**
     * 所有用户列表查询
     * @return
     */
    @GetMapping("/user/userAllList")
    public ApiResult<List<SysUser>> userAllList();
}
