package com.fs.watch.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;
import java.util.stream.Stream;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum WatchHealthEnum {
    EXCELLENT(1,"优秀", "您本周健康指数优秀，请继续保持，坚持测指标，坚持学习!"),
    GOOD(2,"良好","您本周健康指数良好，建议您持续关注各项健康指标，不断学习健康知识。"),
    GENERAL(3,"一般","您本周健康指数一般，部分指标出现异常，请联系您的家庭医生，加强管理。"),
    POOR(4,"需要重视","您本周健康指数显示需要重视，多个指标出现异常，请立即联系您的家庭医生进行调理。");

    private Integer value;
    private String title;
    private String desc;

    public static WatchHealthEnum toType(Integer value) {
        return Stream.of(WatchHealthEnum.values())
                .filter(p -> Objects.equals(p.value, value))
                .findAny()
                .orElse(null);
    }
}
