-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommitFlowController.java
More file actions
30 lines (25 loc) · 1.09 KB
/
CommitFlowController.java
File metadata and controls
30 lines (25 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package pl.commit.craft.flow;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pl.commit.craft.service.CommitTranslateService;
@RestController
@RequestMapping("/api/v1/commit-flow")
public class CommitFlowController {
private final CommitTranslateService commitTranslateService;
public CommitFlowController(CommitTranslateService commitTranslateService) {
this.commitTranslateService = commitTranslateService;
}
@PostMapping("/craft")
public String generateCommit(@RequestBody CommitFlowRequest commitFlowRequest) {
return commitTranslateService.generateFlowCommit(
commitFlowRequest.major(),
commitFlowRequest.type(),
commitFlowRequest.component(),
commitFlowRequest.changeDescription(),
commitFlowRequest.details(),
commitFlowRequest.wholeGitCommand()
);
}
}