package com.v1.config;

import java.util.Date;

/**
 * @serviceName ToolConfig.java
 * @author Sum1Dream
 * @version 1.0.0
 * @Description // 对外接口 方法类
 * @createTime 10:03 2022/7/26
 **/
public class ToolConfig {

    /**
    * @Author Sum1Dream
    * @name timetableCheck.java
    * @Description // 时间戳校验
    * @Date 10:08 2022/7/26
    * @Param [java.lang.Long, java.lang.Long]
    * @return java.lang.Boolean
    */
    public static Boolean timetableCheck(Long minNum , Long timetable) {

        long nd = 1000 * 24 * 60 * 60;
        long nh = 1000 * 60 * 60;
        long nm = 1000 * 60;

        // 获得两个时间的毫秒时间差异
        long diff = new Date().getTime() - timetable;

        // 计算差多少分钟
        long min = diff % nd % nh / nm;

        return min <= minNum;
    }
}
