From 41bc5df9cda6a43ef47313622dd1ffde1480d06f Mon Sep 17 00:00:00 2001 From: KillerADO <wayne8692wayne8692@gmail.com> Date: 星期四, 23 十二月 2021 10:49:04 +0800 Subject: [PATCH] [update] 調整簡訊的service url與新增簡訊的標題欄位 --- pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java b/pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java index 27957f3..38592f3 100644 --- a/pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java +++ b/pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java @@ -1,6 +1,8 @@ package com.pollex.pam.web.rest; -import com.pollex.pam.service.dto.AppointmentDTO; +import com.pollex.pam.domain.Appointment; +import com.pollex.pam.service.SendMsgService; +import com.pollex.pam.service.dto.AppointmentUpdateDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -20,8 +22,11 @@ @Autowired SatisfactionService satisfactionService; + @Autowired + SendMsgService sendMsgService; + @PutMapping("") - public ResponseEntity<Void> updateAppointment(@RequestBody AppointmentDTO appointment) { + public ResponseEntity<Void> updateAppointment(@RequestBody AppointmentUpdateDTO appointment) { appointmentService.updateAppointment(appointment); return ResponseEntity.noContent().build(); } @@ -34,8 +39,9 @@ @PostMapping("/customer/create") public void clientCreateAppointment(@RequestBody AppointmentCreateDTO appointmentCreateDTO) { - appointmentService.customerCreateAppointment(appointmentCreateDTO); - } + Appointment appointment = appointmentService.customerCreateAppointment(appointmentCreateDTO); + sendMsgService.sendAppointmentNotify(appointment); + } @PostMapping("/markAsContacted/{appointmentId}") public void markAsContacted(@PathVariable Long appointmentId) { -- Gitblit v1.8.0