package com.ycwl.basic.image.watermark.enums;

import lombok.Getter;

@Getter
public enum ImageWatermarkOperatorEnum {
    LEICA("leica", "jpg"),
    NORMAL("normal", "jpg"),
    PRINTER_DEFAULT("pDefault", "jpg"),
    PUZZLE_PRINT("puzzle_print", "jpg");

    private final String type;
    private final String preferFileType;

    ImageWatermarkOperatorEnum(String type, String preferFileType) {
        this.type = type;
        this.preferFileType = preferFileType;
    }

    public static ImageWatermarkOperatorEnum getByCode(String type) {
        for (ImageWatermarkOperatorEnum imageWatermarkOperatorEnum : ImageWatermarkOperatorEnum.values()) {
            if (imageWatermarkOperatorEnum.type.equals(type)) {
                return imageWatermarkOperatorEnum;
            }
        }
        return null;
    }
}
