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
20365d17
Commit
20365d17
authored
Feb 22, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间格式化
parent
5fbe7a74
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
+23
-14
FundCompanyVO.java
...u/community/api/beans/vo/feign/product/FundCompanyVO.java
+3
-1
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+2
-3
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+1
-1
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+3
-1
TimeUtils.java
...ice/src/main/java/com/tanpu/community/util/TimeUtils.java
+14
-8
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/product/FundCompanyVO.java
View file @
20365d17
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
product
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
product
;
import
com.tanpu.community.api.beans.vo.feign.product.Net
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -16,6 +15,9 @@ public class FundCompanyVO {
...
@@ -16,6 +15,9 @@ public class FundCompanyVO {
@ApiModelProperty
(
"icon"
)
@ApiModelProperty
(
"icon"
)
private
String
img
;
private
String
img
;
@ApiModelProperty
(
"公司类型,0 公募,1 私募,2 白名单,3 私有 "
)
private
String
type
;
@ApiModelProperty
(
"公司简介"
)
@ApiModelProperty
(
"公司简介"
)
private
String
companyProfile
;
private
String
companyProfile
;
...
...
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
20365d17
...
@@ -23,7 +23,6 @@ import io.swagger.annotations.ApiOperation;
...
@@ -23,7 +23,6 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -41,10 +40,10 @@ import java.util.List;
...
@@ -41,10 +40,10 @@ import java.util.List;
@RequestMapping
(
value
=
"/api/homepage"
)
@RequestMapping
(
value
=
"/api/homepage"
)
public
class
HomePageController
{
public
class
HomePageController
{
@
Autowired
@
Resource
private
HomePageManager
homePageManager
;
private
HomePageManager
homePageManager
;
@
Autowired
@
Resource
private
ThemeManager
themeManager
;
private
ThemeManager
themeManager
;
@Resource
@Resource
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
20365d17
...
@@ -126,7 +126,7 @@ public class TopicManager {
...
@@ -126,7 +126,7 @@ public class TopicManager {
return
CommonResp
.
error
(
ErrorCodeConstant
.
TOPIC_NOT_FOUND
.
getCode
(),
"抱歉!该话题已下线。"
);
return
CommonResp
.
error
(
ErrorCodeConstant
.
TOPIC_NOT_FOUND
.
getCode
(),
"抱歉!该话题已下线。"
);
}
}
//
//
检验权限
if
(
TopicSpecialPermissionEnum
.
TRUE
.
getCode
().
equals
(
topicEntity
.
getSpecialPermission
())
&&
if
(
TopicSpecialPermissionEnum
.
TRUE
.
getCode
().
equals
(
topicEntity
.
getSpecialPermission
())
&&
!
topicService
.
checkPermission
(
topicId
,
userHolder
.
getUserId
()))
{
!
topicService
.
checkPermission
(
topicId
,
userHolder
.
getUserId
()))
{
return
CommonResp
.
error
(
ErrorCodeConstant
.
TOPIC_PERMISSION_ABORT
.
getCode
(),
topicService
.
getPermissionToast
(
topicId
));
return
CommonResp
.
error
(
ErrorCodeConstant
.
TOPIC_PERMISSION_ABORT
.
getCode
(),
topicService
.
getPermissionToast
(
topicId
));
...
...
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
20365d17
...
@@ -204,8 +204,10 @@ public class TopicService {
...
@@ -204,8 +204,10 @@ public class TopicService {
}
else
if
(
RelTypeEnum
.
FUND_COMPANY
.
type
.
equals
(
entity
.
getSubjectType
().
toString
()))
{
}
else
if
(
RelTypeEnum
.
FUND_COMPANY
.
type
.
equals
(
entity
.
getSubjectType
().
toString
()))
{
// 资管人
// 资管人
List
<
FundCompanyVO
>
fundCompany
=
feignService
.
getFundCompany
(
Collections
.
singletonList
(
entity
.
getSubjectId
()));
List
<
FundCompanyVO
>
fundCompany
=
feignService
.
getFundCompany
(
Collections
.
singletonList
(
entity
.
getSubjectId
()));
FundCompanyVO
company
=
fundCompany
.
get
(
0
);
company
.
setType
(
String
.
valueOf
(
entity
.
getSubjectSubType
()));
// 公司类型
TopicAttachment
attach
=
TopicAttachment
.
builder
().
type
(
RelTypeEnum
.
FUND_COMPANY
.
type
)
TopicAttachment
attach
=
TopicAttachment
.
builder
().
type
(
RelTypeEnum
.
FUND_COMPANY
.
type
)
.
detail
(
TopicAttachmentDetail
.
builder
().
fundCompany
(
fundCompany
.
get
(
0
)
).
build
()).
build
();
.
detail
(
TopicAttachmentDetail
.
builder
().
fundCompany
(
company
).
build
()).
build
();
attachements
.
add
(
attach
);
attachements
.
add
(
attach
);
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WARE
.
type
.
equals
(
entity
.
getSubjectType
().
toString
()))
{
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WARE
.
type
.
equals
(
entity
.
getSubjectType
().
toString
()))
{
...
...
community-service/src/main/java/com/tanpu/community/util/TimeUtils.java
View file @
20365d17
...
@@ -2,7 +2,9 @@ package com.tanpu.community.util;
...
@@ -2,7 +2,9 @@ package com.tanpu.community.util;
import
java.time.Duration
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
...
@@ -41,16 +43,20 @@ public class TimeUtils {
...
@@ -41,16 +43,20 @@ public class TimeUtils {
/**
/**
* 格式化话题列表时间
* 格式化话题列表时间
* 发布时间 = Today,显示时间格式:00:00 ,24小时制
* 发布时间 = Today-1,显示时间格式:昨日 00:00 ,24小时制
* 发布时间 <Today-1,显示时间格式:yyyy年mm月dd日
*/
*/
public
static
String
formatTopicListTime
(
LocalDateTime
start
)
{
public
static
String
formatTopicListTime
(
LocalDateTime
target
)
{
Duration
between
=
Duration
.
between
(
start
,
LocalDateTime
.
now
());
LocalDateTime
dayBegin
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
);
long
duration
=
between
.
toMinutes
();
LocalDateTime
lastDayBegin
=
dayBegin
.
minusDays
(
1
);
if
(
duration
<
60
*
24
)
{
return
start
.
format
(
DateTimeFormatter
.
ofPattern
(
" HH:mm"
));
if
(
target
.
isAfter
(
dayBegin
))
{
}
else
if
(
duration
<
60
*
48
)
{
return
target
.
format
(
DateTimeFormatter
.
ofPattern
(
" HH:mm"
));
return
start
.
format
(
DateTimeFormatter
.
ofPattern
(
"昨天 HH:mm"
));
}
else
if
(
target
.
isAfter
(
lastDayBegin
))
{
return
target
.
format
(
DateTimeFormatter
.
ofPattern
(
"昨天 HH:mm"
));
}
}
return
star
t
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy年MM月dd日"
));
return
targe
t
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy年MM月dd日"
));
}
}
public
static
String
format
(
LocalDateTime
start
)
{
public
static
String
format
(
LocalDateTime
start
)
{
...
...
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