package com.qianwen.smartman.modules.notify.convert;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import com.qianwen.smartman.modules.notify.dto.Notification;
|
import com.qianwen.smartman.modules.notify.entity.NotificationEntity;
|
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotificationConvertImpl.class */
|
public class NotificationConvertImpl implements NotificationConvert {
|
@Override // org.springblade.modules.notify.convert.NotificationConvert
|
public NotificationEntity convertToEntity(Notification sources) {
|
if (sources == null) {
|
return null;
|
}
|
NotificationEntity notificationEntity = new NotificationEntity();
|
if (sources.getId() != null) {
|
notificationEntity.setId(Long.valueOf(Long.parseLong(sources.getId())));
|
}
|
notificationEntity.setSubscribeId(sources.getSubscribeId());
|
notificationEntity.setSubscriber(sources.getSubscriber());
|
notificationEntity.setBusinessKey(sources.getBusinessKey());
|
notificationEntity.setBusinessName(sources.getBusinessName());
|
notificationEntity.setMessage(sources.getMessage());
|
notificationEntity.setNotifyTime(sources.getNotifyTime());
|
return notificationEntity;
|
}
|
|
@Override // org.springblade.modules.notify.convert.NotificationConvert
|
public Notification convertToDto(NotificationEntity sources) {
|
if (sources == null) {
|
return null;
|
}
|
Notification notification = new Notification();
|
if (sources.getId() != null) {
|
notification.setId(String.valueOf(sources.getId()));
|
}
|
notification.setSubscribeId(sources.getSubscribeId());
|
notification.setSubscriber(sources.getSubscriber());
|
notification.setBusinessKey(sources.getBusinessKey());
|
notification.setBusinessName(sources.getBusinessName());
|
notification.setMessage(sources.getMessage());
|
notification.setNotifyTime(sources.getNotifyTime());
|
return notification;
|
}
|
|
@Override // org.springblade.modules.notify.convert.NotificationConvert
|
public List<Notification> convertToDTOList(List<NotificationEntity> sources) {
|
if (sources == null) {
|
return null;
|
}
|
List<Notification> list = new ArrayList<>(sources.size());
|
for (NotificationEntity notificationEntity : sources) {
|
list.add(convertToDto(notificationEntity));
|
}
|
return list;
|
}
|
}
|