package com.example.demo.enums; public enum ProductSatusEnum { UP(0,"在架"),DOWN(1,"下架"); private Integer code; private String message; ProductSatusEnum(Integer code, String message) { this.code = code; this.message = message; } }
使用:
ProductSatusEnum.UP.getCode()