find by id
This commit is contained in:
@@ -4,10 +4,7 @@ import id.my.luxic.pastebin.model.Paste;
|
|||||||
import id.my.luxic.pastebin.request.PasteCreateRequest;
|
import id.my.luxic.pastebin.request.PasteCreateRequest;
|
||||||
import id.my.luxic.pastebin.service.PasteService;
|
import id.my.luxic.pastebin.service.PasteService;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -30,4 +27,9 @@ public class PasteController {
|
|||||||
return ResponseEntity.ok(service.save(pasteCreateRequest));
|
return ResponseEntity.ok(service.save(pasteCreateRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/api/paste/{id}")
|
||||||
|
public ResponseEntity<Paste> findById(@PathVariable String id) {
|
||||||
|
return ResponseEntity.ok(service.findById(id));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user