同步模块整合

pull/65/head
awenes 2023-10-06 15:40:53 +08:00
parent 5252487f0b
commit 4f44aed951
1 changed files with 5 additions and 3 deletions

View File

@ -20,6 +20,7 @@ package cn.topiam.employee.common.repository.identitysource;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
@ -55,9 +56,10 @@ public interface IdentitySourceRepository extends LogicDeleteRepository<Identity
* @param id {@link Long} * @param id {@link Long}
* @return {@link IdentitySourceEntity} * @return {@link IdentitySourceEntity}
*/ */
@NotNull
@Override @Override
@Cacheable(key = "#p0", unless = "#result==null") @Cacheable(key = "#p0", unless = "#result==null")
Optional<IdentitySourceEntity> findById(@Param(value = "id") Long id); Optional<IdentitySourceEntity> findById(@NotNull @Param(value = "id") Long id);
/** /**
* ID * ID
@ -66,7 +68,7 @@ public interface IdentitySourceRepository extends LogicDeleteRepository<Identity
* @return {@link IdentitySourceEntity} * @return {@link IdentitySourceEntity}
*/ */
@Cacheable(key = "#p0", unless = "#result==null") @Cacheable(key = "#p0", unless = "#result==null")
@Query(value = "SELECT * FROM identity_source WHERE id_ = :id", nativeQuery = true) @Query(value = "SELECT IdentitySourceEntity FROM IdentitySourceEntity WHERE id = :id")
Optional<IdentitySourceEntity> findByIdContainsDeleted(@Param(value = "id") Long id); Optional<IdentitySourceEntity> findByIdContainsDeleted(@Param(value = "id") Long id);
/** /**
@ -123,7 +125,7 @@ public interface IdentitySourceRepository extends LogicDeleteRepository<Identity
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Modifying @Modifying
@CacheEvict(allEntries = true) @CacheEvict(allEntries = true)
@Query(value = "UPDATE identity_source SET strategy_config = :strategyConfig where id_ = :id", nativeQuery = true) @Query(value = "UPDATE IdentitySourceEntity SET strategyConfig = :strategyConfig where id = :id")
void updateStrategyConfig(@Param(value = "id") Long id, void updateStrategyConfig(@Param(value = "id") Long id,
@Param(value = "strategyConfig") String strategyConfig); @Param(value = "strategyConfig") String strategyConfig);