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