// Path: src/main/java/com/chickling/kmanager/model/ElasticsearchAssistEntity.java
// public class ElasticsearchAssistEntity {
//     private String interval;
//     private List<String> indexs;
//     private Date start;
//     private Date end;
// 
//     public ElasticsearchAssistEntity() {
//         super();
//     }
// 
//     public ElasticsearchAssistEntity(String interval, List<String> indexs, Date start, Date end) {
//         super();
//         this.interval = interval;
//         this.indexs = indexs;
//         this.start = start;
//         this.end = end;
//     }
// 
//     public void setInterval(String interval) {
//         this.interval = interval;
//     }
// 
//     public String getInterval() {
//         return this.interval;
//     }
// 
//     public void setIndexs(List<String> indexs) {
//         this.indexs = indexs;
//     }
// 
//     public List<String> getIndexs() {
//         return this.indexs;
//     }
// 
//     public void setStart(Date start){
//         this.start = start;
//     }
// 
//     public Date getStart(){
//         return this.start;
//     }
//     public void setEnd(Date end){
//         this.end = end;
//     }
// 
//     public Date getEnd(){
//         return this.end;
//     }
// }


import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.time.Instant;
import java.time.LocalDate;
import com.chickling.kmanager.model.ElasticsearchAssistEntity;
    }

    public static ElasticsearchAssistEntity getInterval(String start, String end) {
        String format = "MM/dd/yyyy HH:mm";

        SimpleDateFormat sdf = new SimpleDateFormat(format);

        Date startDate;
        try {

            startDate = sdf.parse(start + " 00:00:00");
        } catch (Exception ex) {
            // yesterday
            startDate = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000);
        }
        Date endDate;
        try {
            endDate = sdf.parse(end + " 23:59:59");
            Date now = new Date();
            if (endDate.getTime() > now.getTime()) {
                endDate = now;
            }
        } catch (Exception ex) {
            endDate = new Date();
        }
        long diff = endDate.getTime() - startDate.getTime();
        int diffmin = (int) (diff / (60 * 1000));

        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
        LocalDate startLocalDate = LocalDate.parse(sdf2.format(startDate));
// Path: src/main/java/com/chickling/kmanager/model/ElasticsearchAssistEntity.java
// public class ElasticsearchAssistEntity {
//     private String interval;
//     private List<String> indexs;
//     private Date start;
//     private Date end;
// 
//     public ElasticsearchAssistEntity() {
//         super();
//     }
// 
//     public ElasticsearchAssistEntity(String interval, List<String> indexs, Date start, Date end) {
//         super();
//         this.interval = interval;
//         this.indexs = indexs;
//         this.start = start;
//         this.end = end;
//     }
// 
//     public void setInterval(String interval) {
//         this.interval = interval;
//     }
// 
//     public String getInterval() {
//         return this.interval;
//     }
// 
//     public void setIndexs(List<String> indexs) {
//         this.indexs = indexs;
//     }
// 
//     public List<String> getIndexs() {
//         return this.indexs;
//     }
// 
//     public void setStart(Date start){
//         this.start = start;
//     }
// 
//     public Date getStart(){
//         return this.start;
//     }
//     public void setEnd(Date end){
//         this.end = end;
//     }
// 
//     public Date getEnd(){
//         return this.end;
//     }
// }


// Path: src/main/java/com/chickling/kmanager/utils/elasticsearch/restapi/ScrollSearchTemplate.java
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.time.Instant;
import java.time.LocalDate;
import com.chickling.kmanager.model.ElasticsearchAssistEntity;

    }

    public static ElasticsearchAssistEntity getInterval(String start, String end) {
        String format = "MM/dd/yyyy HH:mm";

        SimpleDateFormat sdf = new SimpleDateFormat(format);

        Date startDate;
        try {

            startDate = sdf.parse(start + " 00:00:00");
        } catch (Exception ex) {
            // yesterday
            startDate = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000);
        }
        Date endDate;
        try {
            endDate = sdf.parse(end + " 23:59:59");
            Date now = new Date();
            if (endDate.getTime() > now.getTime()) {
                endDate = now;
            }
        } catch (Exception ex) {
            endDate = new Date();
        }
        long diff = endDate.getTime() - startDate.getTime();
        int diffmin = (int) (diff / (60 * 1000));

        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
        LocalDate startLocalDate = LocalDate.parse(sdf2.format(startDate));
        LocalDate endLocalDate = LocalDate.parse(sdf2.format(endDate));