doum
2025-12-30 ef6499ac58f7b0ea357295912da3f753d2af1773
server/jiandaoyun_service/src/main/java/com/doumee/core/jiandaoyun/model/http/ApiClient.java
@@ -1,6 +1,5 @@
package com.doumee.core.jiandaoyun.model.http;
import com.alibaba.fastjson.JSONObject;
import com.doumee.core.jiandaoyun.util.LimitUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
@@ -120,12 +119,11 @@
     */
    public Map<String, Object> sendPostRequest(HttpRequestParam param) throws Exception {
        if (param == null || StringUtils.isBlank(param.getPath())) {
            throw new Exception("缺失参数!");
            throw new RuntimeException("缺失参数!");
        }
        HttpClient client = getSSLHttpClient();
        Header[] headers = getHttpHeaders(this.getApiKey());
        String url = this.host + param.getPath();
        log.error("===简道云接口url:"+url);
        HttpRequestBase request = new HttpPost(url);
        // 请求参数
@@ -150,11 +148,9 @@
            result = (Map<String, Object>) mapper.readValue(response.getEntity().getContent(), Object.class);
        }
        if (statusCode >= 400) {
            log.error("===简道云接口:请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg"));
            throw new Exception("请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg"));
            throw new RuntimeException("请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg"));
        } else {
            // 处理返回结果
            log.error("===简道云接口:请求成功result:" + JSONObject.toJSONString(result));
            return result;
        }
    }