package com.cpop.common.enums;

/**
 * @author DB
 */
public enum CycleEnum {
    /**
     * 日
     */
    DAY(1, "每天"),
    /**
     * 月
     */
    MONTH(2, "月"),
    /**
     * 季
     */
    WEEK(3, "季"),
    /**
     * 年
     */
    YEAR(4, "年");

    private int codeId;
    private String message;

    CycleEnum(int codeId, String message) {
        this.codeId = codeId;
        this.message = message;
    }

    public static CycleEnum getCycle(int code) {
        for (CycleEnum c : CycleEnum.values()) {
            if (c.codeId == code) {
                return c;
            }
        }
        return null;
    }

    public int getCodeId() {
        return codeId;
    }

    public void setCodeId(int codeId) {
        this.codeId = codeId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
