package cn.iocoder.yudao.module.system.enums.robot.statistics;

import cn.iocoder.yudao.module.system.enums.path.PathTaskTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum DurationTypeEnum {
    FREE_TIME(0,"空闲时长"),
    TASK_TIME(1,"任务时长"),
    CHARGE_TIME(2,"充电时长");
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 说明
     */
    private final String msg;

    /**
     * 获取工作时长的类型
     * @return
     */
    public static Integer getDurationTypeByTaskType(String commonType) {
        if (PathTaskTypeEnum.CHARGE.getType().equals(commonType)
            || PathTaskTypeEnum.AUTO_CHARGE.getType().equals(commonType)) {
            return CHARGE_TIME.type;
        }
        return TASK_TIME.type;
    }
}
