package cn.com.ctop.common.module.utils;

import java.util.HashMap;
import java.util.Map;

public class ChaojiyingUtils {
    private static String host = "http://upload.chaojiying.net";
    private static String path = "/Upload/Processing.php";
    private static String username = "xuzuoyun";
    private static String password = "heaven";
    private static Integer softId = 901055;

    public static String process(String imageBase64,int code) {
        Map<String, Object> params = new HashMap<>();
        params.put("user", username);
        params.put("pass", password);
        params.put("softid", softId);
        params.put("codetype", code);
        params.put("file_base64", imageBase64);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        return HttpUtils.httpPostRequest(host + path, params, headers);
    }
}
