yangys
2024-03-29 4b479381a65bd3ef526cb92631d3550f2aa17459
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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;
    }
}