package com.iailab.module.data.video.dahua;

import com.iailab.module.data.video.config.VideoConfiguration;
import com.iailab.netsdk.lib.ToolKits;

import java.io.File;
import java.util.Date;

/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年03月06日
 */
public class DHSavePath {

    private DHSavePath() {}

    private static DHSavePath instance = new DHSavePath();

    public static DHSavePath getSavePath() {
        return instance;
    }

    /**
     * 设置抓图保存路径
     *
     * @return
     */
    public String getSaveCapturePath(String channel, Date curDate) {
        File path1 = new File(VideoConfiguration.staticDhCapturePath);
        if (!path1.exists()) {
            path1.mkdir();
        }

        File path2 = new File(VideoConfiguration.staticDhCapturePath + ToolKits.getDay() + "/" + channel + "/");
        if (!path2.exists()) {
            path2.mkdirs();
        }

        String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate(curDate) + ".jpg";

        return strFileName;
    }

    /**
     * 设置模型输出图片保存路径
     *
     * @param cameraCode
     * @param curDate
     * @return
     */
//    public String getSaveModelPath(String cameraCode, Date curDate) throws IOException {
////        File path1 = new File(modelPath);
////        if (!path1.exists()) {
////            path1.mkdir();
////        }
//
//        File path2 = new File(DHConfiguration.staticModelPath + ToolKits.getDay() + "/" + cameraCode + "/");
////        if (!path2.exists()) {
////            path2.mkdirs();
////        }
//        //return path2.getAbsolutePath() + "/";
//        return path2.getAbsolutePath();
//    }
}