我有弹簧数据休息库,默认发布,更新和删除。 我还实现了一个事件处理程序,现在如何将Web套接字添加到事件处理程序中?
@RepositoryEventHandler(User.class)
@Service
public class UserEventHandler {
private static final Logger LOG = LoggerFactory.getLogger(UserEventHandler.class);
@Autowired
private SmtpMailSender smtpMailSender;
@HandleAfterCreate
public void handleBeforeCreate(User u) {
}
}
// Repository class
@Transactional
@RepositoryRestResource(path = "users", collectionResourceRel = "users")
public interface UserRepository extends PagingAndSortingRepository<User, String> {
}