swagger 檔案上傳
阿新 • • 發佈:2019-01-27
以下寫在API介面類: @ApiOperation(value = "匯入使用者", notes = "匯入使用者", response = String.class, tags = {}) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid mobile supplied", response = String.class), @ApiResponse(code = 404, message = "server not available", response = String.class) }) @RequestMapping(value = "/importCustomer", produces = { "application/json"}, method = RequestMethod.POST) ResponseEntity<String> importCustomer(@RequestParam("importFile") MultipartFile importFile); 以下是實現: public ResponseEntity<String> importCustomer(@RequestParam("importFile") MultipartFile importFile) { return new ResponseEntity<String>(