@Mapper public interface PersonMapper {
PersonMapper INSTANCE = Mappers.getMapper(PersonMapper.class);
@Mapping(source = "name", target = "name")
@Mapping(source = "age", target = "age")
PersonDto personToPersonDto1(Person person, @MappingTarget PersonDto personDto);
@Mapping(source = "name", target = "name")
@Mapping(source = "age", target = "age")
PersonDto personToPersonDto2(Person person, @MappingTarget PersonDto personDto);
@Mapping(source = "name", target = "name")
@Mapping(source = "age", target = "age")
PersonDto personToPersonDto3(Person person);
@AfterMapping
default void updateAdditionalInfo(@MappingTarget PersonDto personDto) {
// 在每个映射方法完成后依次调用
personDto.setAdditionalInfo("Some additional information");
iii
iii
我不想打听@AfterMapping
我没有找到实现这一目标的方法。