From 9e2c7cc1a847bc81dbbaf78d384c5b4550822c4b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Sep 2024 20:11:24 +0200 Subject: [PATCH] Commented out all non working code to fix major bugs on other branch! --- docker-compose.yml | 1 + .../com/MeetMate/appointment/Appointment.java | 48 +++++++++---------- .../appointment/AppointmentController.java | 34 +++++++++++-- .../appointment/AppointmentRepository.java | 24 +++++----- .../appointment/AppointmentService.java | 8 ++-- .../MeetMate/company/CompanyController.java | 3 +- 6 files changed, 73 insertions(+), 45 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index daecdd1..7328117 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ services: build: context: . dockerfile: Dockerfile + restart: always ports: - "8081:8080" depends_on: diff --git a/src/main/java/com/MeetMate/appointment/Appointment.java b/src/main/java/com/MeetMate/appointment/Appointment.java index bb730c8..442c2d8 100644 --- a/src/main/java/com/MeetMate/appointment/Appointment.java +++ b/src/main/java/com/MeetMate/appointment/Appointment.java @@ -1,24 +1,24 @@ -package com.MeetMate.appointment; - -import com.MeetMate.enums.AppointmentStatus; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.data.mongodb.core.mapping.Document; - -import java.time.LocalDateTime; - -@Document(collection = "appointments") -@Data -@NoArgsConstructor -public class Appointment { - long id; - LocalDateTime from; - LocalDateTime to; - long companyID; - long clientID; - long assigneeID; -// Select Prompt → f.E. medical industry: Untersuchung, Operation - String description; - String location; - AppointmentStatus status; -} +//package com.MeetMate.appointment; +// +//import com.MeetMate.enums.AppointmentStatus; +//import lombok.Data; +//import lombok.NoArgsConstructor; +//import org.springframework.data.mongodb.core.mapping.Document; +// +//import java.time.LocalDateTime; +// +//@Document(collection = "appointments") +//@Data +//@NoArgsConstructor +//public class Appointment { +// long id; +// LocalDateTime from; +// LocalDateTime to; +// long companyID; +// long clientID; +// long assigneeID; +//// Select Prompt → f.E. medical industry: Untersuchung, Operation +// String description; +// String location; +// AppointmentStatus status; +//} diff --git a/src/main/java/com/MeetMate/appointment/AppointmentController.java b/src/main/java/com/MeetMate/appointment/AppointmentController.java index 877c991..07522be 100644 --- a/src/main/java/com/MeetMate/appointment/AppointmentController.java +++ b/src/main/java/com/MeetMate/appointment/AppointmentController.java @@ -1,4 +1,30 @@ -package com.MeetMate.appointment; - -public class AppointmentController { -} +//package com.MeetMate.appointment; +// +//import com.MeetMate.company.Company; +//import lombok.RequiredArgsConstructor; +//import org.springframework.graphql.data.method.annotation.Argument; +//import org.springframework.graphql.data.method.annotation.QueryMapping; +// +//@RequiredArgsConstructor +//public class AppointmentController { +// private final AppointmentService appointmentService; +// +// @QueryMapping +// public Company getAppointment(@Argument long id) { +// try { +// return appointmentService.getAppointment(id); +// +// } catch (Throwable t) { +// Class tc = t.getClass(); +// return null; +//// if (tc == EntityNotFoundException.class) +//// return ResponseEntity.status(HttpStatus.NOT_FOUND).body("message: " + t.getMessage()); +//// +//// if (tc == IllegalArgumentException.class) +//// return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("message: " + t.getMessage()); +//// +//// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("message: " + t.getMessage()); +// } +// } +// +//} diff --git a/src/main/java/com/MeetMate/appointment/AppointmentRepository.java b/src/main/java/com/MeetMate/appointment/AppointmentRepository.java index d5e9e4c..0c541a8 100644 --- a/src/main/java/com/MeetMate/appointment/AppointmentRepository.java +++ b/src/main/java/com/MeetMate/appointment/AppointmentRepository.java @@ -1,12 +1,12 @@ -package com.MeetMate.appointment; - -import org.springframework.data.mongodb.repository.MongoRepository; -import org.springframework.stereotype.Repository; - -import java.util.Optional; - -@Repository -public interface AppointmentRepository extends MongoRepository { - - -} +//package com.MeetMate.appointment; +// +//import org.springframework.data.mongodb.repository.MongoRepository; +//import org.springframework.stereotype.Repository; +// +//import java.util.Optional; +// +//@Repository +//public interface AppointmentRepository extends MongoRepository { +// +// +//} diff --git a/src/main/java/com/MeetMate/appointment/AppointmentService.java b/src/main/java/com/MeetMate/appointment/AppointmentService.java index f7ba121..9cd9e05 100644 --- a/src/main/java/com/MeetMate/appointment/AppointmentService.java +++ b/src/main/java/com/MeetMate/appointment/AppointmentService.java @@ -1,4 +1,4 @@ -package com.MeetMate.appointment; - -public class AppointmentService { -} +//package com.MeetMate.appointment; +// +//public class AppointmentService { +//} diff --git a/src/main/java/com/MeetMate/company/CompanyController.java b/src/main/java/com/MeetMate/company/CompanyController.java index 24cca2d..2810e1f 100644 --- a/src/main/java/com/MeetMate/company/CompanyController.java +++ b/src/main/java/com/MeetMate/company/CompanyController.java @@ -8,12 +8,13 @@ import org.springframework.graphql.data.method.annotation.QueryMapping; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.lang.reflect.InaccessibleObjectException; -@RestController +@Controller @RequestMapping(path = "api/company") @RequiredArgsConstructor public class CompanyController {