1. 程式人生 > >Swagger2上傳檔案方法註解

Swagger2上傳檔案方法註解

@ApiOperation(value = "合同檔案上傳", notes = "合同檔案上傳")
@ApiImplicitParam(name = "assetId", value = "憑證ID", required = true, dataType = "String", paramType = "String")
@RequestMapping(value = "/contract/upload", method = RequestMethod.POST, headers = "content-type=multipart/form-data")
@ResponseBody
public ResultEntity<Object> contractUpload(HttpServletRequest request,
	@ApiParam(value = "上傳的檔案", required = true)
	@RequestParam(value = "file", required = true) MultipartFile file,
	@RequestParam(value = "assetId", required = true) String assetId) {
		String subBusinessType = UploadFileTypeEnum.CONTRACT.getCode();
		return upload(request, file, assetId, subBusinessType);
}