VlogApiService.java 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. package com.tzld.piaoquan.api.remote;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Component;
  8. @Slf4j
  9. @Component
  10. public class VlogApiService {
  11. @Autowired
  12. private HttpPoolClient httpPoolClient;
  13. private final static String SHARE_IMG_URL = "https://vlogapi.piaoquantv.com/longvideoapi/video/share/web/qrImg";
  14. public String getSharePic(String path, String appType) {
  15. JSONObject requestParam = new JSONObject();
  16. requestParam.put("page", path);
  17. requestParam.put("appType", appType);
  18. try {
  19. String resultStr = httpPoolClient.post(SHARE_IMG_URL, requestParam.toJSONString());
  20. JSONObject result = JSON.parseObject(resultStr);
  21. return result.getString("data");
  22. } catch (Exception e) {
  23. log.error("获取分享图片失败", e);
  24. }
  25. return null;
  26. }
  27. }