Изменено кэширование
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ru.serega6531.packmate.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.serega6531.packmate.model.Packet;
|
||||
import ru.serega6531.packmate.model.Stream;
|
||||
@@ -19,13 +18,12 @@ public class PacketService {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@Cacheable(value = "packets", key = "#stream.id")
|
||||
public List<Packet> getPacketsForStream(Stream stream) {
|
||||
return repository.findAllByStream(stream);
|
||||
}
|
||||
|
||||
public Packet save(Packet packet) {
|
||||
return repository.save(packet);
|
||||
public List<Packet> saveAll(List<Packet> packets) {
|
||||
return repository.saveAll(packets);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user