| | |
| | | package com.gs.xky; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.gs.xky.config.ApiResponse; |
| | | import com.gs.xky.config.BodyParam; |
| | | import com.gs.xky.config.DataAcquisitionConfiguration; |
| | | import com.gs.xky.config.XkyCommonParam; |
| | | import com.gs.xky.dto.XkyDetail; |
| | | import com.gs.xky.service.ApiService; |
| | | import com.gs.xky.service.XkyService; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private XkyService xkyService; |
| | | |
| | | @Autowired |
| | | private ApiService apiService; |
| | | |
| | | @Test |
| | | void contextLoads() throws IOException { |
| | | |
| | | xkyService.GetSaveDetail(); |
| | | } |
| | | |
| | | @Test |
| | | void cs() throws IOException { |
| | | XkyCommonParam param = XkyCommonParam.GetInit(); |
| | | |
| | | // 创建 BodyParam 对象并赋值 |
| | | BodyParam bodyParam = new BodyParam(); |
| | | |
| | | bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE); |
| | | bodyParam.setDeliveryNo("22250212VVWU"); |
| | | |
| | | param.setBody(bodyParam); |
| | | |
| | | ApiResponse<XkyDetail> noList = apiService.sendListRequest(param, XkyDetail.class, "https://openapi.xiekeyun.com/delivery/getDetail.json"); |
| | | |
| | | System.out.println(JSON.toJSONString(noList.getData())); |
| | | } |
| | | |
| | | } |