package com.njcn.msgpush.module.push.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author caozehui
 * @data 2026-04-07
 */
@Getter
@AllArgsConstructor
public enum RetrySourceEnum {
    AUTO_RETRY("AUTO_RETRY", "系统自动重试"),
    MANUAL_RETRY("MANUAL_RETRY", "人工手动重试");

    private final String code;
    private final String desc;

    public static RetrySourceEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (RetrySourceEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}