فهرست منبع

将 channelId 修改为 channelCode

reghao 1 سال پیش
والد
کامیت
44d8349e71

+ 1 - 1
oss-api/src/main/java/cn/reghao/oss/api/dto/OssPayload.java

@@ -15,6 +15,6 @@ public class OssPayload implements Serializable {
     private static final long serialVersionUID = 1L;
 
     private String action;
-    private int channelId;
+    private int channelCode;
     private int userId;
 }

+ 1 - 1
oss-api/src/main/java/cn/reghao/oss/api/dto/ServerInfo.java

@@ -16,7 +16,7 @@ public class ServerInfo implements Serializable {
 
     private String ossUrl;
     @Deprecated
-    private int channelId;
+    private int channelCode;
     //private int channelCode;
     private long maxSize;
     private String token;

+ 2 - 2
oss-api/src/main/java/cn/reghao/oss/api/iface/ConsoleService.java

@@ -14,7 +14,7 @@ import cn.reghao.oss.api.dto.StoreNodeDto;
 public interface ConsoleService {
     void registerNode(StoreNodeDto storeNodeDto);
     NodeProperties getNodeProperties(String domain);
-    ObjectChannel getChannelById(int owner, int channelId);
-    Integer getChannelIdByUrl(int owner, String url);
+    ObjectChannel getChannelByCode(int owner, int channelCode);
+    Integer getChannelCodeByUrl(int owner, String url);
     ServerInfo getUploadStore(int channelCode);
 }

+ 1 - 1
oss-api/src/main/java/cn/reghao/oss/api/rest/UploadFilePart.java

@@ -16,7 +16,7 @@ import java.io.Serializable;
 public class UploadFilePart implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    private int channelId;
+    private int channelCode;
     // 文件标识
     private String identifier;
     private String filename;

+ 1 - 1
oss-api/src/main/java/cn/reghao/oss/api/rest/UploadPrepare.java

@@ -19,7 +19,7 @@ public class UploadPrepare implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @NotNull
-    private int channelId;
+    private int channelCode;
     @NotBlank
     private String filename;
     @NotNull

+ 3 - 3
oss-api/src/main/java/cn/reghao/oss/api/util/JwtUtil.java

@@ -17,7 +17,7 @@ public class JwtUtil {
     public static String createToken(OssPayload ossPayload, long expireAt, String signKey) {
         return Jwts.builder()
                 .claim("action", ossPayload.getAction())
-                .claim("channelId", ossPayload.getChannelId())
+                .claim("channelCode", ossPayload.getChannelCode())
                 .setSubject(String.valueOf(ossPayload.getUserId()))
                 .setExpiration(new Date(expireAt))
                 .signWith(SignatureAlgorithm.HS256, signKey)
@@ -27,8 +27,8 @@ public class JwtUtil {
     public static OssPayload getOssPayload(String token, String signKey) {
         Claims claims = Jwts.parser().setSigningKey(signKey).parseClaimsJws(token).getBody();
         String action = (String) claims.get("action");
-        int channelId = (Integer) claims.get("channelId");
+        int channelCode = (Integer) claims.get("channelCode");
         String userIdStr = claims.getSubject();
-        return new OssPayload(action, channelId, Integer.parseInt(userIdStr));
+        return new OssPayload(action, channelCode, Integer.parseInt(userIdStr));
     }
 }

+ 6 - 6
oss-sdk/src/main/java/cn/reghao/oss/sdk/ObjectMultipartUploadService.java

@@ -51,7 +51,7 @@ public class ObjectMultipartUploadService {
      * @return
      * @date 2024-10-29 15:43:46
      */
-    public UploadedPart getUploadedParts(File file, int channelId) throws Exception {
+    public UploadedPart getUploadedParts(File file, int channelCode) throws Exception {
         String sha256sum = DigestUtil.sha256sum(file.getAbsolutePath());
         MultiPartBodyPublisher publisher = new MultiPartBodyPublisher();
         publisher.addPart("sha256sum", sha256sum);
@@ -82,7 +82,7 @@ public class ObjectMultipartUploadService {
      * @return
      * @date 2024-10-29 15:44:13
      */
-    public UploadFileRet uploadFilePart(File file, int channelId) throws Exception {
+    public UploadFileRet uploadFilePart(File file, int channelCode) throws Exception {
         String identifier = DigestUtil.sha256sum(new FileInputStream(file));
         String filename = file.getName();
         String relativePath = file.getAbsolutePath();
@@ -105,7 +105,7 @@ public class ObjectMultipartUploadService {
             map.put(chunkNumber, start);
 
             int currentChunkSize = part.length;
-            UploadFilePart uploadFilePart = new UploadFilePart(channelId, identifier, filename, relativePath,
+            UploadFilePart uploadFilePart = new UploadFilePart(channelCode, identifier, filename, relativePath,
                     totalSize, chunkSize, totalChunks, chunkNumber, currentChunkSize);
 
             UploadFileRet uploadFileRet = postObject(part, uploadFilePart);
@@ -126,7 +126,7 @@ public class ObjectMultipartUploadService {
                 long start = map.get(chunkNumber);
                 byte[] part = fileSplitter.getPart(file.getAbsolutePath(), start);
                 int currentChunkSize = part.length;
-                UploadFilePart uploadFilePart = new UploadFilePart(channelId, identifier, filename, relativePath,
+                UploadFilePart uploadFilePart = new UploadFilePart(channelCode, identifier, filename, relativePath,
                         totalSize, chunkSize, totalChunks, chunkNumber, currentChunkSize);
 
                 UploadFileRet uploadFileRet = postObject(part, uploadFilePart);
@@ -158,7 +158,7 @@ public class ObjectMultipartUploadService {
         ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
         publisher.addPart("file", () -> bais, uploadFilePart.getFilename(), "")
                 //.addPart("file", Path.of(""))
-                .addPart("channelId", uploadFilePart.getChannelId()+"")
+                .addPart("channelCode", uploadFilePart.getChannelCode()+"")
                 .addPart("identifier", uploadFilePart.getIdentifier())
                 .addPart("filename", uploadFilePart.getFilename())
                 .addPart("relativePath", uploadFilePart.getRelativePath())
@@ -184,7 +184,7 @@ public class ObjectMultipartUploadService {
     private UploadFileRet postObject(byte[] bytes, UploadFilePart uploadFilePart) {
         UploadParam uploadParam = new UploadParam(bytes, "");
         Map<String, String> params = new HashMap<>();
-        params.put("channelId", uploadFilePart.getChannelId()+"");
+        params.put("channelCode", uploadFilePart.getChannelCode()+"");
         params.put("identifier", uploadFilePart.getIdentifier());
         params.put("filename", uploadFilePart.getFilename());
         params.put("relativePath", uploadFilePart.getRelativePath());

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

@@ -70,8 +70,8 @@ public class OssConsoleClient {
     // ****************************************************************************************************************
     // oss-store 相关接口
     // ****************************************************************************************************************
-    public ServerInfo getUploadStore(int channelId) throws Exception {
-        String api = String.format("%s/api/oss/upload/store?channelId=%s", endpoint, channelId);
+    public ServerInfo getUploadStore(int channelCode) throws Exception {
+        String api = String.format("%s/api/oss/upload/store?channelCode=%s", endpoint, channelCode);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .version(HttpClient.Version.HTTP_1_1)
@@ -95,9 +95,9 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public void setObjectScope(int channelId, String objectId, int scope) throws Exception {
+    public void setObjectScope(int channelCode, String objectId, int scope) throws Exception {
         Map<String, String> formData = new HashMap<>();
-        formData.put("channelId", channelId+"");
+        formData.put("channelCode", channelCode+"");
         formData.put("scope", scope+"");
         formData.put("objectId", objectId);
 
@@ -137,9 +137,9 @@ public class OssConsoleClient {
         return formBodyBuilder.toString();
     }
 
-    public void deleteByObjectId(int channelId, String objectId) throws Exception {
+    public void deleteByObjectId(int channelCode, String objectId) throws Exception {
         Map<String, String> formData = new HashMap<>();
-        formData.put("channelId", channelId+"");
+        formData.put("channelCode", channelCode+"");
         formData.put("objectId", objectId);
 
         String api = String.format("%s/api/oss/object/delete/id", endpoint);
@@ -192,8 +192,8 @@ public class OssConsoleClient {
         }
     }
 
-    public ObjectInfo getObjectInfo(int channelId, String objectId) throws Exception {
-        String api = String.format("%s/api/oss/object/info?channelId=%s&objectId=%s", endpoint, channelId, objectId);
+    public ObjectInfo getObjectInfo(int channelCode, String objectId) throws Exception {
+        String api = String.format("%s/api/oss/object/info?channelCode=%s&objectId=%s", endpoint, channelCode, objectId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .version(HttpClient.Version.HTTP_1_1)
@@ -217,8 +217,8 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public String getSignedUrl(int channelId, String objectId) throws Exception {
-        String api = String.format("%s/api/oss/object/url?channelId=%s&objectId=%s", endpoint, channelId, objectId);
+    public String getSignedUrl(int channelCode, String objectId) throws Exception {
+        String api = String.format("%s/api/oss/object/url?channelCode=%s&objectId=%s", endpoint, channelCode, objectId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .version(HttpClient.Version.HTTP_1_1)
@@ -242,8 +242,8 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public VideoInfo getVideoInfo(int channelId, String objectId) throws Exception {
-        String api = String.format("%s/api/oss/object/video/info?channelId=%s&objectId=%s", endpoint, channelId, objectId);
+    public VideoInfo getVideoInfo(int channelCode, String objectId) throws Exception {
+        String api = String.format("%s/api/oss/object/video/info?channelCode=%s&objectId=%s", endpoint, channelCode, objectId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .version(HttpClient.Version.HTTP_1_1)
@@ -267,8 +267,8 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public ImageInfo getImageInfo(int channelId, String objectId) throws Exception {
-        String api = String.format("%s/api/oss/object/image/info?channelId=%s&objectId=%s", endpoint, channelId, objectId);
+    public ImageInfo getImageInfo(int channelCode, String objectId) throws Exception {
+        String api = String.format("%s/api/oss/object/image/info?channelCode=%s&objectId=%s", endpoint, channelCode, objectId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .headers("content-type", "application/x-www-form-urlencoded")
@@ -293,9 +293,9 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public ConvertedImageInfo getWebpInfo(int channelId, String objectId) throws Exception {
+    public ConvertedImageInfo getWebpInfo(int channelCode, String objectId) throws Exception {
         Map<String, String> formData = new HashMap<>();
-        formData.put("channelId", ""+channelId);
+        formData.put("channelCode", ""+channelCode);
         formData.put("objectId", objectId);
 
         String api = String.format("%s/api/oss/object/image/webp", endpoint);
@@ -323,8 +323,8 @@ public class OssConsoleClient {
         return webResult.getData();
     }
 
-    public AudioInfo getAudioInfo(int channelId, String objectId) throws Exception {
-        String api = String.format("%s/api/oss/object/audio/info/?channelId=%s&objectId=%s", endpoint, channelId, objectId);
+    public AudioInfo getAudioInfo(int channelCode, String objectId) throws Exception {
+        String api = String.format("%s/api/oss/object/audio/info/?channelCode=%s&objectId=%s", endpoint, channelCode, objectId);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))
                 .header("authorization", "Bearer " + token)
                 .version(HttpClient.Version.HTTP_1_1)
@@ -387,8 +387,8 @@ public class OssConsoleClient {
     // ****************************************************************************************************************
     // 对象访问接口
     // ****************************************************************************************************************
-    public UploadFileRet postObject(File file, int channelId) throws Exception {
-        ServerInfo serverInfo = getUploadStore(channelId);
+    public UploadFileRet postObject(File file, int channelCode) throws Exception {
+        ServerInfo serverInfo = getUploadStore(channelCode);
         if (serverInfo == null) {
             throw new Exception("获取 server_info 失败");
         }
@@ -396,12 +396,12 @@ public class OssConsoleClient {
         String token = serverInfo.getToken();
 
         OssStoreClient ossStoreClient = new OssStoreClient(ossUrl);
-        UploadFileRet uploadFileRet = ossStoreClient.postObjectWithJdkHttp(file, channelId, token);
+        UploadFileRet uploadFileRet = ossStoreClient.postObjectWithJdkHttp(file, channelCode, token);
         return uploadFileRet;
     }
 
-    public UploadFileRet postObjectByMultiparts(File file, int channelId) throws Exception {
-        ServerInfo serverInfo = getUploadStore(channelId);
+    public UploadFileRet postObjectByMultiparts(File file, int channelCode) throws Exception {
+        ServerInfo serverInfo = getUploadStore(channelCode);
         if (serverInfo == null) {
             throw new Exception("获取 server_info 失败");
         }
@@ -409,7 +409,7 @@ public class OssConsoleClient {
         String token = serverInfo.getToken();
 
         ObjectMultipartUploadService multipartUploadService = new ObjectMultipartUploadService(ossUrl, token);
-        UploadFileRet uploadFileRet = multipartUploadService.uploadFilePart(file, channelId);
+        UploadFileRet uploadFileRet = multipartUploadService.uploadFilePart(file, channelCode);
         return uploadFileRet;
     }
 

+ 8 - 8
oss-sdk/src/main/java/cn/reghao/oss/sdk/OssStoreClient.java

@@ -37,13 +37,13 @@ public class OssStoreClient {
         this.endpoint = endpoint;
     }
 
-    public UploadFileRet putObject(File file, int channelId, int userId) throws Exception {
+    public UploadFileRet putObject(File file, int channelCode, int userId) throws Exception {
         String sha256sum = DigestUtil.sha256sum(file.getAbsolutePath());
         String api = String.format("%s/", endpoint);
         HttpRequest.Builder builder = HttpRequest.newBuilder(new URI(api))
                 .version(HttpClient.Version.HTTP_1_1)
                 .header("x-content-sha256sum", sha256sum)
-                .header("x-channel-id", channelId+"")
+                .header("x-channel-id", channelCode+"")
                 .header("x-user-id", userId+"");
 
         HttpRequest httpRequest = builder.PUT(HttpRequest.BodyPublishers.ofFile(Path.of(file.getAbsolutePath()))).build();
@@ -51,12 +51,12 @@ public class OssStoreClient {
         return getResult(httpResponse);
     }
 
-    public UploadFileRet putObjectWithJdkHttp(InputStream inputStream, int channelId, int userId) throws Exception {
+    public UploadFileRet putObjectWithJdkHttp(InputStream inputStream, int channelCode, int userId) throws Exception {
         String api = String.format("%s/", endpoint);
         HttpRequest.Builder builder = HttpRequest.newBuilder(new URI(api))
                 .version(HttpClient.Version.HTTP_1_1)
                 .header("x-content-sha256sum", "1234567890")
-                .header("x-channel-id", channelId+"")
+                .header("x-channel-id", channelCode+"")
                 .header("x-user-id", userId+"");
 
         BufferedInputStream bis = new BufferedInputStream(inputStream);
@@ -66,10 +66,10 @@ public class OssStoreClient {
         return getResult(httpResponse);
     }
 
-    public UploadFileRet postObject(File file, int channelId, String token) throws Exception {
+    public UploadFileRet postObject(File file, int channelCode, String token) throws Exception {
         String sha256sum = DigestUtil.sha256sum(file.getAbsolutePath());
         Map<String, String> map = new HashMap<>();
-        map.put("channelId", ""+channelId);
+        map.put("channelCode", ""+channelCode);
         map.put("client", "client");
         map.put("sha256sum", sha256sum);
         UploadParam uploadParam = new UploadParam(file, map);
@@ -92,13 +92,13 @@ public class OssStoreClient {
         return webResult.getData();
     }
 
-    public UploadFileRet postObjectWithJdkHttp(File file, int channelId, String token) throws Exception {
+    public UploadFileRet postObjectWithJdkHttp(File file, int channelCode, String token) throws Exception {
         String sha256sum = DigestUtil.sha256sum(file.getAbsolutePath());
         MultiPartBodyPublisher publisher = new MultiPartBodyPublisher()
                 .addPart("file", Paths.get(file.getAbsolutePath()))
                 .addPart("client", "oss-sdk-1.0")
                 .addPart("sha256sum", sha256sum)
-                .addPart("channelId", channelId+"");
+                .addPart("channelCode", channelCode+"");
 
         String api = String.format("%s/", endpoint);
         HttpRequest httpRequest = HttpRequest.newBuilder(new URI(api))

+ 3 - 3
oss-sdk/src/test/java/OssConsoleClientTest.java

@@ -20,9 +20,9 @@ public class OssConsoleClientTest {
 
         String filePath = "";
         File file = new File(filePath);
-        int channelId = 114;
-        UploadFileRet uploadFileRet = ossConsoleClient.postObject(file, channelId);
-        UploadFileRet uploadFileRet1 = ossConsoleClient.postObjectByMultiparts(file, channelId);
+        int channelCode = 114;
+        UploadFileRet uploadFileRet = ossConsoleClient.postObject(file, channelCode);
+        UploadFileRet uploadFileRet1 = ossConsoleClient.postObjectByMultiparts(file, channelCode);
 
         String objectName = "video/playback/28d0fd95e224499c9f2cf1d98b4551a5.flv";
         String localPath  = ossConsoleClient.getObject(objectName);

+ 3 - 3
oss-store/src/main/java/cn/reghao/oss/store/controller/ObjectGetController.java

@@ -94,10 +94,10 @@ public class ObjectGetController {
 
         OssPayload ossPayload = JwtUtil.getOssPayload(token, secretKey);
         int loginUser = ossPayload.getUserId();
-        int channelId = ossPayload.getChannelId();
-        ObjectChannel objectChannel = consoleService.getChannelById(loginUser, channelId);
+        int channelCode = ossPayload.getChannelCode();
+        ObjectChannel objectChannel = consoleService.getChannelByCode(loginUser, channelCode);
         if (objectChannel == null) {
-            String payload = String.format("channel_id %s not exist", channelId);
+            String payload = String.format("channel_id %s not exist", channelCode);
             getObjectService.writeResponse(HttpServletResponse.SC_FORBIDDEN, payload);
             return;
         }

+ 10 - 10
oss-store/src/main/java/cn/reghao/oss/store/controller/ObjectMultipartUploadController.java

@@ -40,7 +40,7 @@ public class ObjectMultipartUploadController {
     @ApiOperation(value = "获取已上传的对象分片")
     @GetMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<String> getUploadedPart(UploadFilePart uploadFilePart) throws Exception {
-        int channelId = uploadFilePart.getChannelId();
+        int channelCode = uploadFilePart.getChannelCode();
         /* permission check */
         String token = ServletUtil.getBearerToken();
         if (token == null) {
@@ -56,16 +56,16 @@ public class ObjectMultipartUploadController {
                     .body(WebResult.failWithMsg("it's not upload token"));
         }
 
-        int channelId1 = ossPayload.getChannelId();
-        if (channelId != channelId1) {
+        int channelCode1 = ossPayload.getChannelCode();
+        if (channelCode != channelCode1) {
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg("channel not match in token"));
         }
 
         int loginUser = ossPayload.getUserId();
-        ObjectChannel objectChannel = consoleService.getChannelById(loginUser, channelId);
+        ObjectChannel objectChannel = consoleService.getChannelByCode(loginUser, channelCode);
         if (objectChannel == null) {
-            String errMsg = String.format("channel validate failed, channel %s not exist", channelId);
+            String errMsg = String.format("channel validate failed, channel %s not exist", channelCode);
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg(errMsg));
         }
@@ -78,7 +78,7 @@ public class ObjectMultipartUploadController {
     @ApiOperation(value = "上传对象分片")
     @PostMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<String> uploadPart(MultipartFile file, @Validated UploadFilePart uploadFilePart) throws Exception {
-        int channelId = uploadFilePart.getChannelId();
+        int channelCode = uploadFilePart.getChannelCode();
         /* permission check */
         String token = ServletUtil.getBearerToken();
         if (token == null) {
@@ -94,16 +94,16 @@ public class ObjectMultipartUploadController {
                     .body(WebResult.failWithMsg("it's not upload token"));
         }
 
-        int channelId1 = ossPayload.getChannelId();
-        if (channelId != channelId1) {
+        int channelCode1 = ossPayload.getChannelCode();
+        if (channelCode != channelCode1) {
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg("channel not match in token"));
         }
 
         int loginUser = ossPayload.getUserId();
-        ObjectChannel objectChannel = consoleService.getChannelById(loginUser, channelId);
+        ObjectChannel objectChannel = consoleService.getChannelByCode(loginUser, channelCode);
         if (objectChannel == null) {
-            String errMsg = String.format("channel validate failed, channel %s not exist", channelId);
+            String errMsg = String.format("channel validate failed, channel %s not exist", channelCode);
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg(errMsg));
         }

+ 5 - 5
oss-store/src/main/java/cn/reghao/oss/store/controller/ObjectUploadController.java

@@ -59,7 +59,7 @@ public class ObjectUploadController {
 
     @ApiOperation(value = "使用 POST 方法上传对象")
     @PostMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> postObject(MultipartFile file, Integer channelId, String objectName,
+    public ResponseEntity<String> postObject(MultipartFile file, Integer channelCode, String objectName,
                                              String client, String sha256sum) throws Exception {
         /* permission check */
         String token = ServletUtil.getBearerToken();
@@ -76,16 +76,16 @@ public class ObjectUploadController {
                     .body(WebResult.failWithMsg("it's not upload token"));
         }
 
-        int channelId1 = ossPayload.getChannelId();
-        if (channelId != channelId1) {
+        int channelCode1 = ossPayload.getChannelCode();
+        if (channelCode != channelCode1) {
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg("channel not match in token"));
         }
 
         int loginUser = ossPayload.getUserId();
-        ObjectChannel objectChannel = consoleService.getChannelById(loginUser, channelId);
+        ObjectChannel objectChannel = consoleService.getChannelByCode(loginUser, channelCode);
         if (objectChannel == null) {
-            String errMsg = String.format("channel validate failed, channel %s not exist", channelId);
+            String errMsg = String.format("channel validate failed, channel %s not exist", channelCode);
             return ResponseEntity.status(HttpStatus.FORBIDDEN)
                     .body(WebResult.failWithMsg(errMsg));
         }

+ 2 - 2
oss-store/src/main/java/cn/reghao/oss/store/service/SignService.java

@@ -29,11 +29,11 @@ public class SignService {
 
     public String getSignedUrl(int loginUser, String url, int expire) {
         long timestamp = System.currentTimeMillis() + expire*1000L;
-        int channelId = consoleService.getChannelIdByUrl(loginUser, url);
+        int channelCode = consoleService.getChannelCodeByUrl(loginUser, url);
 
         String action1 = ChannelAction.download.getName();
         String action = ChannelAction.access.getName();
-        OssPayload ossPayload = new OssPayload(action, channelId, loginUser);
+        OssPayload ossPayload = new OssPayload(action, channelCode, loginUser);
 
         //String secretKey = consoleService.getSecretKey();
         String secretKey = RandomString.getString(128);