package cn.iocoder.yudao.module.system.api.notify.convert.message;

import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.Map;

@Mapper
public interface UserMessageConvert {

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

    @Mapping(target = "mobile", ignore = true)
    @Mapping(source = "userId", target = "userId")
    @Mapping(source = "templateCode", target = "templateCode")
    @Mapping(source = "templateParams", target = "templateParams")
    SmsSendSingleToUserReqDTO convert(Long userId, String templateCode, Map<String, Object> templateParams);

    @Mapping(source = "userId", target = "userId")
    @Mapping(source = "pkMessage", target = "pkMessage")
    @Mapping(source = "pkMessage2", target = "pkMessage2")
    @Mapping(source = "gotoUrl", target = "gotoUrl")
    @Mapping(source = "templateCode", target = "templateCode")
    @Mapping(source = "templateParams", target = "templateParams")
    @Mapping(source = "businessType", target = "businessType")
    @Mapping(source = "notifyType", target = "notifyType")
    @Mapping(source = "priority", target = "priority")
    @Mapping(source = "completedStatus", target = "completedStatus")
    @Mapping(source = "tenantId", target = "tenantId")
    NotifySendSingleToUserReqDTO messageConvert(Long userId, String pkMessage, String pkMessage2, String gotoUrl,
                                                String templateCode, Map<String, Object> templateParams,
                                                Integer businessType, Integer notifyType, Integer priority, Integer completedStatus, Long tenantId);


}
