package com.muyu.enterprise.domain.car;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.enterprise.domain.req.car.MessageTemplateAddReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 报文模版实体类
 * @Author：李庆帅
 * @Package：com.muyu.car.domain
 * @Project：cloud-server
 * @name：MessageTemplate
 * @Date：2024/9/26 20:27
 * @Description: 报文模版
 */

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "message_template", autoResultMap = true)
public class MessageTemplate extends BaseEntity
{
    /**
     * 报文模版主键
     */
    @TableId(value = "message_template_id", type = IdType.AUTO)
    private String messageTemplateId;

    /**
     * 报文模版名称
     */
    private String messageTemplateName;

    /**
     * 报文模版描述
     */
    private String messageTemplateDescribe;

    /**
     * 报文模版添加数据转换
     * @param messageTemplateAddReq
     * @return
     */
    public static MessageTemplate addBuild(MessageTemplateAddReq messageTemplateAddReq){
        return MessageTemplate.builder()
                .messageTemplateName(messageTemplateAddReq.getMessageTemplateName())
                .messageTemplateDescribe(messageTemplateAddReq.getMessageTemplateDescribe())
                .build();
    }

}
