whycxzp
2024-01-03 f7733dc8aaca5590f7194ff4bd491e80d8c92ab3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.whyc.controller;
 
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
@RequestMapping("zipAndRar")
public class ZipAndRarController {
    @Autowired
    private ZipAndRarService service;
 
    @ApiOperation(value = "产品查看原来压缩包中文件信息(文件目录和时间)")
    @GetMapping("getzipAndRarInfo")
    public Response getzipAndRarInfo(@RequestParam String fileUrl){
        return service.getzipAndRarInfo(fileUrl);
    }
 
    @ApiOperation("解压")
    @GetMapping("decompress")
    public Response decompress(@RequestParam String compressedFileUrl) throws ArchiveException, IOException, InterruptedException {
        return service.decompress(compressedFileUrl);
    }
 
}