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
0413dd68
Commit
0413dd68
authored
3 years ago
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品接口修改
parent
0bdbd00c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
592 additions
and
307 deletions
+592
-307
AttachmentDetailVo.java
.../com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
+3
-3
ProductInfoVO.java
...com/tanpu/community/api/beans/vo/feign/ProductInfoVO.java
+5
-1
UserInfoVo.java
...va/com/tanpu/community/api/beans/vo/feign/UserInfoVo.java
+55
-0
FeignBackClientForCourse.java
...anpu/community/feign/course/FeignBackClientForCourse.java
+2
-2
FeignClientForFatools.java
.../tanpu/community/feign/fatools/FeignClientForFatools.java
+31
-0
FeignbackForFatools.java
...om/tanpu/community/feign/fatools/FeignbackForFatools.java
+40
-0
FeignForFund.java
.../java/com/tanpu/community/feign/product/FeignForFund.java
+28
-0
FeignForPublicFund.java
...com/tanpu/community/feign/product/FeignForPublicFund.java
+20
-0
FeignbackForFund.java
...a/com/tanpu/community/feign/product/FeignbackForFund.java
+36
-0
FeignbackForPublicFund.java
...tanpu/community/feign/product/FeignbackForPublicFund.java
+25
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+13
-77
ProductService.java
...main/java/com/tanpu/community/service/ProductService.java
+321
-221
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+13
-3
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
View file @
0413dd68
...
...
@@ -18,10 +18,10 @@ public class AttachmentDetailVo {
@ApiModelProperty
(
"直播信息"
)
private
ZhiboListResp
zhibo
;
@ApiModelProperty
(
"产品信息"
)
private
ProductInfoVO
product
;
private
FundInfoBaseResp
product
;
@ApiModelProperty
(
"短视频"
)
private
ShortVideoBaseInfoResp
shortVideo
;
@ApiModelProperty
(
"
新版
课程"
)
private
CoursePackageDetail
course
;
@ApiModelProperty
(
"课程"
)
private
ShortVideoBaseInfoResp
curriculum
;
}
This diff is collapsed.
Click to expand it.
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/ProductInfoVO.java
View file @
0413dd68
...
...
@@ -7,6 +7,10 @@ import lombok.Data;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author: zhoupeng
* @email: zhoupeng_08@163.com
*/
@ApiModel
(
"产品信息"
)
@Data
public
class
ProductInfoVO
{
...
...
@@ -154,7 +158,7 @@ public class ProductInfoVO {
private
Integer
fundNum
;
@ApiModelProperty
(
"公司资产规模"
)
private
Integer
companyAssetSize
;
private
String
companyAssetSize
;
@ApiModelProperty
(
"点评"
)
private
List
<
Type
>
commentContent
;
...
...
This diff is collapsed.
Click to expand it.
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/UserInfoVo.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
@ApiModel
(
description
=
"用户信息"
)
@Data
public
class
UserInfoVo
{
@ApiModelProperty
(
"用户ID"
)
private
String
id
;
@ApiModelProperty
(
"用户姓名"
)
private
String
uiUsername
;
@ApiModelProperty
(
"用户昵称"
)
private
String
uiNickname
;
@ApiModelProperty
(
"用户头像"
)
private
String
uiHeadimg
;
@ApiModelProperty
(
"用户头像"
)
private
String
uiHeadimgMp
;
@ApiModelProperty
(
"二维码名片图片"
)
private
String
uiWechatQrcode
;
@ApiModelProperty
(
"微店小程序图片"
)
private
String
uiWechatXcxQrcode
;
@ApiModelProperty
(
"用户权限"
)
private
String
uiAuth
;
@ApiModelProperty
(
"用户手机号"
)
private
String
uiMobilephoneMp
;
@ApiModelProperty
(
"名片电话"
)
private
String
uiTelphoneMp
;
@ApiModelProperty
(
"注册手机号"
)
private
String
uiTelphone
;
@ApiModelProperty
(
"微信id'"
)
private
String
uiOpenId
;
@ApiModelProperty
(
"realname"
)
private
String
realname
;
@ApiModelProperty
(
"level"
)
private
Integer
level
;
@ApiModelProperty
(
"0游客,1注册用户,20探普理顾 30:探普专家理顾 40:交易理财师"
)
private
Integer
levelGrade
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
"注册时间"
)
private
Date
uiRegisterTime
;
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/course/FeignBackClientForCourse.java
View file @
0413dd68
...
...
@@ -17,14 +17,14 @@ public class FeignBackClientForCourse implements FallbackFactory<FeignClientForC
public
CommonResp
<
CourseDetailExt
>
getCourseIdDetailInfo
(
String
id
,
String
packageId
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForCourse.getCourseIdDetailInfo-查询课程id:{},package:{}"
,
id
,
packageId
);
return
null
;
return
CommonResp
.
failed
(
"调用getCourseIdDetailInfo失败"
)
;
}
@Override
public
CommonResp
<
CoursePackageDetail
>
getCoursePackageDetailInfo
(
String
id
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForCourse.getCoursePackageDetailInfo-查询课程包id:{}"
,
id
);
return
null
;
return
CommonResp
.
failed
(
"调用getCoursePackageDetailInfo失败"
)
;
}
};
}
...
...
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignClientForFatools.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
fatools
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.UserInfoVo
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Set
;
//@FeignClient(value = "fatools", fallbackFactory = FeignbackForFatools.class, url = "http://127.0.0.1:8189/fatools")
@FeignClient
(
value
=
"fatools"
,
contextId
=
"fatoolsUser"
,
fallbackFactory
=
FeignbackForFatools
.
class
,
path
=
"/fatools"
)
public
interface
FeignClientForFatools
{
@ApiOperation
(
value
=
"查询用户详情"
)
@GetMapping
(
"/user/getUserInfoById"
)
UserInfoVo
getUserInfoById
(
@RequestParam
(
"userId"
)
String
userId
);
@GetMapping
(
"/column/getCurriculumByColumnRelId"
)
List
<
ShortVideoBaseInfoResp
>
getCurriculumByColumnRelId
(
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
@ApiOperation
(
value
=
"获取不能转播直播"
)
@GetMapping
(
value
=
"/app/getNotRelaySet"
)
CommonResp
<
Set
<
String
>>
getNotRelaySet
(
@ApiParam
(
"用户id"
)
@RequestParam
(
"userId"
)
String
userId
,
@ApiParam
(
"直播列表id"
)
@RequestParam
(
"roomIds"
)
Set
<
String
>
roomIds
);
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignbackForFatools.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
fatools
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.UserInfoVo
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Set
;
@Slf4j
@Component
public
class
FeignbackForFatools
implements
FallbackFactory
<
FeignClientForFatools
>
{
@Override
public
FeignClientForFatools
create
(
Throwable
throwable
)
{
return
new
FeignClientForFatools
()
{
@Override
public
UserInfoVo
getUserInfoById
(
String
userId
)
{
log
.
info
(
"FeignbackForFatools.getUserInfoById调用失败"
,
throwable
);
return
null
;
}
@Override
public
List
<
ShortVideoBaseInfoResp
>
getCurriculumByColumnRelId
(
List
<
String
>
ids
)
{
log
.
info
(
"FeignbackForFatools.getCurriculumByColumnRelId调用失败"
,
throwable
);
return
null
;
}
@Override
public
CommonResp
<
Set
<
String
>>
getNotRelaySet
(
String
userId
,
Set
roomIds
)
{
log
.
info
(
"FeignbackForFatools.getNotRelaySet"
,
throwable
);
return
CommonResp
.
error
();
}
};
}
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/product/FeignForFund.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
//@FeignClient(value = "service-fund", url = "http://127.0.0.1:8194/fund")
@FeignClient
(
value
=
"service-fund"
,
path
=
"/fund"
)
public
interface
FeignForFund
{
@ApiOperation
(
"获取产品详情"
)
@GetMapping
(
"/product/list"
)
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
@ApiOperation
(
"获取ifa导入产品"
)
@GetMapping
(
"/privatefund/list"
)
CommonResp
<
List
<
ProductInfoVO
>>
getPrivateFundList
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
@ApiOperation
(
"获取非净值产品"
)
@GetMapping
(
"/product/not/net"
)
CommonResp
<
List
<
ProductInfoVO
>>
getProductListNotNetInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/product/FeignForPublicFund.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
//@FeignClient(value = "service-fundpublic", url = "http://127.0.0.1:8194/fundpublic")
@FeignClient
(
value
=
"service-fundpublic"
,
path
=
"/fundpublic"
)
public
interface
FeignForPublicFund
{
@ApiOperation
(
"获取产品详情"
)
@GetMapping
(
"/product/list"
)
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/product/FeignbackForFund.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignbackForFund
implements
FallbackFactory
<
FeignForFund
>
{
@Override
public
FeignForFund
create
(
Throwable
throwable
)
{
return
new
FeignForFund
()
{
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
List
<
String
>
ids
)
{
log
.
error
(
"FeignbackForFund.getProductList"
);
return
CommonResp
.
failed
(
"调用私募详情失败"
);
}
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getPrivateFundList
(
List
<
String
>
ids
)
{
log
.
error
(
"FeignbackForFund.getPrivateFundList"
);
return
CommonResp
.
failed
(
"调用ifa导入基金失败"
);
}
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getProductListNotNetInfo
(
List
<
String
>
ids
)
{
log
.
error
(
"FeignbackForFund.getProductListNotNetInfo"
,
throwable
);
return
CommonResp
.
failed
(
"查询无净值产品"
);
}
};
}
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/feign/product/FeignbackForPublicFund.java
0 → 100644
View file @
0413dd68
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignbackForPublicFund
implements
FallbackFactory
<
FeignForPublicFund
>
{
@Override
public
FeignForPublicFund
create
(
Throwable
throwable
)
{
return
new
FeignForPublicFund
()
{
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
List
<
String
>
ids
)
{
log
.
error
(
"getProductList.getProductList"
);
return
CommonResp
.
failed
(
"调用公募详情失败"
);
}
};
}
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
0413dd68
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.CommunityConstant
;
import
com.tanpu.community.api.beans.qo.AttachmentDetailVo
;
import
com.tanpu.community.api.beans.qo.FormerThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeContentQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.theme.*
;
import
com.tanpu.community.api.beans.vo.feign.*
;
import
com.tanpu.community.api.enums.*
;
import
com.tanpu.community.api.enums.BlockTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.ThemeListTypeEnum
;
import
com.tanpu.community.api.enums.ThemeTypeEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
import
com.tanpu.community.feign.product.FeignClientForProducts
;
import
com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom
;
import
com.tanpu.community.feign.zhibo.FeignClientForZhibo
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.other.*
;
import
com.tanpu.community.util.ConvertUtil
;
...
...
@@ -29,7 +23,10 @@ import javax.annotation.Resource;
import
java.time.Duration
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
@Service
public
class
ThemeManager
{
...
...
@@ -70,16 +67,7 @@ public class ThemeManager {
private
HomePageService
homePageService
;
@Resource
private
FeignClientForTanpuroom
feignClientForTanpuroom
;
@Resource
private
FeignClientForZhibo
feignClientForZhibo
;
@Resource
private
FeignClientForProducts
feignClientForProducts
;
@Autowired
private
FeignClientForCourse
feignClientForCourse
;
private
ProductService
productService
;
@Autowired
private
OSSFileService
ossFileService
;
...
...
@@ -140,7 +128,7 @@ public class ThemeManager {
if
(
themeEntity
==
null
)
{
throw
new
BizException
(
"找不到帖子id:"
+
themeId
);
}
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
2
(
themeEntity
);
buildMainTestExtraInfo
(
themeQo
,
userId
);
return
themeQo
;
}
...
...
@@ -220,6 +208,7 @@ public class ThemeManager {
//主题Entity转QO
private
List
<
ThemeQo
>
convertEntityToQo
(
List
<
ThemeEntity
>
themeEntities
,
String
userId
)
{
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
productService
.
transferAttachment
(
themeQos
,
userId
);
for
(
ThemeQo
themeQO
:
themeQos
)
{
buildThemeQoExtraInfo
(
userId
,
themeQO
);
}
...
...
@@ -231,15 +220,7 @@ public class ThemeManager {
private
void
buildThemeQoExtraInfo
(
String
userId
,
ThemeQo
themeQo
)
{
//附件列表
String
themeId
=
themeQo
.
getThemeId
();
List
<
ThemeContentQo
>
content
=
themeQo
.
getContent
();
if
(
content
!=
null
&&
content
.
size
()
>
2
)
{
themeQo
.
setContent
(
content
.
subList
(
0
,
2
));
}
content
=
themeQo
.
getContent
();
for
(
ThemeContentQo
themeContentQo
:
content
)
{
transferAttachment
(
themeContentQo
,
userId
);
}
//迄今时间
themeQo
.
setUpToNowTime
(
calUpToNowTime
(
themeQo
.
getCreateTime
()));
...
...
@@ -256,7 +237,7 @@ public class ThemeManager {
//转发原文
String
formerThemeId
=
themeQo
.
getFormerThemeId
();
if
(
formerThemeId
!=
null
){
ThemeQo
formerTheme
=
ConvertUtil
.
themeEntityToQo
(
themeService
.
queryByThemeId
(
formerThemeId
));
ThemeQo
formerTheme
=
ConvertUtil
.
themeEntityToQo
2
(
themeService
.
queryByThemeId
(
formerThemeId
));
if
(
formerTheme
==
null
){
throw
new
BizException
(
"转发主题Id错误,id:"
+
formerThemeId
);
}
...
...
@@ -285,10 +266,6 @@ public class ThemeManager {
private
void
buildMainTestExtraInfo
(
ThemeQo
themeQo
,
String
userId
)
{
//附件列表
String
themeId
=
themeQo
.
getThemeId
();
List
<
ThemeContentQo
>
content
=
themeQo
.
getContent
();
for
(
ThemeContentQo
themeContentQo
:
content
)
{
transferAttachment
(
themeContentQo
,
userId
);
}
//迄今时间
themeQo
.
setUpToNowTime
(
calUpToNowTime
(
themeQo
.
getCreateTime
()));
//用户信息:头像、昵称
...
...
@@ -298,7 +275,7 @@ public class ThemeManager {
//转发原文
String
formerThemeId
=
themeQo
.
getFormerThemeId
();
if
(
formerThemeId
!=
null
){
ThemeQo
formerTheme
=
ConvertUtil
.
themeEntityToQo
(
themeService
.
queryByThemeId
(
formerThemeId
));
ThemeQo
formerTheme
=
ConvertUtil
.
themeEntityToQo
2
(
themeService
.
queryByThemeId
(
formerThemeId
));
if
(
formerTheme
==
null
){
throw
new
BizException
(
"转发主题Id错误,id:"
+
formerThemeId
);
}
...
...
@@ -315,47 +292,6 @@ public class ThemeManager {
}
public
void
transferAttachment
(
ThemeContentQo
themeContentQo
,
String
userId
)
{
String
type
=
themeContentQo
.
getType
();
if
(
RelTypeEnum
.
FUND
.
type
.
equals
(
type
))
{
//产品
String
productId
=
themeContentQo
.
getValue
();
CommonResp
<
ProductInfoVO
>
productDetailInfo
=
feignClientForProducts
.
getProductDetailInfo
(
productId
);
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
product
(
productDetailInfo
.
getData
()).
build
());
}
else
if
(
RelTypeEnum
.
LIVE
.
type
.
equals
(
type
))
{
//直播
String
zhiboId
=
themeContentQo
.
getValue
();
String
[]
roomIds
=
new
String
[]{
zhiboId
};
CommonResp
<
List
<
ZhiboListResp
>>
zhiboDetailVOCommonResp
=
feignClientForZhibo
.
simpleList
(
Arrays
.
asList
(
roomIds
));
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
zhibo
(
zhiboDetailVOCommonResp
.
getData
().
get
(
0
)).
build
());
}
else
if
(
RelTypeEnum
.
SHORT_VIDEO
.
type
.
equals
(
type
))
{
//短视频
String
videoId
=
themeContentQo
.
getValue
();
String
[]
attachmentIds
=
new
String
[]{
videoId
};
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
shortVideoBaseInfo
=
feignClientForTanpuroom
.
getShortVideoBaseInfo
(
Arrays
.
asList
(
attachmentIds
));
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
shortVideo
(
shortVideoBaseInfo
.
getData
().
get
(
0
)).
build
());
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WARE
.
type
.
equals
(
type
))
{
//课程
String
packageId
=
themeContentQo
.
getValue
();
CommonResp
<
CoursePackageDetail
>
courseIdDetailInfo
=
feignClientForCourse
.
getCoursePackageDetailInfo
(
packageId
);
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
course
(
courseIdDetailInfo
.
getData
()).
build
());
}
else
if
(
RelTypeEnum
.
SINGLE_IMG
.
type
.
equals
(
type
))
{
//单图,根据id传入url
String
imgId
=
themeContentQo
.
getValue
();
FileRecordEntity
fileEntity
=
ossFileService
.
queryById
(
imgId
);
if
(
fileEntity
==
null
)
{
throw
new
BizException
(
"图片未找到,id:"
+
imgId
);
}
themeContentQo
.
setValue
(
CommunityConstant
.
OSS_PREFIX_URL
+
fileEntity
.
getFileOssKey
());
}
}
//计算迄今时间
private
String
calUpToNowTime
(
LocalDateTime
start
)
{
...
...
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/service/ProductService.java
View file @
0413dd68
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
0413dd68
...
...
@@ -18,14 +18,19 @@ import java.util.stream.Collectors;
public
class
ConvertUtil
{
public
static
ThemeQo
themeEntityToQo
(
ThemeEntity
themeEntity
)
{
public
static
ThemeQo
themeEntityToQo
2
(
ThemeEntity
themeEntity
)
{
if
(
themeEntity
==
null
){
return
null
;
}
ThemeQo
themeQO
=
new
ThemeQo
();
BeanUtils
.
copyProperties
(
themeEntity
,
themeQO
);
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
themeEntity
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{});
themeQO
.
setContent
(
themeContentQos
);
//首页列表使用,限制附件个数为1(1文本+1附件)
if
(
themeContentQos
!=
null
&&
themeContentQos
.
size
()
>
2
)
{
themeQO
.
setContent
(
themeContentQos
.
subList
(
0
,
2
));
}
else
{
themeQO
.
setContent
(
themeContentQos
);
}
return
themeQO
;
}
...
...
@@ -36,8 +41,13 @@ public class ConvertUtil {
return
themeEntity
;
}
/**
* 首页主题列表,限制附件个数为1(1文本+1附件)
* @param themeEntities
* @return
*/
public
static
List
<
ThemeQo
>
themeEntitiesToDTOs
(
List
<
ThemeEntity
>
themeEntities
)
{
return
themeEntities
.
stream
().
map
(
ConvertUtil:
:
themeEntityToQo
).
collect
(
Collectors
.
toList
());
return
themeEntities
.
stream
().
map
(
ConvertUtil:
:
themeEntityToQo
2
).
collect
(
Collectors
.
toList
());
}
...
...
This diff is collapsed.
Click to expand it.
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