| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil ; |
| | | import com.stylefeng.guns.modular.system.util.huawei.OBSUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | |
| | | import java.io.InputStream; |
| | | |
| | | @Controller |
| | | public class UediterController { |
| | |
| | | String pictureName = ""; |
| | | try { |
| | | //文件上传,具体根据实际替换 |
| | | pictureName = OssUploadUtil.ossUpload(request, picture); |
| | | InputStream inputStream = picture.getInputStream(); |
| | | String name = picture.getOriginalFilename(); |
| | | name = UUIDUtil.getRandomCode() + name.substring(name.lastIndexOf(".")); |
| | | pictureName = OBSUtil.putObjectToBucket(inputStream, name); |
| | | // pictureName = OssUploadUtil.ossUpload(request, picture); |
| | | |
| | | String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; |
| | | if (callback == null) { |