package cn.axzo.msg.center.domain.entity;

import cn.axzo.foundation.dao.support.mysql.type.BaseListTypeHandler;
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
import cn.axzo.msg.center.domain.utils.StringListTypeHandler;
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author yanglin
 */
@Setter
@Getter
@Accessors(chain = true)
@TableName(value = "card_style", autoResultMap = true)
public class CardStyle extends BaseEntityExt<CardStyle> {

    /**
     * 样式名称
     */
    private String name;

    /**
     * 样式code, 唯一
     */
    private String code;

    /**
     * 预览大图
     */
    @TableField(typeHandler = StringListTypeHandler.class)
    private List<String> previewImages;

    /**
     * 卡片元素配置
     */
    @TableField(typeHandler = CardElementConfigTypeHandler.class)
    private List<CardElementConfig> elementConfigs;

    // @formatter:off
    public static class CardElementConfigTypeHandler
            extends BaseListTypeHandler<CardElementConfig> {}
    // @formatter:on

}