whyclxw
2025-02-27 1fb20e784af96284eca2bcd04f5e31a83026988f
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
36
37
38
39
40
41
42
43
44
45
46
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.Software;
import com.whyc.service.SoftcodeService;
import com.whyc.service.SoftwareService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
 
@Api(tags = "源码管理")
@RestController
@RequestMapping("softcode")
public class SoftcodeController {
 
    @Autowired
    private SoftcodeService service;
 
    @Autowired
    private SoftwareService wareService;
 
    @ApiOperation("源码上传")
    @PostMapping("uploadCode")
    public Response uploadCode(@RequestParam MultipartFile file, @RequestParam String fileNames) throws IOException {
        return service.uploadCode(file,fileNames);
    }
 
    @ApiOperation(value = "根据软件id实现源码下载")
    @GetMapping("downLoadCode")
    public void downLoadCode(HttpServletRequest req, HttpServletResponse resp, @RequestParam String fileName){
        service.downLoadCode(req,resp,fileName);
    }
 
    @ApiOperation(value = "查询日期三天内的所有上传软件名称")
    @GetMapping("getFileNameByCreateTime")
    public Response getFileNameByCreateTime(@RequestParam String createTime){
        return wareService.getFileNameByCreateTime(createTime);
    }
}