一 、创建和销毁对象篇
import lombok.Builder;
/** 请求类 */
@Builder
public class SampleRequest {
private String paramOne;
private int paramTwo;
private boolean paramThree;
}
/** 响应类 */
@Builder
public class SampleResponse {
private boolean success;
}
/** 服务接口 */
public interface SampleFacade {
Result<SampleResponse> rpcOne(RequestParam<SampleRequest>);
}
/** 调用 */
public void testRpcOne() {
SampleRequest request =
SampleRequest.builder().paramOne("one").paramTwo(2).paramThree(true).build();
Result<SampleResponse> response = sampleFacade.rpcOne(request);
}