com.github.charlemaznable.bunny.client.domain.BunnyBaseRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bunny-client Show documentation
Show all versions of bunny-client Show documentation
Bunny rabbits will skip hand-in-hand with baby lambs across sunny green meadows.
package com.github.charlemaznable.bunny.client.domain;
import com.alibaba.fastjson.annotation.JSONField;
import com.github.charlemaznable.httpclient.common.CncRequest;
import com.github.charlemaznable.httpclient.common.PathVar;
import lombok.Getter;
import lombok.Setter;
import java.util.Map;
import static com.github.charlemaznable.core.lang.Mapp.newHashMap;
import static org.joor.Reflect.onClass;
@Getter
public abstract class BunnyBaseRequest implements CncRequest {
@JSONField(serialize = false, deserialize = false)
@PathVar("bunny-address")
protected String bunnyAddress;
/**
* 服务名称
*/
@Setter
private String serveName;
/**
* 可选扩展参数
*/
private final Map context = newHashMap();
public T createResponse() {
T response = onClass(responseClass()).create().get();
response.setServeName(this.serveName);
return response;
}
}