瀏覽代碼

Merge remote-tracking branch 'origin/test'

songyh 4 年之前
父節點
當前提交
608a7e0771

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -19,6 +19,8 @@ import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.HttpMultipartMode;
 import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.CloseableHttpClient;
@@ -33,6 +35,7 @@ import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.HttpURLConnection;
 import java.net.URI;
 import java.net.URI;
 import java.net.URL;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -269,6 +272,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
             // 其他参数
             // 其他参数
             entityBuilder.addTextBody("advertiser_id", String.valueOf(token.getAccountId()));
             entityBuilder.addTextBody("advertiser_id", String.valueOf(token.getAccountId()));
             entityBuilder.addTextBody("video_signature", DigestUtils.md5Hex(new FileInputStream(new File(videoPath))));
             entityBuilder.addTextBody("video_signature", DigestUtils.md5Hex(new FileInputStream(new File(videoPath))));
+            entityBuilder.addTextBody("filename",file.getFilename(), ContentType.create("text/plain", Charset.forName("UTF-8")));
             HttpEntity entity = entityBuilder.build();
             HttpEntity entity = entityBuilder.build();
             client = HttpClientBuilder.create().build();
             client = HttpClientBuilder.create().build();
             httpPost.setURI(URI.create(url));
             httpPost.setURI(URI.create(url));

+ 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;
 package cn.com.ctop.toutiao.modules.material.service.impl;
 
 
 import cn.com.ctop.common.module.utils.Check;
 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.entity.BytedanceVideoSlogenInfo;
 import cn.com.ctop.toutiao.modules.material.mapper.BytedanceVideoSlogenInfoMapper;
 import cn.com.ctop.toutiao.modules.material.mapper.BytedanceVideoSlogenInfoMapper;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
 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++){
         for(int i=0;i<slogans.size();i++){
             JSONObject sloganObject = slogans.getJSONObject(i);
             JSONObject sloganObject = slogans.getJSONObject(i);
             String title = sloganObject.getString("title");
             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();
             String creativeWordIds = Check.isNull(sloganObject.getJSONArray("creative_word_ids")) ? "" : sloganObject.getJSONArray("creative_word_ids").toJSONString();
             BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,title,userId,creativeWordIds);
             BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,title,userId,creativeWordIds);
             this.save(slogenInfo);
             this.save(slogenInfo);