From e10cf9a413618520e1ce34bba45d9aeb0127a2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B3=A0=EA=B2=BD=EC=88=98?= Date: Tue, 10 Feb 2026 04:52:25 +0900 Subject: [PATCH] =?UTF-8?q?refactor(#350):=20contentCategories=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/MatchServiceImpl.java | 4 +++ .../dto/request/MatchRequestDto.java | 1 + .../presentation/swagger/MatchSwagger.java | 35 ++++++++++--------- .../service/UserFeatureService.java | 6 ++++ .../dto/response/MyFeatureResponseDto.java | 1 + 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/example/RealMatch/match/application/service/MatchServiceImpl.java b/src/main/java/com/example/RealMatch/match/application/service/MatchServiceImpl.java index 68841652..a944da09 100644 --- a/src/main/java/com/example/RealMatch/match/application/service/MatchServiceImpl.java +++ b/src/main/java/com/example/RealMatch/match/application/service/MatchServiceImpl.java @@ -278,6 +278,9 @@ private UserTagDocument convertToUserTagDocument(Long userId, MatchRequestDto dt if (dto.getContent().getTypeTags() != null) { contentTags.addAll(dto.getContent().getTypeTags()); } + if (dto.getContent().getCategoryTags() != null) { + contentTags.addAll(dto.getContent().getCategoryTags()); + } if (dto.getContent().getToneTags() != null) { contentTags.addAll(dto.getContent().getToneTags()); } @@ -706,6 +709,7 @@ private Set collectAllTagIds(MatchRequestDto dto) { if (dto.getContent() != null) { addAll(tagIds, dto.getContent().getTypeTags()); + addAll(tagIds, dto.getContent().getCategoryTags()); addAll(tagIds, dto.getContent().getToneTags()); addAll(tagIds, dto.getContent().getPrefferedInvolvementTags()); addAll(tagIds, dto.getContent().getPrefferedCoverageTags()); diff --git a/src/main/java/com/example/RealMatch/match/presentation/dto/request/MatchRequestDto.java b/src/main/java/com/example/RealMatch/match/presentation/dto/request/MatchRequestDto.java index fc566a34..d234b7da 100644 --- a/src/main/java/com/example/RealMatch/match/presentation/dto/request/MatchRequestDto.java +++ b/src/main/java/com/example/RealMatch/match/presentation/dto/request/MatchRequestDto.java @@ -59,6 +59,7 @@ public static class FashionDto { public static class ContentDto { private SnsDto sns; private List typeTags; + private List categoryTags; private List toneTags; private List prefferedInvolvementTags; private List prefferedCoverageTags; diff --git a/src/main/java/com/example/RealMatch/match/presentation/swagger/MatchSwagger.java b/src/main/java/com/example/RealMatch/match/presentation/swagger/MatchSwagger.java index 1de0fe6a..b156c647 100644 --- a/src/main/java/com/example/RealMatch/match/presentation/swagger/MatchSwagger.java +++ b/src/main/java/com/example/RealMatch/match/presentation/swagger/MatchSwagger.java @@ -54,35 +54,36 @@ CustomResponse match( "beauty": { "interestStyleTags": [1, 2], "prefferedFunctionTags": [6, 7], - "skinTypeTags": 12, - "skinToneTags": 13, - "makeupStyleTags": 2 + "skinTypeTags": 11, + "skinToneTags": 14, + "makeupStyleTags": 19 }, "fashion": { - "interestStyleTags": [16, 17], - "preferredItemTags": [22, 23], - "preferredBrandTags": [27, 28], + "interestStyleTags": [24, 25], + "preferredItemTags": [28, 29], + "preferredBrandTags": [33, 24], "heightTag": 72, - "weightTypeTag": 94, - "topSizeTag": 108, - "bottomSizeTag": 178 + "weightTypeTag": 101, + "topSizeTag": 104, + "bottomSizeTag": 123 }, "content": { "sns": { "url": "https://www.instagram.com/vivi", "mainAudience": { - "genderTags": [221, 222], - "ageTags": [223, 224] + "genderTags": [156], + "ageTags": [161] }, "averageAudience": { - "videoLengthTags": [228, 229], - "videoViewsTags": [232, 233] + "videoLengthTags": [164, 165], + "videoViewsTags": [168, 169] } }, - "typeTags": [236, 237], - "toneTags": [245, 246], - "prefferedInvolvementTags": [251, 252], - "prefferedCoverageTags": [255, 256] + "typeTags": [171, 172], + "categoryTags": [178], + "toneTags": [181, 182], + "prefferedInvolvementTags": [188, 189], + "prefferedCoverageTags": [190, 191] } } """ diff --git a/src/main/java/com/example/RealMatch/user/application/service/UserFeatureService.java b/src/main/java/com/example/RealMatch/user/application/service/UserFeatureService.java index 6c1ec987..853abbf0 100644 --- a/src/main/java/com/example/RealMatch/user/application/service/UserFeatureService.java +++ b/src/main/java/com/example/RealMatch/user/application/service/UserFeatureService.java @@ -73,6 +73,7 @@ public MyFeatureResponseDto getMyFeatures(Long userId) { get(grouped, TagType.CONTENT.getDescription(), ContentTagType.AVG_VIDEO_LENGTH.getKorName()), get(grouped, TagType.CONTENT.getDescription(), ContentTagType.AVG_VIDEO_VIEWS.getKorName()), get(grouped, TagType.CONTENT.getDescription(), ContentTagType.FORMAT.getKorName()), + get(grouped, TagType.CONTENT.getDescription(), ContentTagType.CATEGORY.getKorName()), get(grouped, TagType.CONTENT.getDescription(), ContentTagType.TONE.getKorName()), get(grouped, TagType.CONTENT.getDescription(), ContentTagType.INVOLVEMENT.getKorName()), get(grouped, TagType.CONTENT.getDescription(), ContentTagType.USAGE_RANGE.getKorName()) @@ -150,6 +151,7 @@ private MatchRequestDto toMatchRequestDtoFromUserTags(List tagUsers, Lo List videoLengthTags = new ArrayList<>(); List videoViewsTags = new ArrayList<>(); List typeTags = new ArrayList<>(); + List categoryTags = new ArrayList<>(); List toneTags = new ArrayList<>(); List preferredInvolvementTags = new ArrayList<>(); List preferredCoverageTags = new ArrayList<>(); @@ -213,6 +215,8 @@ private MatchRequestDto toMatchRequestDtoFromUserTags(List tagUsers, Lo videoViewsTags.add(tagId); } else if (ContentTagType.FORMAT.getKorName().equals(category)) { typeTags.add(tagId); + } else if (ContentTagType.CATEGORY.getKorName().equals(category)) { + categoryTags.add(tagId); } else if (ContentTagType.TONE.getKorName().equals(category)) { toneTags.add(tagId); } else if (ContentTagType.INVOLVEMENT.getKorName().equals(category)) { @@ -264,6 +268,7 @@ private MatchRequestDto toMatchRequestDtoFromUserTags(List tagUsers, Lo .content(MatchRequestDto.ContentDto.builder() .sns(sns) .typeTags(typeTags.isEmpty() ? null : typeTags) + .categoryTags(categoryTags.isEmpty() ? null : categoryTags) .toneTags(toneTags.isEmpty() ? null : toneTags) .prefferedInvolvementTags(preferredInvolvementTags.isEmpty() ? null : preferredInvolvementTags) .prefferedCoverageTags(preferredCoverageTags.isEmpty() ? null : preferredCoverageTags) @@ -337,6 +342,7 @@ private MatchRequestDto.ContentDto mergeContent(MatchRequestDto.ContentDto cur, return MatchRequestDto.ContentDto.builder() .sns(mergeSns(cur.getSns(), p.getSns())) .typeTags(p.getTypeTags() != null ? p.getTypeTags() : cur.getTypeTags()) + .categoryTags(p.getCategoryTags() != null ? p.getCategoryTags() : cur.getCategoryTags()) .toneTags(p.getToneTags() != null ? p.getToneTags() : cur.getToneTags()) .prefferedInvolvementTags(p.getPrefferedInvolvementTags() != null ? p.getPrefferedInvolvementTags() : cur.getPrefferedInvolvementTags()) .prefferedCoverageTags(p.getPrefferedCoverageTags() != null ? p.getPrefferedCoverageTags() : cur.getPrefferedCoverageTags()) diff --git a/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyFeatureResponseDto.java b/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyFeatureResponseDto.java index 69ccd870..95b74ce2 100644 --- a/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyFeatureResponseDto.java +++ b/src/main/java/com/example/RealMatch/user/presentation/dto/response/MyFeatureResponseDto.java @@ -31,6 +31,7 @@ public record ContentsType( List avgVideoLength, List avgViews, List contentFormats, + List contentCategories, List contentTones, List desiredInvolvement, List desiredUsageScope