-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from Hoang-Nguyen-Huy/feat/socket
[NguyenHCP] feat: update send invite calendar
- Loading branch information
Showing
4 changed files
with
19 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
package com.swp.PodBookingSystem.controller; | ||
|
||
import com.swp.PodBookingSystem.dto.request.Account.AccountCreationRequest; | ||
import com.swp.PodBookingSystem.dto.request.Account.AccountPaginationDTO; | ||
import com.swp.PodBookingSystem.dto.request.Account.AccountResponseClient; | ||
import com.swp.PodBookingSystem.dto.request.Account.AccountUpdateAdminRequest; | ||
import com.swp.PodBookingSystem.dto.request.Account.*; | ||
import com.swp.PodBookingSystem.dto.request.CalendarRequest; | ||
import com.swp.PodBookingSystem.dto.respone.Account.AccountOrderResponse; | ||
import com.swp.PodBookingSystem.dto.respone.ApiResponse; | ||
|
@@ -108,17 +105,17 @@ ApiResponse<AccountResponseClient> getMe(@RequestHeader("Authorization") String | |
.build(); | ||
} | ||
|
||
// @GetMapping("/send-email") | ||
// public String sendEmail() throws MessagingException, IOException { | ||
// sendEmailService.sendCalenderInvite( | ||
// CalendarRequest.builder() | ||
// .subject("Đăt lịch ở POD Booking") | ||
// .description("Hãy đặt lịch ở calendar để không bỏ lỡ lịch") | ||
// .summary("Đăt lịch ở POD Booking") | ||
// .to("[email protected]") | ||
// .eventDateTime(LocalDateTime.now()).build()); | ||
// return "Send email successfully"; | ||
// } | ||
@PostMapping("/send-email") | ||
public String sendEmail(@RequestBody SendMailRequest request) throws MessagingException, IOException { | ||
sendEmailService.sendCalenderInvite( | ||
CalendarRequest.builder() | ||
.subject("Đăt lịch ở POD Booking") | ||
.description("Hãy đặt lịch ở calendar để không bị bỏ lỡ") | ||
.summary("Đăt lịch ở POD Booking") | ||
.to(request.getEmail()) | ||
.eventDateTime(LocalDateTime.parse("2024-10-27T17:00:00")).build()); | ||
return "Send email successfully"; | ||
} | ||
|
||
@GetMapping("/staff") | ||
public ResponseEntity<List<AccountOrderResponse>> getAllStaffAccounts() { | ||
|
3 changes: 0 additions & 3 deletions
3
src/main/java/com/swp/PodBookingSystem/controller/SocketController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
...ookingSystem/dto/request/ChatMessage.java → .../dto/request/Account/SendMailRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
package com.swp.PodBookingSystem.dto.request; | ||
package com.swp.PodBookingSystem.dto.request.Account; | ||
|
||
import lombok.*; | ||
import lombok.experimental.FieldDefaults; | ||
|
||
import java.util.Date; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@FieldDefaults(level = AccessLevel.PRIVATE) | ||
public class ChatMessage { | ||
String nickname; | ||
String content; | ||
Date timestamp; | ||
public class SendMailRequest { | ||
String email; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters