mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-20 14:00:56 +08:00
Merge branch 'main' of github.com:nagisa77/OpenIsle
This commit is contained in:
@@ -10,7 +10,8 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
@@ -71,7 +72,7 @@ public class NotificationService {
|
||||
}
|
||||
n = notificationRepository.save(n);
|
||||
|
||||
notificationExecutor.execute(() -> {
|
||||
// Runnable asyncTask = () -> {
|
||||
if (type == NotificationType.COMMENT_REPLY && user.getEmail() != null && post != null && comment != null) {
|
||||
String url = String.format("%s/posts/%d#comment-%d", websiteUrl, post.getId(), comment.getId());
|
||||
emailSender.sendEmail(user.getEmail(), "有人回复了你", url);
|
||||
@@ -95,7 +96,18 @@ public class NotificationService {
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
// };
|
||||
|
||||
// if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||
// @Override
|
||||
// public void afterCommit() {
|
||||
// notificationExecutor.execute(asyncTask);
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// notificationExecutor.execute(asyncTask);
|
||||
// }
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ export default {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.callback-page-text {
|
||||
|
||||
Reference in New Issue
Block a user