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) throws IOException {
|
return service.upload(file,id);
|
}
|
|
@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();
|
}
|
|
}
|