package com.njcn.advance.utils;

import cn.hutool.core.io.IoUtil;
import com.njcn.oss.utils.FileStorageUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.InputStream;

/**
 * pqs
 * 波形操作工具类
 * @author cdf
 * @date 2023/8/1
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class WaveUtils {

    private final FileStorageUtil fileStorageUtil;



    /**
     * 读取文件服务器波形数据
     * @author cdf
     * @date 2023/8/1
     */
    public String getFile(String filePath){
        String temJson = null;
        try(InputStream inputStream = fileStorageUtil.getFileStream(filePath)){
            temJson = IoUtil.readUtf8(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return temJson;
    }


    public static void main(String[] args) {

    }
}
