| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | @Api(tags = "图片上传接口") |
| | | public class CommonController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | |
| | | * 通用上传请求(单个) |
| | | */ |
| | | @PostMapping("/upload") |
| | | @ApiOperation(value = "上传图片 MultipartFile file") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception |
| | | { |
| | | try |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("上传文件图片报错:", e); |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("上传文件图片报错:", e); |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |