whyclxw
2025-03-13 aca4324415aba0e5462ae6462ca8d99ca282b71c
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
47
48
49
50
51
52
53
54
55
56
57
58
package com.whyc.controller;
 
import com.whyc.dto.CodeFilesDto;
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);
    }
 
    @ApiOperation(value = "查询当前owner的未上传源码记录")
    @GetMapping("getFileNameByOwnerWithCode")
    public Response getFileNameByOwnerWithCode(@RequestParam String owner){
        return wareService.getFileNameByOwnerWithCode(owner);
    }
    @ApiOperation(value = "批量添加源码包")
    @PostMapping("setCodeByFileNmaes")
    public Response setCodeByFileNmaes(@RequestBody CodeFilesDto dto){
        return wareService.setCodeByFileNmaes(dto);
    }
}