package com.yiqi.common.enums;

/**
 * @author douya
 * @description 延迟查询时间
 * @date 2022/7/14
 */
public enum PayQueryTimesEnum {

	one(1, 2 * 1L),

	two(2, 3 * 1L),

	three(3, 3 * 1L),

	four(4, 3 * 1L),

	five(5, 3 * 1L),

	six(6, 4 * 1L),

	seven(7, 3 * 1L),

	eight(8, 4 * 1L),

	night(9, 3 * 1L),

	ten(10, 4 * 1L),

	eleven(11, 6 * 1L),

	twelve(12, 10 * 1L),

	thirteen(13, 20 * 1L),

	fourteen(14, 60 * 5L),

	fifteen(15, 60 * 60 * 2L),

	sixteen(16, 60 * 60 * 4L);


	private Integer num;

	private Long delayTime;

	PayQueryTimesEnum(Integer num, Long delayTime) {
		this.num = num;
		this.delayTime = delayTime;
	}

	public static Long getDelayTime(Integer queryNum) {
		for (PayQueryTimesEnum queryTimesEnum : PayQueryTimesEnum.values()) {
			if (queryTimesEnum.num.equals(queryNum)) {
				return queryTimesEnum.delayTime;
			}
		}
		return one.delayTime;
	}
}
