package com.xunmei.common.core.json;


import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * 图片前缀
 */
@Component
public class ImageDeserializer extends JsonDeserializer<String> {

    @Override
    public String deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
        final String text = p.getText();
        /*if (StringUtils.isNotBlank(text)) {
            return UploadProperties.INSTANCE.pureResource(text);
        }*/
        return text;
    }
}
