package com.yzt.airconditionersystem;

import com.yzt.airconditionersystem.bean.Alarm;
import com.yzt.airconditionersystem.bean.Operator;
import com.yzt.airconditionersystem.bean.Project;
import com.yzt.airconditionersystem.enums.AlarmStatusEnum;
import com.yzt.airconditionersystem.mapper.AlarmMapper;
import com.yzt.airconditionersystem.service.AlarmService;
import com.yzt.airconditionersystem.service.OperatorService;
import com.yzt.airconditionersystem.service.ProjectService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @author TzZach
 * @since 2022-04-24 20:49
 */
@SpringBootTest
public class AlarmTest {

    @Autowired
    private AlarmService alarmService;
    @Autowired
    private ProjectService projectService;
    @Autowired
    private OperatorService operatorService;

    @Test
    public void testInsert() {
//        List<Alarm> alarmList = new ArrayList<>();
//        List<Project> projects = projectService.list();
//        List<Operator> operators = operatorService.list();
//        for (int i = 0; i < 100; i++) {
//            Alarm alarm = new Alarm(null, projects.get(i).getClientName(),
//                    operators.get(i).getId(), operators.get(i).getCompanyName(),
//                    "广东省广州市", "xx类型", LocalDateTime.now(), AlarmStatusEnum.HANDLED);
//            alarmList.add(alarm);
//        }
//        alarmService.saveBatch(alarmList);

    }

}
