package com.ruoyi.project.business.enums;

import com.ruoyi.common.exception.ServiceErrorException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum AuditTypeEnum {

    COPYRIGHT_WRITTEN(1),
    COPYRIGHT_MUSIC(3),
    COPYRIGHT_AUDIO(4),
    CONTRACT(5),
    ISSUE(6);

    private Integer value;

    public static AuditTypeEnum from(Integer value) {
        for (AuditTypeEnum auditTypeEnum : values()) {
            if (auditTypeEnum.getValue().equals(value)) {
                return auditTypeEnum;
            }
        }
        throw new ServiceErrorException("非法的审批类型");
    }
}
