package com.seer.teach.mp.admin.convert;

import com.seer.teach.mp.admin.controller.resp.MpTemplateMessageResp;
import com.seer.teach.mp.admin.controller.resp.MpWxMpTemplateResp;
import com.seer.teach.mp.entity.MpTemplateMessageEntity;
import me.chanjar.weixin.mp.bean.template.WxMpTemplate;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MpWxMpTemplateConvert {

    MpWxMpTemplateConvert INSTANCE = Mappers.getMapper(MpWxMpTemplateConvert.class);

    MpWxMpTemplateResp convertOne(WxMpTemplate wxMpTemplate);

    List<MpWxMpTemplateResp> convertList(List<WxMpTemplate> wxMpTemplateList);

    /**
     * 模板消息
     * @param entity
     * @return
     */
    MpTemplateMessageResp convertMpOne(MpTemplateMessageEntity entity);

    List<MpTemplateMessageResp> convertMpList(List<MpTemplateMessageEntity> history);
}