whycxzp
15 小时以前 5fd800ce3a0bf46ef9ad3ca865b9cad5c8751a18
src/main/java/com/whyc/controller/DeviceSpareController.java
@@ -11,6 +11,7 @@
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@@ -42,12 +43,31 @@
        return service.add(spare,file);
    }
    @PostMapping("addByExcel")
    @ApiOperation("excel导入")
    public Response addByExcel(@RequestParam MultipartFile file) throws IOException {
        return service.addByExcel(file);
    }
    @ApiOperation("excel导出")
    @GetMapping("excelExport")
    public void excelExport(HttpServletResponse response) {
        service.excelExport(response);
    }
    @PostMapping("update")
    @ApiOperation("修改")
    public Response update(@RequestBody DeviceSpare spare) {
        return service.update(spare);
    }
    @PostMapping("andOrChangePicture")
    @ApiOperation("新增或者替换图片")
    public Response andOrChangePicture(@RequestParam Integer id,@RequestParam MultipartFile file) throws IOException {
        return service.andOrChangePicture(id,file);
    }
    @PostMapping("delete")
    @ApiOperation("删除")
    public Response delete(@RequestParam Integer id) {