枚举

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()

 

posted @ 2019-10-11 18:12  我爱si搬砖  阅读(117)  评论(0编辑  收藏  举报