package com.yonge.cooleshow.biz.dal.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;

/***
 * 性别
 * @author liweifan
 * @updateTime 2022/4/2 14:53
 */
public enum GenderEnum implements BaseEnum<Integer, GenderEnum> {
    GIRL(0, "女"),
    BOY(1, "男");
    @EnumValue
    private Integer code;
    private String msg;

    GenderEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    public static GenderEnum valueOf(Integer code) {
        GenderEnum[] values = GenderEnum.values();
        for (GenderEnum value : values) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
