在资源控制器中使用多个服务的最佳方法是什么?
2022-09-04 21:53:14
我有一个控制器调用三个服务:
public class ProductController() {
@Autowired
private AccountService accountService;
@Autowired
private ProcessService processService;
@Autowired
private releaseService releaseService;
@RequestMapping("/process")
public Product process(@RequestParam(value="name", defaultValue="docs") ProductProcessed process) {
accountService.notify();
releaseService.sendRelease(process);
return processService.process(process);
}
}
封装此服务调用的最佳方法是什么?