|
|
|
@ -39,7 +39,7 @@ public class RedServiceImpl implements RedService { |
|
|
|
private String BASE_URLProd ; |
|
|
|
private static final String BASE_URLDev = "http://gf977328.natappfree.cc"; |
|
|
|
private static final String PATH = "/api/coupon/IssueRechargeRedPacket"; |
|
|
|
|
|
|
|
private static final String CONSUME_PATH = "/api/coupon/updateCostRedPacket"; |
|
|
|
private static final HttpClient CLIENT = HttpClient.newHttpClient(); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@ -111,9 +111,9 @@ public class RedServiceImpl implements RedService { |
|
|
|
@Override |
|
|
|
public String sendConsumeJwcode(Integer jwcode, Integer price) { |
|
|
|
try { |
|
|
|
String body = JSON.toJSONString(java.util.Map.of("jwcode", jwcode,"price",price)); |
|
|
|
String body = JSON.toJSONString(java.util.Map.of("jwcode", jwcode,"discount",price)); |
|
|
|
HttpRequest request = HttpRequest.newBuilder() |
|
|
|
.uri(URI.create(BASE_URLProd + PATH)) //URL记得换 |
|
|
|
.uri(URI.create(BASE_URLProd + CONSUME_PATH)) //URL记得换 |
|
|
|
.header("Content-Type", "application/json") |
|
|
|
.POST(HttpRequest.BodyPublishers.ofString(body)) |
|
|
|
.build(); |
|
|
|
|