This commit is contained in:
lynxwq2
2025-12-03 17:16:15 +03:00
parent f42e1493a1
commit 7087390b38
2 changed files with 18 additions and 10 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}