package com.tofly.auth.feign;
import com.tofly.common.core.constant.SecurityConstants;
import com.tofly.common.core.entity.ResultRespone;

import com.tofly.common.log.service.BaseLogServiceFallbackFactory;
import com.tofly.entity.pojo.UserInfo;
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;

@FeignClient(contextId = "baseUserService", value = "tofly-base", fallbackFactory = BaseLogServiceFallbackFactory.class)
public interface BaseUserService {

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

}
