Answer the question
In order to leave comments, you need to log in
How to properly organize a facade for a service?
Help me figure it out, there is a Spring Boot application, you need to make a facade, the "feature" is what we get Map from the controller into the facade method, we return PageDto, universal pagination is written, the getPageDto method, this method with the same parameters and the same return type, should demonstrate different behavior (output all posts or by user/topic...)
@Service("post")
public class PostDtoFacadeServiceImpl implements PostDtoFacadeService {
private PostDtoService postDtoService; // интерфейс для разных реализаций postdtoseervice
@Autowired
public PostDtoFacadeServiceImpl(@Qualifier("allPosts") PostDtoService postDtoService) {
this.postDtoService = postDtoService;
}
@Override
public PageDto<PostDto> callMethodByMethodName(Map<String, Object> parameters) {
return postDtoService.getPageDto(parameters);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question