| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.modular.system.model.enums.ImageModelEnum; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | |
| | | */ |
| | | private static List<String> closedTopModel(String url){ |
| | | try { |
| | | String fileName = url.substring(url.lastIndexOf(".")); |
| | | URLConnection urlConnection = new URL(url).openConnection(); |
| | | urlConnection.connect(); |
| | | InputStream inputStream = urlConnection.getInputStream(); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath + UUIDUtil.getTimeStr() + fileName); |
| | | inputStream.close(); |
| | | return closedTopModel(file); |
| | | } catch (MalformedURLException e) { |
| | |
| | | */ |
| | | private static List<String> cameraFaultModel(String url){ |
| | | try { |
| | | String fileName = url.substring(url.lastIndexOf(".")); |
| | | URLConnection urlConnection = new URL(url).openConnection(); |
| | | urlConnection.connect(); |
| | | InputStream inputStream = urlConnection.getInputStream(); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath + UUIDUtil.getTimeStr() + fileName); |
| | | inputStream.close(); |
| | | return cameraFaultModel(file); |
| | | } catch (MalformedURLException e) { |
| | |
| | | */ |
| | | private static List<String> constructionWasteLoadModel(String url){ |
| | | try { |
| | | String fileName = url.substring(url.lastIndexOf(".")); |
| | | URLConnection urlConnection = new URL(url).openConnection(); |
| | | urlConnection.connect(); |
| | | InputStream inputStream = urlConnection.getInputStream(); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath); |
| | | File file = FileUtil.writeFromStream(inputStream, filePath + UUIDUtil.getTimeStr() + fileName); |
| | | inputStream.close(); |
| | | return constructionWasteLoadModel(file); |
| | | } catch (MalformedURLException e) { |