Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
3f82e26d
Commit
3f82e26d
authored
Aug 10, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间格式化
parent
f98c45b9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+4
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+0
-2
RankService.java
...rc/main/java/com/tanpu/community/service/RankService.java
+1
-1
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+1
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
3f82e26d
...
@@ -59,9 +59,12 @@ public class ThemeQo implements Serializable {
...
@@ -59,9 +59,12 @@ public class ThemeQo implements Serializable {
@ApiModelProperty
(
value
=
"认证机构"
)
@ApiModelProperty
(
value
=
"认证机构"
)
private
String
authOrg
;
private
String
authOrg
;
@ApiModelProperty
(
value
=
"发表时间"
)
@ApiModelProperty
(
value
=
"发表时间
-距今
"
)
public
String
upToNowTime
;
public
String
upToNowTime
;
@ApiModelProperty
(
value
=
"发表时间-标准格式化"
)
public
String
formatTime
;
@ApiModelProperty
(
value
=
"转发量"
)
@ApiModelProperty
(
value
=
"转发量"
)
public
Integer
forwardCount
;
public
Integer
forwardCount
;
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
3f82e26d
...
@@ -643,8 +643,6 @@ public class ThemeManager {
...
@@ -643,8 +643,6 @@ public class ThemeManager {
//转发、收藏、点赞
//转发、收藏、点赞
buildThemeQoExtraInfo
(
themeQo
);
buildThemeQoExtraInfo
(
themeQo
);
//时间重制
themeQo
.
setUpToNowTime
(
TimeUtils
.
format
(
themeEntity
.
getCreateTime
()));
// 添加用户相关信息
// 添加用户相关信息
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
return
CommonResp
.
success
(
themeQo
);
return
CommonResp
.
success
(
themeQo
);
...
...
community-service/src/main/java/com/tanpu/community/service/RankService.java
View file @
3f82e26d
...
@@ -132,7 +132,7 @@ public class RankService {
...
@@ -132,7 +132,7 @@ public class RankService {
}
}
//排序
//排序
Map
<
ThemeAnalysDO
,
Double
>
map
=
themeAnalysDOS
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
,
ThemeAnalysDO:
:
getScore
));
Map
<
ThemeAnalysDO
,
Double
>
map
=
themeAnalysDOS
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
,
ThemeAnalysDO:
:
getScore
));
//排序
hotestThemes
=
map
.
entrySet
().
stream
()
hotestThemes
=
map
.
entrySet
().
stream
()
.
sorted
(
Map
.
Entry
.
comparingByValue
(
Comparator
.
reverseOrder
()))
.
sorted
(
Map
.
Entry
.
comparingByValue
(
Comparator
.
reverseOrder
()))
.
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
.
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
3f82e26d
...
@@ -47,6 +47,7 @@ public class ConvertUtil {
...
@@ -47,6 +47,7 @@ public class ConvertUtil {
themeQO
.
setUpdateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getUpdateTime
()));
themeQO
.
setUpdateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getUpdateTime
()));
themeQO
.
setCreateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setCreateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setUpToNowTime
(
TimeUtils
.
calUpToNowTime
(
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
>>()
{
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
themeEntity
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{
});
});
themeQO
.
setContent
(
themeContentQos
);
themeQO
.
setContent
(
themeContentQos
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment