From 2c405f34c9bc32936957e45d1c38c55f5696fa46 Mon Sep 17 00:00:00 2001 From: zhangnaisong <2434969829@qq.com> Date: 星期四, 19 十月 2023 09:34:16 +0800 Subject: [PATCH] 三一车辆模型url更改提交 --- ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java index 6cd7616..cc5c32b 100644 --- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java @@ -42,6 +42,7 @@ import okhttp3.Response; import okhttp3.ResponseBody; import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.ruoyi.sy.mapper.ArdSyCarMapper; import com.ruoyi.sy.domain.ArdSyCar; @@ -79,6 +80,9 @@ RedisCache redisCache; @Resource private ArdSyCarDayMapper ardSyCarDayMapper; + + @Value("${minio.endpoint}") + private String minioEndpoint; private Map<Integer, Map<String, String>> logInMap = new HashMap(); @@ -269,8 +273,10 @@ for (Result<Item> result : myObjects) { Item item = result.get(); Map<String, String> map = new HashMap(); + String[] strArr = item.objectName().split("/"); + map.put("carType", strArr[1]); map.put("carModel", "sycar/" + item.objectName()); - switch (item.objectName()) { + /*switch (item.objectName()) { case "carmodel/aodi.glb": map.put("carType", "濂ヨ开"); break; @@ -309,11 +315,12 @@ break; default: break; - } + }*/ listObjetcName.add(map); } return listObjetcName; } catch (Exception ex) { + ex.printStackTrace(); //log.error("minio鑾峰彇妗朵笅瀵硅薄寮傚父锛�" + ex.getMessage()); } } @@ -405,8 +412,9 @@ if (result != null) { if (result.get("carPicture") != null) { if (!((String) result.get("carPicture")).equals("")) { - String url = ((String) result.get("carPicture")).split("sycar")[0]; - String carModel = url + (String) result.get("carModel"); + /*String url = ((String) result.get("carPicture")).split("sycar")[0]; + String carModel = url + (String) result.get("carModel");*/ + String carModel = this.minioEndpoint + "/" + (String) result.get("carModel"); result.put("carModel", carModel); } } @@ -617,13 +625,13 @@ for (int i = 0; i < carList.size(); i++) { ArdSyCar ardSyCar = carList.get(i); if (carId.equals(ardSyCar.getCarId())) { - String url = ""; + /*String url = ""; if (ardSyCar.getCarPicture() != null) { if (!ardSyCar.getCarPicture().equals("")) { url = ardSyCar.getCarPicture().split("sycar")[0]; } - } - m.put("carModel", url + ardSyCar.getCarModel());//zns + }*/ + m.put("carModel", this.minioEndpoint + "/" + ardSyCar.getCarModel());//zns //m.put("carModel",ardSyCar.getCarModel()); m.put("carTypeArd", ardSyCar.getCarType()); m.put("carBrand", ardSyCar.getCarBrand()); -- Gitblit v1.9.3