|
|
@@ -1,9 +1,6 @@
|
|
|
package com.izouma.nineth.repo;
|
|
|
|
|
|
import com.izouma.nineth.domain.Collection;
|
|
|
-import com.izouma.nineth.domain.CollectionProperty;
|
|
|
-import com.izouma.nineth.domain.FileObject;
|
|
|
-import com.izouma.nineth.domain.Privilege;
|
|
|
import com.izouma.nineth.dto.RecommendCollection;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.CachePut;
|
|
|
@@ -28,13 +25,13 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
|
|
|
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query("update Collection c set c.onShelf = ?2, c.salable = ?3, c.startTime = ?4, " +
|
|
|
- "c.scheduleSale = ?5, c.sort = ?6, c.detail = ?7, c.privileges = ?8, " +
|
|
|
- "c.properties = ?9, c.model3d = ?10 where c.id = ?1")
|
|
|
+ @Query(value = "update collection_info c set c.on_shelf = ?2, c.salable = ?3, c.start_time = ?4, " +
|
|
|
+ "c.schedule_sale = ?5, c.sort = ?6, c.detail = ?7, c.privileges = ?8, " +
|
|
|
+ "c.properties = ?9, c.model3d = ?10 where c.id = ?1",nativeQuery = true)
|
|
|
@CacheEvict(value = {"collection", "recommend"}, allEntries = true)
|
|
|
void update(@Nonnull Long id, boolean onShelf, boolean salable, LocalDateTime startTime,
|
|
|
- boolean schedule, int sort, String detail, List<Privilege> privileges,
|
|
|
- List<CollectionProperty> properties, FileObject model3d);
|
|
|
+ boolean schedule, int sort, String detail, String privileges,
|
|
|
+ String properties, String model3d);
|
|
|
|
|
|
@Cacheable("collection")
|
|
|
Optional<Collection> findById(Long id);
|
|
|
@@ -62,7 +59,7 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
|
|
|
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query("update Collection c set c.onShelf = true, c.salable = true where c.id = ?1")
|
|
|
+ @Query("update Collection c set c.scheduleSale = false, c.startTime = null, c.onShelf = true, c.salable = true where c.id = ?1")
|
|
|
@CacheEvict(value = "collection", key = "#id")
|
|
|
void scheduleOnShelf(Long id);
|
|
|
|