package com.ruoyi.system.domain.enums; public enum ImageTypeEnum { DEFAULT(0, "默认"), INFORMED_CONSENT(1, "知情同意书"), BRZL(2, "病人资料"), CZJL(3, "操作记录"), CCQ(4, "出车前"), CCH(5, "出车后"), SEAT_BELT(6, "绑安全带图片"); // 知情同意书 1 // 病人资料 2 // 操作记录 3 // 出车前 4 // 出车后 5 // 系安全带 6 private final Integer code; private final String description; ImageTypeEnum(Integer code, String description) { this.code = code; this.description = description; } public Integer getCode() { return code; } public String getDescription() { return description; } /** * 根据代码获取枚举 */ public static ImageTypeEnum getByCode(Integer code) { if (code == null) { return DEFAULT; } for (ImageTypeEnum type : values()) { if (type.getCode().equals(code)) { return type; } } return DEFAULT; } /** * 判断是否为知情同意书 */ public boolean isInformedConsent() { return this == INFORMED_CONSENT; } /** * 判断是否为绑安全带图片 */ public boolean isSeatBelt() { return this == SEAT_BELT; } }