+ place
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
package com.example.nto.controller;
|
||||
|
||||
import com.example.nto.entity.Booking;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.example.nto.service.BookingService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -15,11 +13,14 @@ import java.time.LocalDate;
|
||||
* НЕЛЬЗЯ: Изменять название класса и пакета
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("code")
|
||||
@RequestMapping("/api")
|
||||
public class BookingController {
|
||||
// @GetMapping("/booking")
|
||||
// public Booking booking(@RequestParam(defaultValue = "")String id){
|
||||
// return new Booking(id, );
|
||||
// }
|
||||
|
||||
private final BookingService bookingService;
|
||||
|
||||
@GetMapping("/{code}/info")
|
||||
public ResponseEntity<EmployeeInfoResponse> getEmployeeInfo(@PathVariable String code) {
|
||||
EmployeeInfoResponse response = employeeService.getEmployeeInfo(code);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package com.example.nto.repository;
|
||||
|
||||
import com.example.nto.entity.Booking;
|
||||
import com.example.nto.entity.Place;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* TODO: ДОРАБОТАТЬ в рамках задания
|
||||
* =================================
|
||||
* МОЖНО: Добавлять методы, аннотации, зависимости
|
||||
* НЕЛЬЗЯ: Изменять название класса и пакета
|
||||
*/
|
||||
public interface PlaceRepository {
|
||||
public interface PlaceRepository extends JpaRepository<Place, Long> {
|
||||
Optional<Place> findPlaceById(long id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user