whycxzp
2025-04-30 5b5aa1f9495e1417689d654dd5afc3fc6cc425f5
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
59
60
61
62
63
64
65
66
67
68
package com.whyc.controller;
 
import com.google.gson.reflect.TypeToken;
import com.whyc.dto.Response;
import com.whyc.pojo.Software;
import com.whyc.service.SoftwareService;
import com.whyc.util.ActionUtil;
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 java.io.IOException;
import java.util.List;
 
@RestController
@RequestMapping("software")
@Api(tags = "软件包")
public class SoftwareController {
 
    @Autowired
    private SoftwareService service;
 
 
    @ApiOperation("升级申请")
    @PostMapping("upgradeApply")
    public Response upgradeApply(@RequestBody Software software) throws IOException {
        return service.upgradeApply(software);
    }
 
    /**
     *
     * @param file
     * @param id 软件id
     * @return
     * @throws IOException
     */
    @ApiOperation("上传")
    @PostMapping("upload")
    public Response upload(@RequestParam MultipartFile file,@RequestParam int id,@RequestParam String description) throws IOException {
        return service.upload(file,id,description);
    }
 
    @GetMapping("getPage")
    public Response getPage(@RequestParam int pageNum,@RequestParam int pageSize,
                            @RequestParam(required = false) String snCode,
                            @RequestParam(required = false) String serialNumber,
                            @RequestParam(required = false) String materialCode){
        return service.getPage(pageNum,pageSize,snCode,serialNumber,materialCode);
    }
 
    @GetMapping("getSnCodeList")
    public Response getSnCodeList(){
        return service.getSnCodeList();
    }
 
    @GetMapping("getSerialNumberList")
    public Response getSerialNumberList(){
        return service.getSerialNumberList();
    }
 
    @GetMapping("getMaterialCodeList")
    public Response getMaterialCodeList(){
        return service.getMaterialCodeList();
    }
 
}