com.foreveross.springboot.dubbo.utils.Payload Maven / Gradle / Ivy
package com.foreveross.springboot.dubbo.utils;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.beans.factory.annotation.Value;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.UUID;
public class Payload implements Serializable {
private static final long serialVersionUID = -1549643581827130116L;
@JsonProperty("payload")
private Object payload;
@JsonProperty("request_id")
@Value("${dubbox.service.request_id}")
private String request_id = UUID.randomUUID().toString();
private JsonFilterConfig mapper;
public Payload() {}
public Payload(Object payload) {
this.payload = payload;
}
public Object getPayload() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
return this.mapper.filteredWriter(this.payload);
}
public void setPayload(Object payload) {
this.payload = payload;
}
}