package com.xxfc.platform.vehicle;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.file.FileWriter;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.xxfc.platform.vehicle.biz.SysRegionBiz;
import com.xxfc.platform.vehicle.entity.SysRegion;
import lombok.Data;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes={VehicleApplication.class})
public class TimeTest {

    public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
    @Test
    public void test() throws Exception {
        DateTime startDay =DateTime.parse("2019-06-04", DEFAULT_DATE_TIME_FORMATTER);
        System.out.println("test");
    }


    @Test
    public void testStream() throws Exception {
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("张1","11"));
        students.add(new Student("张2","12"));
        students.add(new Student("张3","13"));
        students.add(new Student("张4","14"));
        students.add(new Student("张5","15"));
        int i=0;
        students.forEach(student -> student.setCode(1));
        students.forEach(System.out::println);

    }


}

@Data
class Student implements Serializable {
    private String name;
    private String age;
    private int code;

    public Student(String name, String age, int code) {
        this.name=name;
        this.age=age;
        this.code=code;
    }
    public Student(String name, String age) {
        this.name=name;
        this.age=age;
    }
}
