package com.qmth.teachcloud.common.enums.log;

import com.qmth.teachcloud.common.enums.EnumResult;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 系统自定义日志操作类型
 * @Author: CaoZixuan
 * @Date: 2022-11-29
 */
public enum OperationTypeEnum {
    LOGIN("用户登录"),
    LOGOUT("用户登出"),
    SELECT("查询"),
    ENABLE("启用/禁用"),
    SAVE("新增/修改"),
    ADD("新增"),
    DELETE("删除"),
    UPDATE("修改"),
    IMPORT("导入"),
    EXPORT("导出/下载"),
    APPROVE("审核"),
    SYNC("同步"),
    PREVIEW("预览"),
    SSO("单点登录"),
    OTHER("其它");
    private final String name;

    OperationTypeEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static List<EnumResult> listTypes() {
        List<EnumResult> list = new ArrayList<EnumResult>();
        for (OperationTypeEnum value : OperationTypeEnum.values()) {
            EnumResult result = new EnumResult();
            result.setName(value.getName());
            result.setOrdinal(value.ordinal());
            result.setCode(value.name());
            list.add(result);
        }
        return list;
    }
}
