@Mapper(componentModel = "spring")
public interface DemoConvert {
public static DemoConvert INSTANCE = mappers.getMapper(DemoConvert.class);
@AutoWired
private PersonInfoSearchService personInfoSearchService;
@Mapping(source = "name", target = "name")
@Mapping(source = "id", target = "gender", expression = "java(personInfoSearchService.searchGenderById(id))")
PersonDTO toPerson(TeacherDTO teacherDTO);
}
How to using mapstruct and springboot bean together? @autowired