ITest.java
1.02 KB
package com.dituhui.pea.user;
import com.dituhui.pea.pojo.UserInfo;
import com.dituhui.pea.pojo.WebResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value = "user")
public interface ITest {
/**
* 测试熔断
*
* @param userId
* @param timeout
* @return
*/
@RequestMapping(value = "/user/getUserName", method = RequestMethod.GET)
public String getUserName(@RequestParam("userId") String userId, @RequestParam("timeout") int timeout);
@RequestMapping(value = "/user/getUser", method = RequestMethod.GET)
public WebResult<UserInfo> getUser(@RequestParam(name = "userName", required = false) String userName,
@RequestHeader(name = "userId", required = false) String userId);
}