From f6e5d609812549bb381b49ee616b3374c5a855e7 Mon Sep 17 00:00:00 2001 From: kavi castelo Date: Sat, 27 Apr 2024 23:19:55 +0530 Subject: [PATCH] Fixed fixed null pointer bug --- .idea/workspace.xml | 53 +++++++++++-------- .../controller/ContactController.java | 8 +-- .../api/air_quality/model/ContactModel.java | 4 +- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6278a44d..6377e09d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,6 @@ -<<<<<<< HEAD @@ -15,15 +14,19 @@ -======= - + + ->>>>>>> cbcae96abf9c046e3883394b4a83b21886fc237e + + + + + - { - "keyToString": { - "ASKED_ADD_EXTERNAL_FILES": "true", - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "WebServerToolWindowFactoryState": "false", - "last_opened_file_path": "E:/PROJECTS/HTML/Ethical-AI-driven-Geographic-Analytics-Platform/client/src/docs", - "nodejs_package_manager_path": "npm", - "spring.configuration.checksum": "d5f73674f4485e14aac5b80b81aca5c3", - "ts.external.directory.path": "E:\\PROJECTS\\HTML\\Ethical-AI-driven-Geographic-Analytics-Platform\\client\\node_modules\\typescript\\lib" + +}]]> @@ -83,7 +90,14 @@ - + + + + - - - diff --git a/src/main/java/com/api/air_quality/controller/ContactController.java b/src/main/java/com/api/air_quality/controller/ContactController.java index 4e25243f..65ae3395 100644 --- a/src/main/java/com/api/air_quality/controller/ContactController.java +++ b/src/main/java/com/api/air_quality/controller/ContactController.java @@ -23,14 +23,14 @@ public class ContactController { public ResponseEntity sendMail(@RequestBody ContactModel contactModel){ emailService.sendSimpleEmail("kavindu.kokila.info@gmail.com","Urban air quality platform - contact","" + "Dear Administration,"+"\n" + - "You got an contact email from: "+contactModel.getSender()+"\n" + - "Email Address: "+contactModel.getSenderEmail()+"\n\n" + + "You got an contact email from: "+contactModel.getName()+"\n" + + "Email Address: "+contactModel.getEmail()+"\n\n" + ""+contactModel.getMessage()+"\n\n" + "Client is waiting for your response. Reply ASAP\n\n\n" + "System Automated Email - Urban Air Quality Platform"); - emailService.sendSimpleEmail(contactModel.getSenderEmail(),"Urban air quality platform - contact","" + - "Dear "+contactModel.getSender()+","+"\n" + + emailService.sendSimpleEmail(contactModel.getEmail(),"Urban air quality platform - contact","" + + "Dear "+contactModel.getName()+","+"\n" + "We got your contact message. Our agent will be contact you ASAP. Thank you for contacting with us! \n\n" + "Sincerely,\n" + "Urban Air Quality Platform.\n\n" + diff --git a/src/main/java/com/api/air_quality/model/ContactModel.java b/src/main/java/com/api/air_quality/model/ContactModel.java index af966939..b792cfd3 100644 --- a/src/main/java/com/api/air_quality/model/ContactModel.java +++ b/src/main/java/com/api/air_quality/model/ContactModel.java @@ -14,7 +14,7 @@ public class ContactModel { @Id private String id; - private String sender; - private String senderEmail; + private String name; + private String email; private String message; }