From 6e4cf5045cb931cd375e5c7ee76cfe199a292890 Mon Sep 17 00:00:00 2001 From: whycxzp <glperry@163.com> Date: 星期三, 03 一月 2024 15:22:29 +0800 Subject: [PATCH] 解压 --- src/main/java/com/whyc/controller/ZipAndRarController.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/whyc/controller/ZipAndRarController.java b/src/main/java/com/whyc/controller/ZipAndRarController.java index ee1b006..dd855b8 100644 --- a/src/main/java/com/whyc/controller/ZipAndRarController.java +++ b/src/main/java/com/whyc/controller/ZipAndRarController.java @@ -1,14 +1,18 @@ package com.whyc.controller; +import com.github.junrar.exception.RarException; import com.whyc.dto.Response; import com.whyc.service.ZipAndRarService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.compress.archivers.ArchiveException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; @Api(tags = "鍘嬬缉鍖�") @RestController @@ -25,7 +29,7 @@ @ApiOperation("瑙e帇") @GetMapping("decompress") - public Response decompress(@RequestParam String compressedFileUrl){ + public Response decompress(@RequestParam String compressedFileUrl) throws ArchiveException, IOException, RarException { return service.decompress(compressedFileUrl); } -- Gitblit v1.9.1