package com.diagbot.client;

import com.diagbot.client.hystrix.UserServiceHystrix;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.UserOrgDTO;
import com.diagbot.entity.Token;
import com.diagbot.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;


/**
 * @Description: 调用用户服务
 * @author: gaodm
 * @time: 2018/8/6 9:52
 */
@FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
public interface UserServiceClient {

    @PostMapping(value = "/user/getUserAuthStatus")
    RespDTO<User> getUserAuthStatus(@RequestBody Long userId);

    @PostMapping(value = "/user/getUserAllInfo")
    RespDTO<List<User>> getUserAllInfo();

    @PostMapping(value = "/user/getUserAndOrg")
    RespDTO<Map<Long, UserOrgDTO>> getUserAndOrg(@RequestBody List<Long> userIds);

    @PostMapping(value = "/user/getUserByOrgName")
    RespDTO<List<Long>> getUserByOrgName(@RequestBody String orgName);
    
    @PostMapping(value = "/userAuthentication/getAuthInfoCount")
    RespDTO<List<Integer>> getAuthInfoCount(@RequestBody Long userId);

    @PostMapping("/user/verifyToken")
    RespDTO<Boolean> verifyToken(@RequestBody Token token);

}



