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
58
59
60
61
62
63
64
65
package com.qianwen.smartman.modules.notify.convert;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.qianwen.smartman.modules.notify.dto.NotifyConfigDTO;
import com.qianwen.smartman.modules.notify.entity.NotifyConfigEntity;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotifyConfigConvertImpl.class */
public class NotifyConfigConvertImpl implements NotifyConfigConvert {
    @Override // org.springblade.modules.notify.convert.NotifyConfigConvert
    public NotifyConfigEntity convertToEntity(NotifyConfigDTO sources) {
        if (sources == null) {
            return null;
        }
        NotifyConfigEntity notifyConfigEntity = new NotifyConfigEntity();
        if (sources.getId() != null) {
            notifyConfigEntity.setId(Long.valueOf(Long.parseLong(sources.getId())));
        }
        notifyConfigEntity.setTenantId(sources.getTenantId());
        notifyConfigEntity.setName(sources.getName());
        notifyConfigEntity.setType(sources.getType());
        notifyConfigEntity.setProvider(sources.getProvider());
        notifyConfigEntity.setDescription(sources.getDescription());
        Map<String, Object> map = sources.getConfiguration();
        if (map != null) {
            notifyConfigEntity.setConfiguration(new HashMap(map));
        }
        return notifyConfigEntity;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifyConfigConvert
    public NotifyConfigDTO convertToDto(NotifyConfigEntity sources) {
        if (sources == null) {
            return null;
        }
        NotifyConfigDTO notifyConfigDTO = new NotifyConfigDTO();
        if (sources.getId() != null) {
            notifyConfigDTO.setId(String.valueOf(sources.getId()));
        }
        notifyConfigDTO.setName(sources.getName());
        notifyConfigDTO.setType(sources.getType());
        notifyConfigDTO.setProvider(sources.getProvider());
        notifyConfigDTO.setDescription(sources.getDescription());
        Map<String, Object> map = sources.getConfiguration();
        if (map != null) {
            notifyConfigDTO.setConfiguration(new HashMap(map));
        }
        notifyConfigDTO.setTenantId(sources.getTenantId());
        return notifyConfigDTO;
    }
 
    @Override // org.springblade.modules.notify.convert.NotifyConfigConvert
    public List<NotifyConfigDTO> convertToDTOList(List<NotifyConfigEntity> sources) {
        if (sources == null) {
            return null;
        }
        List<NotifyConfigDTO> list = new ArrayList<>(sources.size());
        for (NotifyConfigEntity notifyConfigEntity : sources) {
            list.add(convertToDto(notifyConfigEntity));
        }
        return list;
    }
}