فهرست منبع

视频文案保存insert时title中{{替换成{

huangxuechao 4 سال پیش
والد
کامیت
584750c4ae

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceVideoSlogenInfoServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.toutiao.modules.material.service.impl;
 
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
 import cn.com.ctop.toutiao.modules.material.mapper.BytedanceVideoSlogenInfoMapper;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
@@ -28,6 +29,8 @@ public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVi
         for(int i=0;i<slogans.size();i++){
             JSONObject sloganObject = slogans.getJSONObject(i);
             String title = sloganObject.getString("title");
+            title = title.replaceAll("\\{\\{","{");
+            title = title.replaceAll("\\}\\}","}");
             String creativeWordIds = Check.isNull(sloganObject.getJSONArray("creative_word_ids")) ? "" : sloganObject.getJSONArray("creative_word_ids").toJSONString();
             BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,title,userId,creativeWordIds);
             this.save(slogenInfo);