-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
64 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/com/server/crews/external/config/RediSearchConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.server.crews.external.config; | ||
|
||
import com.redis.lettucemod.RedisModulesClient; | ||
import com.redis.lettucemod.api.StatefulRedisModulesConnection; | ||
import com.redis.lettucemod.api.sync.RedisModulesCommands; | ||
import jakarta.annotation.PreDestroy; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class RediSearchConnection { | ||
private final StatefulRedisModulesConnection<String, String> redisModulesConnection; | ||
|
||
public RediSearchConnection(RedisModulesClient redisModulesClient) { | ||
this.redisModulesConnection = redisModulesClient.connect(); | ||
} | ||
|
||
public RedisModulesCommands<String, String> getCommands() { | ||
return redisModulesConnection.sync(); | ||
} | ||
|
||
@PreDestroy | ||
public void close() { | ||
redisModulesConnection.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
import com.server.crews.recruitment.domain.SelectiveQuestion; | ||
import com.server.crews.recruitment.repository.RecruitmentRepository; | ||
import com.server.crews.recruitment.service.SimpleRedisRecruitmentSearchService; | ||
import com.server.crews.recruitment.service.RedisStackRecruitmentSearchService; | ||
import com.server.crews.recruitment.service.RediSearchRecruitmentSearchService; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
|
@@ -37,7 +37,7 @@ public class DatabaseInitializer implements ApplicationRunner { | |
private final ApplicantRepository applicantRepository; | ||
private final ApplicationRepository applicationRepository; | ||
private final SimpleRedisRecruitmentSearchService simpleRedisRecruitmentSearchService; | ||
private final RedisStackRecruitmentSearchService redisStackRecruitmentSearchService; | ||
private final RediSearchRecruitmentSearchService rediSearchRecruitmentSearchService; | ||
|
||
@Override | ||
public void run(ApplicationArguments args) { | ||
|
@@ -72,8 +72,8 @@ public void run(ApplicationArguments args) { | |
recruitment.close(); | ||
recruitmentRepository.save(recruitment); | ||
simpleRedisRecruitmentSearchService.saveRecruitment(recruitment); | ||
redisStackRecruitmentSearchService.createIndex(); | ||
redisStackRecruitmentSearchService.saveRecruitment(recruitment); | ||
rediSearchRecruitmentSearchService.createIndex(); | ||
rediSearchRecruitmentSearchService.saveRecruitment(recruitment); | ||
|
||
Applicant kh = new Applicant("[email protected]", passwordEncoder.encode("test-password")); | ||
Applicant lkh = new Applicant("[email protected]", passwordEncoder.encode("test-password")); | ||
|
3 changes: 0 additions & 3 deletions
3
src/main/java/com/server/crews/recruitment/repository/NarrativeQuestionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
package com.server.crews.recruitment.repository; | ||
|
||
import com.server.crews.recruitment.domain.NarrativeQuestion; | ||
import com.server.crews.recruitment.domain.Section; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface NarrativeQuestionRepository extends JpaRepository<NarrativeQuestion, Long> { | ||
List<NarrativeQuestion> findAllBySectionIn(List<Section> sections); | ||
} |
10 changes: 0 additions & 10 deletions
10
src/main/java/com/server/crews/recruitment/repository/SelectiveQuestionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
package com.server.crews.recruitment.repository; | ||
|
||
import com.server.crews.recruitment.domain.Section; | ||
import com.server.crews.recruitment.domain.SelectiveQuestion; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface SelectiveQuestionRepository extends JpaRepository<SelectiveQuestion, Long> { | ||
@Query(""" | ||
select s from SelectiveQuestion s | ||
left join fetch s.choices | ||
where s.section in :sections | ||
""") | ||
List<SelectiveQuestion> findAllWithChoicesInSections(@Param("sections") List<Section> sections); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule config
updated
from 114277 to 2a4aeb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters