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
package com.qianwen.smartman.modules.notify.convert;
 
import java.util.ArrayList;
import java.util.List;
import com.qianwen.smartman.modules.notify.dto.NotifySubscriberDTO;
import com.qianwen.smartman.modules.notify.entity.NotifySubscriberEntity;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotifySubscriberConvertImpl.class */
public class NotifySubscriberConvertImpl implements NotifySubscriberConvert {
    @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert
    public NotifySubscriberEntity convertToEntity(NotifySubscriberDTO sources) {
        if (sources == null) {
            return null;
        }
        NotifySubscriberEntity notifySubscriberEntity = new NotifySubscriberEntity();
        if (sources.getId() != null) {
            notifySubscriberEntity.setId(Long.valueOf(Long.parseLong(sources.getId())));
        }
        notifySubscriberEntity.setStatus(sources.getStatus());
        notifySubscriberEntity.setSubscriber(sources.getSubscriber());
        notifySubscriberEntity.setBusinessKey(sources.getBusinessKey());
        notifySubscriberEntity.setBusinessName(sources.getBusinessName());
        notifySubscriberEntity.setDescription(sources.getDescription());
        return notifySubscriberEntity;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert
    public NotifySubscriberDTO convertToDto(NotifySubscriberEntity sources) {
        if (sources == null) {
            return null;
        }
        NotifySubscriberDTO notifySubscriberDTO = new NotifySubscriberDTO();
        if (sources.getId() != null) {
            notifySubscriberDTO.setId(String.valueOf(sources.getId()));
        }
        notifySubscriberDTO.setSubscriber(sources.getSubscriber());
        notifySubscriberDTO.setBusinessKey(sources.getBusinessKey());
        notifySubscriberDTO.setBusinessName(sources.getBusinessName());
        notifySubscriberDTO.setDescription(sources.getDescription());
        notifySubscriberDTO.setStatus(sources.getStatus());
        return notifySubscriberDTO;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert
    public List<NotifySubscriberDTO> convertToDTOList(List<NotifySubscriberEntity> sources) {
        if (sources == null) {
            return null;
        }
        List<NotifySubscriberDTO> list = new ArrayList<>(sources.size());
        for (NotifySubscriberEntity notifySubscriberEntity : sources) {
            list.add(convertToDto(notifySubscriberEntity));
        }
        return list;
    }
}