| | |
| | | package com.yami.trading.api.controller; |
| | | |
| | | import com.yami.trading.common.constants.Constants; |
| | | import com.yami.trading.common.domain.Result; |
| | | import com.yami.trading.common.exception.YamiShopBindException; |
| | | import com.yami.trading.service.AwsS3OSSFileService; |
| | |
| | | @RequestMapping(value = basePath + "!execute.action") |
| | | public Result<String> execute(MultipartFile file) { |
| | | if (file.getSize() / 1024L > 30720L) { |
| | | return Result.failed("图片大小不能超过30M"); |
| | | return Result.failed("Image size cannot exceed 30MB"); |
| | | } |
| | | String path = awsS3OSSFileService.uploadFile("chat", file); |
| | | return Result.succeed(awsS3OSSFileService.getUrl(path)); |
| | | return Result.succeed(Constants.IMAGES_HTTP+path); |
| | | } |
| | | } |