package com.tofly.base.api.feign;

import com.tofly.base.api.dto.UserInfo;
import com.tofly.base.api.feign.factory.BaseLogServiceFallbackFactory;
import com.tofly.common.core.constant.SecurityConstants;
import com.tofly.common.core.entity.ResultRespone;
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.RequestHeader;

/**
 * @author Administrator
 * @date 2019/9/6  15:50
 */
@FeignClient(contextId = "baseUserService",value = "tofly-base",fallbackFactory = BaseLogServiceFallbackFactory.class)
public interface BaseUserService {

    /**
     * 通过用户名查询用户、角色信息
     *
     * @param username 用户名
     * @param from     调用标志
     */
    @GetMapping("/user/info/{username}")
    ResultRespone<UserInfo> getInfo(@PathVariable("username") String username
            , @RequestHeader(SecurityConstants.FROM) String from);


}
