/** * 2.37 更改头像 * * @param userId 用户ID * @param token 用户会话Token * @return 返回结果对象 */ @RequestMapping( value = "/user/{userId}/avatar", method = RequestMethod.POST, headers = "Content-Type=multipart/form-data") public ResponseDo alterAvatar( @PathVariable(value = "userId") String userId, @RequestParam("attach") MultipartFile attach, @RequestParam("token") String token) { LOG.info("reUploadUserPhoto attach size: {}", attach.getSize()); try { return service.reUploadUserPhoto(userId, attach, token); } catch (ApiException e) { LOG.warn(e.getMessage(), e); return ResponseDo.buildFailureResponse("上传文件失败"); } }