소스 검색

update oss-sdk

reghao 1 년 전
부모
커밋
dd13a7aab9
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      oss-sdk/src/main/java/cn/reghao/oss/sdk/OssConsoleClient.java

+ 3 - 3
oss-sdk/src/main/java/cn/reghao/oss/sdk/OssConsoleClient.java

@@ -102,7 +102,7 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public ObjectInfo getChannelScope(int channelId) throws Exception {
+    public Integer getChannelScope(int channelId) throws Exception {
         String api = String.format("%s/api/oss/channel/scope?channelId=%s", endpoint, channelId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
@@ -117,8 +117,8 @@ public class OssConsoleClient {
             throw new Exception(errMsg);
         }
 
-        Type type = new TypeToken<WebResult<ObjectInfo>>(){}.getType();
-        WebResult<ObjectInfo> webResult = JsonConverter.jsonToObject(body, type);
+        Type type = new TypeToken<WebResult<Integer>>(){}.getType();
+        WebResult<Integer> webResult = JsonConverter.jsonToObject(body, type);
         if (webResult.getCode() != 0) {
             String errMsg = String.format("%s - %s", webResult.getCode(), webResult.getMsg());
             throw new Exception(errMsg);