whyclxw
2025-02-26 6b390f3225ca3084df8afc515ff07a638dc15f80
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 softIds) throws IOException {
        return service.uploadCode(file,softIds);
    }
 
    @ApiOperation(value = "根据软件id实现源码下载")
    @GetMapping("downLoadCode")
    public void downLoadCode(HttpServletRequest req, HttpServletResponse resp, @RequestParam String softId){
        service.downLoadCode(req,resp,softId);
    }
 
    @ApiOperation(value = "根据板号和物料编码查询软件记录")
    @GetMapping("getSoftwareByBoardAndMaterialCode")
    public Response getSoftwareByBoardAndMaterialCode(@RequestParam String board,@RequestParam String materialCode){
        return wareService.getSoftwareByBoardAndMaterialCode(board,materialCode);
    }
}