Commit 3f82e26d authored by 刘基明's avatar 刘基明

时间格式化

parent f98c45b9
......@@ -59,9 +59,12 @@ public class ThemeQo implements Serializable {
@ApiModelProperty(value = "认证机构")
private String authOrg;
@ApiModelProperty(value = "发表时间")
@ApiModelProperty(value = "发表时间-距今")
public String upToNowTime;
@ApiModelProperty(value = "发表时间-标准格式化")
public String formatTime;
@ApiModelProperty(value = "转发量")
public Integer forwardCount;
......
......@@ -643,8 +643,6 @@ public class ThemeManager {
//转发、收藏、点赞
buildThemeQoExtraInfo(themeQo);
//时间重制
themeQo.setUpToNowTime(TimeUtils.format(themeEntity.getCreateTime()));
// 添加用户相关信息
buildThemeExtraInfoByUser(userId, themeQo);
return CommonResp.success(themeQo);
......
......@@ -132,7 +132,7 @@ public class RankService {
}
//排序
Map<ThemeAnalysDO, Double> map = themeAnalysDOS.stream().collect(Collectors.toMap(o -> o, ThemeAnalysDO::getScore));
//排序
hotestThemes = map.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.map(Map.Entry::getKey).collect(Collectors.toList());
......
......@@ -47,6 +47,7 @@ public class ConvertUtil {
themeQO.setUpdateTime(TimeUtils.getTimestampOfDateTime(themeEntity.getUpdateTime()));
themeQO.setCreateTime(TimeUtils.getTimestampOfDateTime(themeEntity.getCreateTime()));
themeQO.setUpToNowTime(TimeUtils.calUpToNowTime(themeEntity.getCreateTime()));
themeQO.setFormatTime(TimeUtils.format(themeEntity.getCreateTime()));
List<ThemeContentQo> themeContentQos = JsonUtil.toBean(themeEntity.getContent(), new TypeReference<List<ThemeContentQo>>() {
});
themeQO.setContent(themeContentQos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment