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

import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * @description
 *   消息模板关联分类表数据模型
 *
 * @author cold_blade
 * @date 2023/9/20
 * @version 1.0
 */
@Setter
@Getter
@TableName("message_template_group")
public class MessageTemplateGroup extends BaseEntityExt<MessageTemplateGroup> implements Serializable {

    private static final long serialVersionUID = 3902204750978588588L;

    /**
     * 模板编码
     */
    private String templateCode;
    /**
     * 分类路径
     */
    private String path;

    public List<String> getPathSegments() {
        return Arrays.asList(path.split(":"));
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
