diff --git a/luoo_common/src/main/java/constants/Constants.java b/luoo_common/src/main/java/constants/Constants.java index b86ce4e..a6d1bbb 100644 --- a/luoo_common/src/main/java/constants/Constants.java +++ b/luoo_common/src/main/java/constants/Constants.java @@ -18,6 +18,8 @@ public class Constants { public static final String RESOURCE_PREFIX = "http://cdn.indie.cn/"; public static final String MUSIC_RESOURCE_PREFIX = RESOURCE_PREFIX + "music/"; + public static final String TAG_RESOURCE_PREFIX = RESOURCE_PREFIX + "tag/"; + public static final String DEFAULT_USER_AVATAR = "user/avatar/default_20240129_111811.jpg"; public static final Integer LENGTH_8 = 8; diff --git a/luoo_music/src/main/java/com/luoo/music/controller/SearchController.java b/luoo_music/src/main/java/com/luoo/music/controller/SearchController.java index 88fb9fa..4a8128c 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/SearchController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/SearchController.java @@ -109,6 +109,7 @@ public class SearchController { private SearchCategoryDTO getSearchCategoryDTO(Tag tag) { SearchCategoryDTO searchCategoryDTO = new SearchCategoryDTO(); BeanUtils.copyProperties(tag, searchCategoryDTO); + searchCategoryDTO.setImage(Constants.TAG_RESOURCE_PREFIX+tag.getImage()); return searchCategoryDTO; } } diff --git a/luoo_music/src/main/java/com/luoo/music/dto/mapper/JournalMapper.java b/luoo_music/src/main/java/com/luoo/music/dto/mapper/JournalMapper.java index b964019..31795a1 100644 --- a/luoo_music/src/main/java/com/luoo/music/dto/mapper/JournalMapper.java +++ b/luoo_music/src/main/java/com/luoo/music/dto/mapper/JournalMapper.java @@ -28,6 +28,7 @@ import util.StringTools; public class JournalMapper { // mock data + private static final List DEFAULT_TAGS=Arrays.asList("暂无标签"); private static final String JOURNAL_TAG_FILE_PATH = "journalTags.txt"; private static final Map> journalTagMap = new HashMap<>(); private static final String[] EDITOR = new String[] { "左岸以西", "落在低处" }; @@ -93,7 +94,7 @@ public class JournalMapper { } private static List getTags(String journalNo) { - return journalTagMap.getOrDefault(journalNo, Collections.emptyList()); + return journalTagMap.getOrDefault(journalNo, DEFAULT_TAGS); } private static String getEditDate(Journal journal) { diff --git a/luoo_user/src/main/java/com/luoo/user/dto/response/UserRespDTO.java b/luoo_user/src/main/java/com/luoo/user/dto/response/UserRespDTO.java index 471630e..25374f9 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/response/UserRespDTO.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/response/UserRespDTO.java @@ -1,5 +1,7 @@ package com.luoo.user.dto.response; +import java.util.List; + import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -16,7 +18,7 @@ public class UserRespDTO { @ApiModelProperty(value = "个性签名,首次注册登录,默认为“无签名”") private String signature; @ApiModelProperty(value = "用户标识,如“贡献者”,“音乐人”") - private String badge; + private List badge; @ApiModelProperty(value = "关注数") private int followCount; @ApiModelProperty(value = "粉丝数")