package org.jeecg;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.util.security.SecurityTools;
import org.jeecg.common.util.security.entity.*;
import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;

public class SecurityToolsTest {
    @Test
    public void Test(){
        System.out.println(JSONObject.toJSONString(getMonthDate(3)));
    }

    //获取指定月份日期
    public static ArrayList<String> getMonthDate(int day){
        Calendar calendar = Calendar.getInstance();
        ArrayList<String> dataList=new ArrayList<>();
        int month = calendar.get(Calendar.MONTH);
        calendar.set(Calendar.MONTH, (month + 3) / 3 * 3);
        for (int i = 0; i < day; i++) {
            calendar.add(Calendar.MONTH,i);
            calendar.set(Calendar.DATE,1);
            dataList.add(new SimpleDateFormat("yyyy-MM").format(calendar.getTime()));
        }
        return dataList;
    }
}
