io.gitee.huangguiming.Imcode.adapter.IMCreateGroupsResponseAdapter Maven / Gradle / Ivy
package io.gitee.huangguiming.Imcode.adapter;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import io.gitee.huangguiming.Imcode.responses.IMCreateGroupResponse;
import java.lang.reflect.Type;
public class IMCreateGroupsResponseAdapter implements JsonSerializer {
@Override
public JsonElement serialize(IMCreateGroupResponse obj, Type typeOfSrc, JsonSerializationContext context) {
JsonObject messageJson = new JsonObject();
messageJson.addProperty("ActionStatus",obj.getActionStatus());
messageJson.addProperty("ErrorInfo",obj.getErrorInfo());
messageJson.addProperty("ErrorCode",obj.getErrorCode());
messageJson.addProperty("GroupId",obj.getGroupId());
return messageJson;
}
}