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); } }