package com.kingtom.shengtai.api.mapper;

import com.kingtom.shengtai.api.model.MsgSummaryDTO;
import com.kingtom.shengtai.app.message.model.MsgSummary;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 应用模块名称</p>
 * 代码描述</p>
 * Copyright: Copyright (C) 2023 , Inc. All rights reserved. <p>
 * Company: 成都诚唐科技有限责任公司</p>
 *
 * @author wany
 * @since 2023/12/27
 */
@Mapper
public interface MsgMapper{

    public static final MsgMapper INSTANCE = Mappers.getMapper(MsgMapper.class);

    @Mapping(target = "gmtCreate", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "gmtModified", dateFormat = "yyyy-MM-dd HH:mm:ss")
    MsgSummary convert(MsgSummaryDTO dto);

    @Mapping(target = "gmtCreate", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "gmtModified", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "read", ignore = true)
    MsgSummaryDTO convert(MsgSummary dto);

}
