liujie
2026-01-20 cc41e4294e639fdb399bfc9080ec2fcce6aeae3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.estate.expert.admin.domain.user;
 
import com.estate.expert.admin.domain.common.mapper.EntityRefMapper;
import com.estate.expert.admin.domain.common.mapper.IMapperBase;
import com.estate.expert.admin.utils.MappingIgnore;
import org.mapstruct.*;
 
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING, uses = {EntityRefMapper.class})
public interface UserMapper extends IMapperBase<UserDto, User> {
 
    @InheritConfiguration(name = "toEntity")
    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
//    @Mapping(target = "mobile", ignore = true) //设置了手机号不能被修改
    @MappingIgnore
    @Override
    User partialUpdate(UserDto userDto, @MappingTarget User user);
}