package com.muyu.common.system.remote;

import com.muyu.common.core.constant.SecurityConstants;
import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 文件服务
 *
 * @author muyu
 */
@FeignClient(contextId = "remoteSaasService", value = ServiceNameConstants.SAAS_SERVICE, fallbackFactory = RemoteSaasFallbackFactory.class)
public interface RemoteSaasService {

    /**
     * 通过用户名查询用户信息
     *
     * @param firmCode
     * @param username 用户名
     * @param source   请求来源
     * @return 结果
     */
    @GetMapping("/user/info")
    public Result<SysUser> getUserInfo (@RequestParam("firmCode") String firmCode, @RequestParam("userName") String userName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
