zhanghua
2023-10-21 b9c6469071fd70057fdafe02f7f6effb8ee8ebd5
bug修改
5个文件已修改
36 ■■■■ 已修改文件
ycl-platform/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/dingding/DingController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/task/SynchronizeHKVideo.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/util/VideoUtil.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/pom.xml
@@ -50,6 +50,11 @@
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/libs/artemis-http-client-1.1.8.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5.14</version>
        </dependency>
    </dependencies>
<!--    <build>-->
ycl-platform/src/main/java/com/ycl/controller/dingding/DingController.java
@@ -2,8 +2,11 @@
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.xxpt.gateway.shared.api.request.OapiMediaUploadRequest;
import com.alibaba.xxpt.gateway.shared.api.response.OapiMediaUploadResponse;
import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient;
import com.alibaba.xxpt.gateway.shared.client.http.GetClient;
import com.alibaba.xxpt.gateway.shared.client.http.IntelligentPostClient;
import com.alibaba.xxpt.gateway.shared.client.http.PostClient;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
@@ -189,6 +192,21 @@
    public CommonResult<String> getVideo(@PathVariable String mediaId) {
        String accessToken = getToken();
        //executableClient保证单例
        IntelligentPostClient intelligentPostClient = executableClient.newIntelligentPostClient("/media/upload");
        OapiMediaUploadRequest oapiMediaUploadRequest = new OapiMediaUploadRequest();
        //调用接口凭证
        oapiMediaUploadRequest.setAccess_token(accessToken);
        //媒体文件类型,分别有图片(image)、语音(voice)、普通文件(file)
        oapiMediaUploadRequest.setType("file");
        //orm-data中媒体文件标识,有filename、filelength、content-type等信息
        oapiMediaUploadRequest.setMedia("filename");
        intelligentPostClient.addFile(new File("F:\\视频\\7月29日.mp4"));
        //获取结果
        OapiMediaUploadResponse apiResult = intelligentPostClient.post(oapiMediaUploadRequest);
        MultipartFile file = getDownload(accessToken, mediaId);
        String url = ossService.uploadImages(file);
        return CommonResult.success(url);
ycl-platform/src/main/java/com/ycl/task/SynchronizeHKVideo.java
@@ -25,13 +25,13 @@
    @Autowired
    private VideoUtil videoUtil;
//    @Scheduled(cron = "0/9 * * * * ?")   // 每秒执行
//    @Scheduled(cron = "0 0/1 * ?")
//    @Scheduled(cron = "0 */5 * * * ?")   // 每5分钟执行
    @Scheduled(cron = "0 0 1 * * ?")
    @Transactional(rollbackFor = Exception.class)
    public void scheduledTask() {
        System.out.println("海康:开始执行");
        findVideoList(1, 20);
        findVideoList(1, 5);
    }
ycl-platform/src/main/java/com/ycl/util/VideoUtil.java
@@ -135,13 +135,12 @@
    private final String APP_SECRET = "LElVf9Ct3ykStZHCmFNZ";
    public PageResult<Camera> callPostCameras(Integer pageNo, Integer pageSize, String treeCode) throws Exception {
        System.out.println("海康视频-callPostCameras");
        ArtemisConfig config = new ArtemisConfig();
        System.out.println("海康视频-config");
        config.setHost(HOST); // 代理API网关nginx服务器ip端口
        config.setAppKey(APP_KEY);  // 秘钥appkey
        config.setAppSecret(APP_SECRET);// 秘钥appSecret
        System.out.println("海康视频-初始化config");
        final String getSecurityApi = ARTEMIS_PATH + "/api/resource/v1/cameras"; // 接口路径
        Map<String, String> path = new HashMap<String, String>(2) {
            {
ycl-platform/src/main/resources/application-dev.yml
@@ -35,7 +35,7 @@
        timeout: 0
  datasource:
    url: jdbc:mysql://42.193.1.25:3306/sccg?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://42.193.1.25:3306/sccg1020?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    username: root
    password: 321$YcYl@1970!
    type: com.alibaba.druid.pool.DruidDataSource