package zy.cloud.wms.common.model.enums; import com.core.exception.CoolException; public enum VisitType { CUSTOMER(1L, "Customer/客户"), SUPPLIER(2L, "Supplier供应商"), OTHER(3L, "other/其他"), ; private Long id; private String msg; VisitType(Long id, String msg) { this.id = id; this.msg = msg; } public static VisitType get(Long id) { VisitType[] types = VisitType.values(); for (VisitType type : types) { if (id.equals(type.getId())) { return type; } } throw new CoolException("500-访客类型错误,id=" + id); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } }