package cn.sh.stc.sict.cloud.upms.feign;

import cn.sh.stc.sict.cloud.common.core.constant.SecurityConstants;
import cn.sh.stc.sict.cloud.common.core.constant.ServiceNameConstants;
import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.cloud.upms.dto.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;

/**
 * @Description
 * @Author
 * @Date
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteUserService {
    /**
     * 通过用户名或手机号查询用户
     *
     * @param username 用户名
     * @param from     调用标志
     * @return R
     */
    @GetMapping("/feign/user/base/info/{appId}/{username}")
    R<UserInfo> info(@PathVariable("appId") String appId,
                     @PathVariable("username") String username,
                     @RequestHeader(SecurityConstants.FROM) String from);

    @GetMapping("/feign/user/base/social/info/{appId}/{inStr}")
    R<UserInfo> social(@PathVariable("appId") String appId,
                       @PathVariable("inStr") String inStr,
                       @RequestHeader(SecurityConstants.FROM) String from);

}
