package com.syjy.calculate.function;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.googlecode.aviator.runtime.function.AbstractFunction;
import com.googlecode.aviator.runtime.type.*;
import java.util.Map;

/**
 * 计算合格率
 *
 * @author zcl
 * @version 1.0
 * @since 2022/9/8 9:30
 */
public class GetBeginOfDay extends AbstractFunction {
    /**
     *
     * @param env
     * @return
     */
    @Override
    public AviatorObject call(Map<String, Object> env) {
        long toDayZero = DateUtil.beginOfDay(DateTime.now()).getTime();
        return AviatorRuntimeJavaType.valueOf(toDayZero);
    }
    @Override
    public String getName() {
        return "getBeginOfDay";
    }
}
