package com.kidgrow.common.feign;
import com.kidgrow.common.constant.ServiceNameConstants;
import com.kidgrow.common.feign.fallback.UserServiceFallbackFactory;
import com.kidgrow.common.model.LoginAppUser;
import com.kidgrow.common.model.SysUser;
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.RequestParam;
/**
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020
*
* @Description:
* @Project:
* @CreateDate: Created in 2020/2/3 16:15
* @Author: liuke
*/
@FeignClient(value = ServiceNameConstants.USER_SERVICE,
fallbackFactory = UserServiceFallbackFactory.class, decode404 = true)
public interface UserService {
/**
* feign rpc访问远程/users/{username}接口
* 查询用户实体对象SysUser
*
* @param username
* @return
*/
@GetMapping(value = "/users/name/{username}")
SysUser selectByUsername(@PathVariable("username") String username);
/**
* feign rpc访问远程/users-anon/login接口
*
* @param username
* @return
*/
//@RequestParam(name = "tenantId",required = false) String tenantId
@GetMapping(value = "/users-anon/login", params = "username")
LoginAppUser findByUsername(@RequestParam("username") String username);
/**
* 通过手机号查询用户、角色信息
*
* @param mobile 手机号
*/
@GetMapping(value = "/users-anon/mobile", params = "mobile")
LoginAppUser findByMobile(@RequestParam("mobile") String mobile);
/**
* 根据OpenId查询用户信息
*
* @param openId openId
*/
@GetMapping(value = "/users-anon/openId", params = "openId")
LoginAppUser findByOpenId(@RequestParam("openId") String openId);
}