-
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.
Merge pull request #175 from makevook/release
main 병합
- Loading branch information
Showing
64 changed files
with
649 additions
and
1,223 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
Submodule sql
updated
5 files
+2 −0 | 000003_demo-data.down.sql | |
+160 −0 | 000003_demo-data.up.sql | |
+2 −0 | 000004_template-data.down.sql | |
+386 −0 | 000004_template-data.up.sql | |
+1 −1 | Makefile |
8 changes: 8 additions & 0 deletions
8
server/api/src/main/java/vook/server/api/config/JpaConfig.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,9 +1,17 @@ | ||
package vook.server.api.config; | ||
|
||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.FilterType; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
import org.springframework.data.keyvalue.repository.KeyValueRepository; | ||
|
||
@Configuration | ||
@EnableJpaAuditing | ||
@EnableJpaRepositories( | ||
basePackages = "vook.server.api", | ||
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {KeyValueRepository.class}) | ||
) | ||
public class JpaConfig { | ||
} |
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
3 changes: 2 additions & 1 deletion
3
server/api/src/main/java/vook/server/api/config/package-info.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
120 changes: 0 additions & 120 deletions
120
server/api/src/main/java/vook/server/api/devhelper/app/InitService.java
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
server/api/src/main/java/vook/server/api/devhelper/app/TestTermsLoader.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
server/api/src/main/java/vook/server/api/devhelper/app/init/InitService.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,44 @@ | ||
package vook.server.api.devhelper.app.init; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import vook.server.api.devhelper.app.sync.SyncService; | ||
import vook.server.api.domain.user.model.social_user.SocialUserRepository; | ||
import vook.server.api.domain.user.model.user.UserRepository; | ||
import vook.server.api.domain.user.model.user_info.UserInfoRepository; | ||
import vook.server.api.domain.vocabulary.model.term.TermRepository; | ||
import vook.server.api.infra.vocabulary.cache.UserVocabularyCacheRepository; | ||
import vook.server.api.infra.vocabulary.jpa.VocabularyJpaRepository; | ||
|
||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class InitService { | ||
|
||
private final TermRepository termRepository; | ||
private final VocabularyJpaRepository vocabularyJpaRepository; | ||
private final UserVocabularyCacheRepository userVocabularyCacheRepository; | ||
private final UserInfoRepository userInfoRepository; | ||
private final SocialUserRepository socialUserRepository; | ||
private final UserRepository userRepository; | ||
|
||
private final SyncService syncService; | ||
|
||
public void init() { | ||
deleteAllUserData(); | ||
syncService.sync(); | ||
} | ||
|
||
private void deleteAllUserData() { | ||
// 용어집 | ||
termRepository.deleteAllInBatch(); | ||
vocabularyJpaRepository.deleteAllInBatch(); | ||
userVocabularyCacheRepository.deleteAll(); | ||
|
||
// 사용자 | ||
userInfoRepository.deleteAllInBatch(); | ||
socialUserRepository.deleteAllInBatch(); | ||
userRepository.deleteAllInBatch(); | ||
} | ||
} |
Oops, something went wrong.