find by id

This commit is contained in:
luxic
2025-08-17 09:15:48 +07:00
parent bdfd8a9142
commit a128eb6cca

View File

@@ -4,10 +4,7 @@ import id.my.luxic.pastebin.model.Paste;
import id.my.luxic.pastebin.request.PasteCreateRequest;
import id.my.luxic.pastebin.service.PasteService;
import org.springframework.http.ResponseEntity;
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.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -30,4 +27,9 @@ public class PasteController {
return ResponseEntity.ok(service.save(pasteCreateRequest));
}
@GetMapping("/api/paste/{id}")
public ResponseEntity<Paste> findById(@PathVariable String id) {
return ResponseEntity.ok(service.findById(id));
}
}