main #10

Closed
student-20690 wants to merge 26 commits from (deleted):main into main
2 changed files with 18 additions and 10 deletions
Showing only changes of commit 7087390b38 - Show all commits

View File

@@ -1,10 +1,8 @@
package com.example.nto.controller; package com.example.nto.controller;
import com.example.nto.entity.Booking; import com.example.nto.entity.Booking;
import org.springframework.web.bind.annotation.GetMapping; import com.example.nto.service.BookingService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate; import java.time.LocalDate;
@@ -15,11 +13,14 @@ import java.time.LocalDate;
* НЕЛЬЗЯ: Изменять название класса и пакета * НЕЛЬЗЯ: Изменять название класса и пакета
*/ */
@RestController @RestController
@RequestMapping("code") @RequestMapping("/api")
public class BookingController { 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; 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: ДОРАБОТАТЬ в рамках задания * TODO: ДОРАБОТАТЬ в рамках задания
* ================================= * =================================
* МОЖНО: Добавлять методы, аннотации, зависимости * МОЖНО: Добавлять методы, аннотации, зависимости
* НЕЛЬЗЯ: Изменять название класса и пакета * НЕЛЬЗЯ: Изменять название класса и пакета
*/ */
public interface PlaceRepository { public interface PlaceRepository extends JpaRepository<Place, Long> {
Optional<Place> findPlaceById(long id);
} }