package com.sptg.device.api;

import com.baomidou.mybatisplus.toolkit.IdWorker;
import com.sptg.common.core.interfaces.VoidInterface;
import lombok.Getter;
import lombok.Setter;
import org.junit.Test;

/**
 * title: JunityTest
 * package: com.sptg.device.api
 * description:
 *
 *
 *
 */
public class JunityTest {

    @Getter
    @Setter
    private static class ClassA{

        private Long id;
        private String name;
        private Long num;

        ClassA(Long id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    private static class ClassB implements VoidInterface<ClassA> {
        @Override
        public void run(ClassA classA) {
            classA.setNum(IdWorker.getId());
        }
    }

    @Test
    public void mainTest(){
        int j = 0;
        for (int i = 0; i < 10; i ++){
            System.out.println(++j);
        }
        System.out.println(j);
//        List<ClassA> list = new ArrayList<>(5);
//        for (int i = 1; i < 6; i++){
//            list.add(new ClassA((long)i,"" + i));
//        }
//        System.out.println("1.----------------------------------------------");
//        list.forEach(item -> System.out.println(JsonUtils.objectToJson(item)));
//        VoidInterface<ClassA> voidInterface = new ClassB();
//        list.forEach(voidInterface :: run);
//        System.out.println("2.----------------------------------------------");
//        list.forEach(item -> System.out.println(JsonUtils.objectToJson(item)));
//
//        System.out.println(LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));

    }
}
