From e2778e528bbea89914811a1883e2fef2a0b919ec Mon Sep 17 00:00:00 2001 From: lulz1 Date: Mon, 5 Feb 2024 09:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=90=BA=E7=A8=8B=E5=90=8E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96token=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/interfaces/rest/ctrip/CTripTokenRequest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/CTripTokenRequest.java b/src/main/java/com/chint/interfaces/rest/ctrip/CTripTokenRequest.java index e7262e73..395ec8b1 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/CTripTokenRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/CTripTokenRequest.java @@ -26,4 +26,13 @@ public class CTripTokenRequest { .getData() .getAccessToken(); } + + public String getToken(Integer tokenType) { + GetUnionAccessTokenRequest getUnionAccessTokenRequest = + GetUnionAccessTokenRequest.of(C_TRIP_APP_KEY, C_TRIP_APP_SECURITY, tokenType); + return postRequest + .post(tokenUrl, getUnionAccessTokenRequest, AccessTokenResponse.class) + .getData() + .getAccessToken(); + } }