package com.red.circle.other.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 图片审核状态枚举
 */
@Getter
@AllArgsConstructor
public enum PhotoAuditStatus {

  PENDING(0, "待审核"),
  APPROVED(1, "审核通过"),
  REJECTED(2, "审核拒绝");

  private final Integer code;
  private final String desc;

  public static PhotoAuditStatus of(Integer code) {
    if (code == null) {
      return null;
    }
    for (PhotoAuditStatus status : values()) {
      if (status.code.equals(code)) {
        return status;
      }
    }
    return null;
  }

}
