Jelajahi Sumber

修改素材库类型

yumeng 5 tahun lalu
induk
melakukan
fd94f60658

+ 3 - 6
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -89,7 +89,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public Map<String, Object> insert(JSONObject jsonObject) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
-            Boolean isVideo = imgLocation(jsonObject.getString("url"));
+            // Boolean isVideo = imgLocation(jsonObject.getString("url"));
+            String type = jsonObject.getString("type");
             MaterialInfo info = new MaterialInfo();
             info.setId(jsonObject.getString("code"));
             info.setCode(jsonObject.getString("code"));
@@ -109,11 +110,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             info.setMaterialDescribe(jsonObject.getString("materialDescribe"));
             info.setCreateTime(new Date());
             info.setUpdateTime(new Date());
-            if (isVideo) {
-                info.setType("VIDEO");
-            } else {
-                info.setType("IMAGE");
-            }
+            info.setType(type);
             this.save(info);
             Map<String, Object> deleteMap = new HashMap<>();
             deleteMap.put("material_id", info.getId());