whycxzp
2022-09-07 7dd8a7a631875d68d6409f5086041d474d9226a8
src/main/java/com/whyc/controller/SoftwareController.java
@@ -4,16 +4,14 @@
import com.whyc.pojo.Software;
import com.whyc.service.SoftwareService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
@Api(tags = "软件管理-新版")
@@ -24,9 +22,9 @@
    @Autowired
    private SoftwareService service;
    @ApiModelProperty("excel解析")
    @ApiOperation("excel解析")
    @PostMapping("excelParse")
    public Response excelParse(@RequestParam MultipartFile multipartFile) throws IOException, InvalidFormatException {
    public Response excelParse(@RequestParam MultipartFile multipartFile) throws IOException, InvalidFormatException, ParseException {
        Response<Object> response = new Response<>();
        String name=multipartFile.getOriginalFilename();
        assert name != null;
@@ -39,4 +37,24 @@
        return response;
    }
    @ApiOperation("软件上传")
    @PostMapping("upload")
    public Response upload(@RequestParam MultipartFile file1,@RequestParam MultipartFile file2,@RequestParam String softwareStr){
        return null;
    }
    @ApiOperation(value = "查询软件列表的信息")
    @GetMapping("getAllSoftware")
    public Response getAllSoftware(@RequestParam(required = false) String fileName,@RequestParam int pageCurr,@RequestParam int pageSize ){
        return service.getAllSoftware(fileName,pageCurr,pageSize);
    }
    @ApiOperation(value = "根据subcode查询软件列表")
    @GetMapping("getSoftBySubCode")
    public Response getSoftBySubCode(@RequestParam String subCode ){
        return service.getSoftBySubCode(subCode);
    }
}