implementation 'io.github.openfeign:feign-core:11.0'
implementation 'com.netflix.feign:feign-jackson:8.18.0'
package com.fdw.study.feign;
import com.fdw.study.validate.User;
import feign.RequestLine;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @program: hibbernatestudy
* @description: 脱离springCloud使用Feign
* @author:
* @create: 2023-12-22 15:43
**/
public interface MyFeignClient {
@RequestLine("POST /feign-test")
User getUserByfeign(@RequestBody String id);
}
FeignService:
package com.fdw.study.feign;
import com.fdw.study.validate.User;
public interface FeignService {
public User getUser(String id);
}
FeignServiceImpl:
package com.fdw.study.feign;
imp