Last active
December 10, 2019 00:37
-
-
Save asouza/f3467a5b51e29fdba5baf84214c2bd6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
public class TeamController { | |
@Autowired | |
private FormFlow formFlow; | |
@PostMapping(...) | |
public void save(@Valid NewTeamForm newTeamForm){ | |
formFlow.transform(newTeamForm).save().andThen(savedObject -> { | |
System.out.println("executando codigo sincrono"+domainObject); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para vários endpoints que crio, tenho um fluxo de trabalho muito parecido.
A classe FormFlow abstrai esse trabalho aí que se repete demais na minha vida. Ela também pode abstrair remoções, atualizações etc.