yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package com.qianwen.smartman.modules.system.convert;
 
import java.util.ArrayList;
import java.util.List;
import com.qianwen.smartman.modules.system.dto.ApplicationAddDTO;
import com.qianwen.smartman.modules.system.dto.ApplicationDTO;
import com.qianwen.smartman.modules.system.dto.ApplicationUpdateDTO;
import com.qianwen.smartman.modules.system.entity.Application;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/convert/ApplicationConvertImpl.class */
public class ApplicationConvertImpl implements ApplicationConvert {
    @Override // org.springblade.modules.system.convert.ApplicationConvert
    public Application convertToEntity(ApplicationDTO sources) {
        if (sources == null) {
            return null;
        }
        Application application = new Application();
        application.setDomainUrl(sources.getDomain());
        application.setId(sources.getId());
        application.setName(sources.getName());
        application.setCode(sources.getCode());
        application.setLogo(sources.getLogo());
        application.setBackgroundUrl(sources.getBackgroundUrl());
        application.setSort(sources.getSort());
        application.setRemark(sources.getRemark());
        application.setIsShow(sources.getIsShow());
        return application;
    }
 
    @Override // org.springblade.modules.system.convert.ApplicationConvert
    public ApplicationDTO convertToDTO(Application sources) {
        if (sources == null) {
            return null;
        }
        String domain = sources.getDomainUrl();
        Long id = sources.getId();
        String name = sources.getName();
        String code = sources.getCode();
        String logo = sources.getLogo();
        String backgroundUrl = sources.getBackgroundUrl();
        Integer sort = sources.getSort();
        String remark = sources.getRemark();
        Integer isShow = sources.getIsShow();
        ApplicationDTO applicationDTO = new ApplicationDTO(id, name, code, logo, backgroundUrl, domain, sort, remark, isShow);
        return applicationDTO;
    }
 
    @Override // org.springblade.modules.system.convert.ApplicationConvert
    public List<ApplicationDTO> convertToDTOList(List<Application> sources) {
        if (sources == null) {
            return null;
        }
        List<ApplicationDTO> list = new ArrayList<>(sources.size());
        for (Application application : sources) {
            list.add(convertToDTO(application));
        }
        return list;
    }
 
    @Override // org.springblade.modules.system.convert.ApplicationConvert
    public Application convertToEntity(ApplicationUpdateDTO sources) {
        if (sources == null) {
            return null;
        }
        Application application = new Application();
        application.setDomainUrl(sources.getDomain());
        application.setId(sources.getId());
        application.setName(sources.getName());
        application.setLogo(sources.getLogo());
        application.setBackgroundUrl(sources.getBackgroundUrl());
        application.setSort(sources.getSort());
        application.setRemark(sources.getRemark());
        application.setIsShow(sources.getIsShow());
        return application;
    }
 
    @Override // org.springblade.modules.system.convert.ApplicationConvert
    public Application convertToEntity(ApplicationAddDTO applicationAddDTO) {
        if (applicationAddDTO == null) {
            return null;
        }
        Application application = new Application();
        application.setDomainUrl(applicationAddDTO.getDomain());
        application.setName(applicationAddDTO.getName());
        application.setCode(applicationAddDTO.getCode());
        application.setLogo(applicationAddDTO.getLogo());
        application.setBackgroundUrl(applicationAddDTO.getBackgroundUrl());
        application.setSort(applicationAddDTO.getSort());
        application.setRemark(applicationAddDTO.getRemark());
        application.setIsShow(applicationAddDTO.getIsShow());
        return application;
    }
}