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

cn.wandersnail.common.http.upload.UploadInfo Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package cn.wandersnail.common.http.upload;


import java.io.File;
import java.util.Map;
import java.util.UUID;

import cn.wandersnail.common.http.TaskInfo;
import okhttp3.OkHttpClient;
import okhttp3.ResponseBody;
import retrofit2.Converter;

/**
 * date: 2019/8/23 17:46
 * author: zengfansheng
 */
public class UploadInfo extends TaskInfo {
    Converter converter;
    Map paramParts;
    final Map fileParts;
    OkHttpClient client;

    public UploadInfo(String url, Map fileParts) {
        this(UUID.randomUUID().toString(), url, fileParts);
    }

    public UploadInfo(String tag, String url, Map fileParts) {
        super(tag, url);
        this.fileParts = fileParts;        
    }

    /**
     * 设置响应体转换器
     */
    public void setConverter(Converter converter) {
        this.converter = converter;
    }

    /**
     * 设置携带的参数
     */
    public void setParamParts(Map paramParts) {
        this.paramParts = paramParts;
    }

    /**
     * 设置自定义的OkHttpClient
     */
    public void setClient(OkHttpClient client) {
        this.client = client;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy