admin
2024-06-30 b6fdf185c7e8fb1f06da0e609e39aecaef6b66f5
src/main/java/com/taoke/autopay/utils/order/DYOrderApi.java
@@ -1,6 +1,7 @@
package com.taoke.autopay.utils.order;
import com.taoke.autopay.dto.DYOrderDto;
import com.taoke.autopay.exception.KeyOrderException;
import com.taoke.autopay.utils.HttpUtil;
import com.taoke.autopay.utils.JsonUtil;
import net.sf.json.JSONObject;
@@ -22,19 +23,21 @@
        return result;
    }
    public static DYOrderDto getOrderDetail(String orderNo) throws Exception {
    public static DYOrderDto getOrderDetail(String orderNo) throws KeyOrderException {
        String result = requestByOrderNo1(orderNo);
        System.out.println(result);
        JSONObject root = JSONObject.fromObject(result);
        if (root.optInt("code") != 1000) {
            logger.error(String.format("抖音订单查询出错:%s - %s",orderNo, result));
            throw new Exception(root.optString("message"));
            throw new KeyOrderException(root.optString("message"));
        }
       JSONObject data = root.optJSONObject("data");
       return  JsonUtil.getSimpleGson().fromJson(data.toString(),DYOrderDto.class);
    }
    public static void main(String[] args) throws Exception {
        DYOrderDto dto = (DYOrderApi.getOrderDetail("6930867557709059751"));
        DYOrderDto dto = (DYOrderApi.getOrderDetail("6931373743528482165"));
        System.out.println("123123");
    }
}