whycxzp
2024-01-03 66db1d15cf5d4b51a346a42b66f0505bd7f31ce0
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
@@ -22,4 +26,11 @@
    public Response getzipAndRarInfo(@RequestParam String fileUrl){
        return service.getzipAndRarInfo(fileUrl);
    }
    @ApiOperation("解压")
    @GetMapping("decompress")
    public Response decompress(@RequestParam String compressedFileUrl) throws ArchiveException, IOException, RarException {
        return service.decompress(compressedFileUrl);
    }
}