package com.tofly.base.anno;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.tofly.base.config.DisplayTextSerializer;

import java.lang.annotation.*;

/**
 * 定义实体字段转换注解
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@JacksonAnnotationsInside
@JsonSerialize(using = DisplayTextSerializer.class)
public @interface DisplayText {

    /**
     * 转换器
     * @return
     */
    Class<?> converter();

    /**
     * 分组
     * @return
     */
    String[] group() default {"ALL"};

    /**
     * 后缀
     * @return
     */
    String suffix() default "Text";
}
