Skip to content

Commit eed90e2

Browse files
authored
Merge pull request #118 from FixLog/develop
Develop
2 parents e9746f6 + 20cdb1c commit eed90e2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/java/com/example/FixLog/mock/TagMockDataInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void run(String... args) {
3434
// BIG_CATEGORY
3535
addIfNotExist(tagsToInsert, existingTagNames, Tag.of(BIG_CATEGORY, "backend"));
3636
addIfNotExist(tagsToInsert, existingTagNames, Tag.of(BIG_CATEGORY, "machine-learning"));
37-
addIfNotExist(tagsToInsert, existingTagNames, Tag.of(BIG_CATEGORY, "frontend"));
37+
addIfNotExist(tagsToInsert, existingTagNames, Tag.of(BIG_CATEGORY, "web"));
3838

3939
// MAJOR_CATEGORY
4040
addIfNotExist(tagsToInsert, existingTagNames, Tag.of(MAJOR_CATEGORY, "django"));
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package com.example.FixLog.repository.tag;
22

33
import com.example.FixLog.domain.tag.Tag;
4+
import com.example.FixLog.domain.tag.TagCategory;
45
import org.springframework.data.domain.Page;
56
import org.springframework.data.domain.Pageable;
67
import org.springframework.data.jpa.repository.JpaRepository;
78

89
import java.util.Optional;
910

1011
public interface TagRepository extends JpaRepository<Tag, Long> {
11-
Page<Tag> findAll(Pageable pageable);
12+
// Page<Tag> findAll(Pageable pageable);
13+
Page<Tag> findAllByTagCategory(TagCategory tagCategory, Pageable pageable);
1214
Optional<Tag> findByTagName(String tagName);
1315
}

src/main/java/com/example/FixLog/service/TagService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.example.FixLog.service;
22

33
import com.example.FixLog.domain.tag.Tag;
4+
import com.example.FixLog.domain.tag.TagCategory;
45
import com.example.FixLog.dto.tag.TagDto;
56
import com.example.FixLog.dto.tag.TagResponseDto;
67
import com.example.FixLog.repository.tag.TagRepository;
@@ -24,7 +25,7 @@ public TagService(TagRepository tagRepository){
2425
public TagResponseDto viewTags(int page, int size){
2526
Pageable pageable = PageRequest.of(page - 1, size);
2627

27-
Page<Tag> tags = tagRepository.findAll(pageable);
28+
Page<Tag> tags = tagRepository.findAllByTagCategory(TagCategory.MINOR_CATEGORY, pageable);
2829

2930
List<TagDto> tagList = tags.stream()
3031
.map(tag -> new TagDto(

0 commit comments

Comments
 (0)