Helius
2020-05-29 23c98be26dc3acf72236a5c97b374b00b6e3043f
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
package com.xcong.excoin.modules.test.mapper;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xcong.excoin.modules.test.dto.TestUserDto;
import com.xcong.excoin.modules.test.entity.TestUserEntity;
import com.xcong.excoin.modules.test.vo.TestUserVo;
import com.xcong.excoin.modules.test.vo.TestVo;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
 
import java.util.List;
 
/**
 * @author wzy
 * @date 2020-05-09 15:26
 **/
@Mapper
public abstract class TestUserEntityMapper {
    public static final TestUserEntityMapper INSTANCE = Mappers.getMapper(TestUserEntityMapper.class);
 
    public abstract TestUserEntity dtoToEntity(TestUserDto testUserDto);
 
    @Mapping(source = "name", target = "name")
    @Mapping(source = "password", target = "pwd")
    public abstract TestVo entityToTestVo(TestUserEntity testUserEntity);
 
    @Mapping(source = "name", target = "userName")
    public abstract TestUserVo entityToVo(TestUserEntity testUserEntity);
 
    public abstract List<TestUserVo> entityListToVoList(List<TestUserEntity> testUserEntities);
 
    public abstract Page<TestUserVo> pageEntityToPageVO(IPage<TestUserEntity> list);
}