|
|
@@ -1,6 +1,7 @@
|
|
|
package com.izouma.nineth.repo;
|
|
|
|
|
|
import com.izouma.nineth.domain.Showroom;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
@@ -20,6 +21,7 @@ public interface ShowroomRepo extends JpaRepository<Showroom, Long>, JpaSpecific
|
|
|
@Query("update Showroom t set t.likes = t.likes + ?2 where t.id = ?1")
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
+ @CacheEvict(value = "showroom", key = "#id")
|
|
|
void addLike(Long id, int num);
|
|
|
|
|
|
Optional<Showroom> findByUserIdAndType(Long userId, String type);
|