package com.microservices.pms.product.domain.enums;

import lombok.Getter;

/**
 * 产品需求状态
 *
 * @author OTTO
 */
@Getter
public enum ProductContentModifyOperation {
    CHANGING_REQ("changingReq", "进行需求变更"),
    CANCEL_CHANGE_REQ("cancelChangeReq", "取消需求变更"),
    CREATE("create", "创建"),
    EDIT("edit", "编辑");
    private final String key;
    private final String name;

    ProductContentModifyOperation(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static String getNameByKey(String key) {
        for (ProductContentModifyOperation operation : ProductContentModifyOperation.values()) {
            if (operation.getKey().equals(key)) {
                return operation.getName();
            }
        }
        return null;
    }
}
