package com.xunmei.system.util;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.EnumSerializer;
import lombok.Getter;

/**
 * 履职状态
 */
@JsonSerialize(using = EnumSerializer.class)
public enum ResumptionStatus {
    WAIT("履职中"),
    NORMAL("按时完成"),
    ERROR("按时完成"),
    NOT("未完成"),
    NA("无需履职"),
    DELAY("补登完成");

    /*
    public static class ResumptionStatusListConverter implements AttributeConverter<List<ResumptionStatus>, String> {
        @Override
        public String convertToDatabaseColumn(final List<ResumptionStatus> attribute) {
            return attribute == null ? "[]" : JSON.toJSONString(attribute);
        }
        @Override
        public List<ResumptionStatus> convertToEntityAttribute(final String dbData) {
            return JSON.parseArray(dbData, ResumptionStatus.class);
        }
    }
    */

    @Getter
    private final String text;

    ResumptionStatus(final String text) {
        this.text = text;
    }
}
