package com.ruoyi.ss.suit.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author wjh
 * 2024/7/17
 */
@Getter
@AllArgsConstructor
public enum SuitTimeUnit {

    DAY("1", 86400L),
    HOUR("2", 3600L),
    MINUTE("3", 60L),
    SECOND("4", 1L);

    private final String value;
    private final Long conversion;

    public static SuitTimeUnit getByValue(String value) {
        for (SuitTimeUnit suit : SuitTimeUnit.values()) {
            if (Objects.equals(suit.getValue(), value)) {
                return suit;
            }
        }
        return null;
    }

}
