package com.om;

import com.om.service.IDiagnosticLogService;
import com.om.utils.HuaweiObsUtil;
import com.om.utils.Result;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import static com.om.constant.UploadConstant.DIAGNOSTIC_LOG_PREFIX;

@SpringBootTest(classes = com.om.OperationApplication.class)
public class ObsTest {

    @Resource
    private HuaweiObsUtil huaweiObsUtil;

    @Resource
    private IDiagnosticLogService diagnosticLogService;

    @Test
    public void UploadTest(){

        String prefix = DIAGNOSTIC_LOG_PREFIX ;
        String uploadUrl = huaweiObsUtil.getUploadUrl(
                "20230511_170907_诊断_五菱新能源_V1_0_0_44_MCU_驱动电机.txt",
                prefix);
        System.out.println(uploadUrl);
    }

    @Test
    public void UploadTest1(){
        List<Integer> ids = new ArrayList<>();
        ids.add(1);

        Result result = diagnosticLogService.downloadFile(1);
        System.out.println(result);
    }
}
