Add gitea-actions: Spring Boot 4.2.0 CI with surefire/failsafe, Testcontainers, CycloneDX SBOM and Jib
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.ankurm.ci;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class TicketController {
|
||||
|
||||
public record NewTicket(String title) {
|
||||
}
|
||||
|
||||
private final TicketRepository repository;
|
||||
|
||||
public TicketController(TicketRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@GetMapping("/tickets")
|
||||
public List<Ticket> list() {
|
||||
return repository.findAll();
|
||||
}
|
||||
|
||||
@PostMapping("/tickets")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public Ticket create(@RequestBody NewTicket body) {
|
||||
return repository.save(body.title());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user