package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 操作类型 用于区别增删改操作
 */
@AllArgsConstructor
@Getter
public enum EControlType {

    /**
     * 新增
     */
    SAVE(1, "新增", EnumsPrefixConstants.CONTROL_TYPE + "1"),

    /**
     * 修改
     */
    MODIFY(2, "修改", EnumsPrefixConstants.CONTROL_TYPE + "2"),

    /**
     * 删除
     */
    DELETE(3, "删除", EnumsPrefixConstants.CONTROL_TYPE + "3");

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 国际化翻译key值
     */
    private final String key;

    public static EApprovalBusiness getStoreBusiness(int value) {
        if (value == EControlType.MODIFY.value) {
            return EApprovalBusiness.CU_STORE_MODIFY;
        } else if (value == EControlType.DELETE.value) {
            return EApprovalBusiness.CU_STORE_DELETE;
        } else {
            return EApprovalBusiness.CU_STORE_SAVE;
        }
    }


}
