All Downloads are FREE. Search and download functionalities are using the official Maven repository.

shz.spring.api.SpringApiRequest Maven / Gradle / Ivy

There is a newer version: 2023.2.5
Show newest version
package shz.spring.api;

import com.alibaba.fastjson2.JSON;
import shz.core.Container;
import shz.core.net.api.AbstractApiRequest;
import shz.core.net.api.ApiResponse;

import java.util.Map;

public class SpringApiRequest extends AbstractApiRequest {
    static {
        Container.setLoadContainer(true);
    }

    @Override
    protected byte[] body(Map dataMap) {
        if (dataMap.isEmpty() || !config.getMethod().startsWith("P")) return null;
        return JSON.toJSONBytes(dataMap);
    }

    @Override
    protected R analysis(String response) {
        return JSON.parseObject(response, rCls);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy