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
108f9fda
Commit
108f9fda
authored
Jul 12, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
2814329d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
469 additions
and
36 deletions
+469
-36
AttachmentDetailVo.java
.../com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
+8
-11
CommentQo.java
...main/java/com/tanpu/community/api/beans/qo/CommentQo.java
+1
-1
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+2
-2
CreateCommentReq.java
...npu/community/api/beans/req/comment/CreateCommentReq.java
+2
-1
LikeCommentReq.java
...tanpu/community/api/beans/req/comment/LikeCommentReq.java
+16
-0
CourseSimpleResp.java
.../tanpu/community/api/beans/vo/feign/CourseSimpleResp.java
+50
-0
FundInfoBaseResp.java
.../tanpu/community/api/beans/vo/feign/FundInfoBaseResp.java
+74
-0
ZhiboListResp.java
...com/tanpu/community/api/beans/vo/feign/ZhiboListResp.java
+50
-0
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+8
-7
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+1
-1
FeignClientForCourse.java
...om/tanpu/community/feign/course/FeignClientForCourse.java
+1
-0
FeignClientForZhibo.java
.../com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
+5
-0
FeignbackForZhibo.java
...va/com/tanpu/community/feign/zhibo/FeignbackForZhibo.java
+7
-0
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+16
-4
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+7
-9
ProductService.java
...main/java/com/tanpu/community/service/ProductService.java
+221
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
View file @
108f9fda
...
@@ -15,16 +15,13 @@ import lombok.NoArgsConstructor;
...
@@ -15,16 +15,13 @@ import lombok.NoArgsConstructor;
@ApiModel
(
value
=
"附件对象"
)
@ApiModel
(
value
=
"附件对象"
)
public
class
AttachmentDetailVo
{
public
class
AttachmentDetailVo
{
@ApiModelProperty
(
value
=
"产品"
)
@ApiModelProperty
(
"直播信息"
)
private
ProductInfoVO
productInfoVO
;
private
ZhiboListResp
zhibo
;
@ApiModelProperty
(
"产品信息"
)
@ApiModelProperty
(
value
=
"直播"
)
private
ProductInfoVO
product
;
private
ZhiboDetailVO
zhiboDetailVO
;
@ApiModelProperty
(
"短视频"
)
private
ShortVideoBaseInfoResp
shortVideo
;
@ApiModelProperty
(
value
=
"短视频"
)
@ApiModelProperty
(
"新版课程"
)
private
ShortVideoBaseInfoResp
shortVideoBaseInfoResp
;
private
CoursePackageDetail
course
;
@ApiModelProperty
(
value
=
"课程"
)
private
CoursePackageDetail
coursePackageDetail
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/CommentQo.java
View file @
108f9fda
...
@@ -40,7 +40,7 @@ public class CommentQo {
...
@@ -40,7 +40,7 @@ public class CommentQo {
private
String
userImg
;
private
String
userImg
;
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
private
boolean
i
sLiked
;
private
boolean
ha
sLiked
;
@ApiModelProperty
(
value
=
"2级评论"
)
@ApiModelProperty
(
value
=
"2级评论"
)
private
List
<
CommentLv2Qo
>
commentLv2Qos
;
private
List
<
CommentLv2Qo
>
commentLv2Qos
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
108f9fda
...
@@ -60,10 +60,10 @@ public class ThemeQo {
...
@@ -60,10 +60,10 @@ public class ThemeQo {
@ApiModelProperty
(
value
=
"点赞量"
)
@ApiModelProperty
(
value
=
"点赞量"
)
private
Integer
likeCount
;
private
Integer
likeCount
;
@ApiModelProperty
(
value
=
"当前用户是否点赞
该主题
"
)
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
private
boolean
hasLiked
;
private
boolean
hasLiked
;
@ApiModelProperty
(
value
=
"当前用户是否转发
该主题
"
)
@ApiModelProperty
(
value
=
"当前用户是否转发"
)
private
boolean
hasForward
;
private
boolean
hasForward
;
@ApiModelProperty
(
value
=
"图片九宫格"
)
@ApiModelProperty
(
value
=
"图片九宫格"
)
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/CreateCommentReq.java
View file @
108f9fda
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
@ApiModel
@ApiModel
...
@@ -20,7 +21,7 @@ public class CreateCommentReq {
...
@@ -20,7 +21,7 @@ public class CreateCommentReq {
@ApiModelProperty
(
value
=
"回复对象的id(非对评论回复时,此项为空)"
)
@ApiModelProperty
(
value
=
"回复对象的id(非对评论回复时,此项为空)"
)
private
String
replyId
;
private
String
replyId
;
@Not
Empty
(
message
=
"评论内容不能为空"
)
@Not
Blank
(
message
=
"评论内容不能为空"
)
@ApiModelProperty
(
value
=
"评论内容"
)
@ApiModelProperty
(
value
=
"评论内容"
)
private
String
comment
;
private
String
comment
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/LikeCommentReq.java
0 → 100644
View file @
108f9fda
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
comment
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"点赞/取消点赞评论"
)
@Data
public
class
LikeCommentReq
{
@ApiModelProperty
(
value
=
"评论Id"
)
private
String
commentId
;
@ApiModelProperty
(
value
=
"类型,1:点赞 2:取消点赞"
)
private
Integer
type
;
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CourseSimpleResp.java
0 → 100644
View file @
108f9fda
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@ApiModel
(
"课程基本信息"
)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
CourseSimpleResp
{
@ApiModelProperty
(
"课程id"
)
private
String
courseId
;
@ApiModelProperty
(
"课程包Id"
)
private
String
coursePackageId
;
@ApiModelProperty
(
"课程包名称"
)
private
String
packageName
;
@ApiModelProperty
(
"课程名称"
)
private
String
title
;
@ApiModelProperty
(
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
"多少人已学习"
)
private
Integer
readNum
;
@ApiModelProperty
(
"是否引用讲师头像 0否 1是;bgStatus=0时,直接展示squareImg;bgStatus=1时,将squareImg与bgImg叠加展示"
)
private
Integer
bgStatus
;
@ApiModelProperty
(
"方图"
)
private
String
squareImg
;
@ApiModelProperty
(
"背景图地址"
)
private
String
bgImg
;
@ApiModelProperty
(
"播放地址"
)
private
String
url
;
@ApiModelProperty
(
"1:音频 2:视频"
)
private
Integer
type
;
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/FundInfoBaseResp.java
0 → 100644
View file @
108f9fda
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.SuperBuilder
;
/**
* 基金基础信息(精简)
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public
class
FundInfoBaseResp
{
/**
* 基金id
*/
@ApiModelProperty
(
"基金id"
)
private
String
fundId
;
@ApiModelProperty
(
"基金名称"
)
private
String
productName
;
@ApiModelProperty
(
"产品类型"
)
private
Integer
productType
;
/**
* 私募基金类型:1-信托计划,2-有限合伙,3-券商资管,4-公募专户,5-单账户,6-证券投资基金,7-海外基金,8-期货资管,9-保险资管、10-创业投资基金、11-股权投资基金、12-银行理财、13-类固收信托、-1其他投资基金
* 公募基金类型:1-混合型、2-债券型、3-定开债券、4-联接基金、5-货币型、6-债券指数、7-保本型、8-理财型、9-QDII、10-股票指数、11-QDII-指数、12-股票型、13-固定收益、14-分级杠杆、15-ETF-场内、16-QDII-ETF、17-债券创新-场内、18-封闭式
*/
private
Integer
fundType
;
/**
* 开放日
*/
@ApiModelProperty
(
"开放日"
)
private
String
openDay
;
/**
* 融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-固定收益策略,7-组合基金,8-复合策略,-1-其它策略
*/
private
Integer
strategy
;
/**
* 融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'
*/
@ApiModelProperty
(
"子策略"
)
private
Integer
substrategy
;
/**
* 风险等级 1:低风险 2:中低风险 3:中等风险 4:中高风险 5:高风险
*/
@ApiModelProperty
(
"风险等级"
)
private
Integer
riskLevel
;
@ApiModelProperty
(
"是否可预约 0:不可预约 1:可预约"
)
private
Integer
isAppoint
;
@ApiModelProperty
(
"成立以来收益率"
)
private
String
retIncep
;
@ApiModelProperty
(
"起投金额 单位:万"
)
private
String
money
;
@ApiModelProperty
(
"推荐理由"
)
private
String
remark
;
private
String
ratioId
;
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/ZhiboListResp.java
0 → 100644
View file @
108f9fda
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.ToString
;
@ApiModel
(
"直播列表返回结果集合"
)
@Data
@Builder
@ToString
public
class
ZhiboListResp
{
@ApiModelProperty
(
value
=
"直播间ID"
)
private
String
id
;
@ApiModelProperty
(
value
=
"直播标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"列表缩略图"
)
private
String
sourceImg
;
@ApiModelProperty
(
value
=
"讲师"
)
private
String
managerName
;
@ApiModelProperty
(
value
=
"直播状态"
,
notes
=
"1:未开始 2:直播中 3:已结束"
)
private
String
ztStatus
;
@ApiModelProperty
(
value
=
"开播时间"
)
private
Long
ztStarttime
;
@ApiModelProperty
(
value
=
"母直播间Id"
)
private
String
parentId
;
@ApiModelProperty
(
"讲师信息"
)
private
String
bgImg
;
private
String
squareImg
;
@ApiModelProperty
(
"0:不使用 1:使用讲师图"
)
private
Integer
bgStatus
;
@ApiModelProperty
(
"包含课件数量 0:无课件"
)
private
Long
courseWareNum
=
0L
;
@ApiModelProperty
(
"图片地址"
)
private
String
img
;
@ApiModelProperty
(
"访问人次"
)
private
Integer
readNum
;
@ApiModelProperty
(
"预约人数"
)
private
Integer
appointNum
;
}
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
108f9fda
...
@@ -4,6 +4,7 @@ package com.tanpu.community.controller;
...
@@ -4,6 +4,7 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
import
com.tanpu.community.api.beans.req.comment.QueryCommentReq
;
import
com.tanpu.community.api.beans.req.comment.QueryCommentReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.manager.CommentManager
;
import
com.tanpu.community.manager.CommentManager
;
...
@@ -35,28 +36,28 @@ public class CommentController {
...
@@ -35,28 +36,28 @@ public class CommentController {
@ApiOperation
(
"查看评论"
)
@ApiOperation
(
"查看评论"
)
@PostMapping
(
value
=
"/queryComment"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
){
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
)
{
//todo
//todo
String
userId
=
"liujm"
;
String
userId
=
"liujm"
;
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
}
}
@ApiOperation
(
"点赞评论"
)
@ApiOperation
(
"点赞评论"
)
@
Ge
tMapping
(
value
=
"/likeComment"
)
@
Pos
tMapping
(
value
=
"/likeComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
likeComment
(
@RequestParam
String
commentId
){
public
CommonResp
<
Void
>
likeComment
(
@RequestBody
LikeCommentReq
req
)
{
//todo
String
userId
=
"liujm"
;
String
userId
=
"liujm"
;
commentManager
.
likeComment
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
}
}
@ApiOperation
(
"举报评论"
)
@ApiOperation
(
"举报评论"
)
@GetMapping
(
value
=
"/reportComment"
)
@GetMapping
(
value
=
"/reportComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
reportComment
(
@RequestParam
String
commentId
)
{
public
CommonResp
<
Void
>
reportComment
(
@RequestParam
String
commentId
)
{
//todo
//todo
String
userId
=
"liujm"
;
String
userId
=
"liujm"
;
return
CommonResp
.
success
(
);
return
CommonResp
.
failed
(
"功能暂未开放"
);
}
}
}
}
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
108f9fda
...
@@ -91,7 +91,7 @@ public class ThemeController {
...
@@ -91,7 +91,7 @@ public class ThemeController {
@GetMapping
(
value
=
"/share"
)
@GetMapping
(
value
=
"/share"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
shareTheme
(
String
themeId
)
{
public
CommonResp
<
Void
>
shareTheme
(
String
themeId
)
{
return
CommonResp
.
success
(
);
return
CommonResp
.
failed
(
"功能暂未开放"
);
}
}
@ApiOperation
(
"屏蔽"
)
@ApiOperation
(
"屏蔽"
)
...
...
community-service/src/main/java/com/tanpu/community/feign/course/FeignClientForCourse.java
View file @
108f9fda
...
@@ -22,6 +22,7 @@ public interface FeignClientForCourse {
...
@@ -22,6 +22,7 @@ public interface FeignClientForCourse {
@ApiParam
(
"课程包id"
)
@RequestParam
(
"packageId"
)
String
packageId
);
@ApiParam
(
"课程包id"
)
@RequestParam
(
"packageId"
)
String
packageId
);
@ApiOperation
(
"详情页信息"
)
@ApiOperation
(
"详情页信息"
)
@GetMapping
(
"/course/detail"
)
@GetMapping
(
"/course/detail"
)
CommonResp
<
CoursePackageDetail
>
getCoursePackageDetailInfo
(
@ApiParam
(
value
=
"课程包id"
,
required
=
true
)
@RequestParam
(
"id"
)
String
id
);
CommonResp
<
CoursePackageDetail
>
getCoursePackageDetailInfo
(
@ApiParam
(
value
=
"课程包id"
,
required
=
true
)
@RequestParam
(
"id"
)
String
id
);
...
...
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
View file @
108f9fda
...
@@ -2,6 +2,7 @@ package com.tanpu.community.feign.zhibo;
...
@@ -2,6 +2,7 @@ package com.tanpu.community.feign.zhibo;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboDetailVO
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboDetailVO
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboListResp
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -23,4 +24,8 @@ public interface FeignClientForZhibo {
...
@@ -23,4 +24,8 @@ public interface FeignClientForZhibo {
@ApiOperation
(
value
=
"根据id获取直播信息"
)
@ApiOperation
(
value
=
"根据id获取直播信息"
)
@PostMapping
(
"/theme/zhibo/detail"
)
@PostMapping
(
"/theme/zhibo/detail"
)
CommonResp
<
List
<
ZhiboDetailVO
>>
getZhiBoByIds
(
@RequestBody
List
<
String
>
ids
);
CommonResp
<
List
<
ZhiboDetailVO
>>
getZhiBoByIds
(
@RequestBody
List
<
String
>
ids
);
@ApiOperation
(
value
=
"根据Id查询直播基本信息"
)
@PostMapping
(
value
=
"/theme/simpleList"
,
produces
=
{
"application/json"
})
CommonResp
<
List
<
ZhiboListResp
>>
simpleList
(
@RequestBody
List
<
String
>
idList
);
}
}
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignbackForZhibo.java
View file @
108f9fda
...
@@ -2,6 +2,7 @@ package com.tanpu.community.feign.zhibo;
...
@@ -2,6 +2,7 @@ package com.tanpu.community.feign.zhibo;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboDetailVO
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboDetailVO
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboListResp
;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -30,6 +31,12 @@ public class FeignbackForZhibo implements FallbackFactory<FeignClientForZhibo> {
...
@@ -30,6 +31,12 @@ public class FeignbackForZhibo implements FallbackFactory<FeignClientForZhibo> {
return
null
;
return
null
;
}
}
@Override
public
CommonResp
<
List
<
ZhiboListResp
>>
simpleList
(
List
<
String
>
idList
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForZhiboTheme.simpleList探普学堂-查询直播ids:{}"
,
idList
);
return
null
;
}
};
};
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
108f9fda
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
...
@@ -36,13 +36,14 @@ public class CommentManager {
...
@@ -36,13 +36,14 @@ public class CommentManager {
.
parentId
(
req
.
getParentId
())
.
parentId
(
req
.
getParentId
())
.
replyId
(
req
.
getReplyId
())
.
replyId
(
req
.
getReplyId
())
.
authorId
(
userId
)
.
authorId
(
userId
)
.
content
(
JsonUtil
.
toJson
(
req
.
getComment
()
))
.
content
(
req
.
getComment
(
))
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
build
();
.
build
();
commentService
.
insertComment
(
commentEntity
);
commentService
.
insertComment
(
commentEntity
);
}
}
//查询
public
List
<
CommentQo
>
queryComments
(
String
themeId
,
String
userId
)
{
public
List
<
CommentQo
>
queryComments
(
String
themeId
,
String
userId
)
{
List
<
CommentEntity
>
commentEntities
=
commentService
.
selectByThemeIdAndParentId
(
themeId
,
null
);
List
<
CommentEntity
>
commentEntities
=
commentService
.
selectByThemeIdAndParentId
(
themeId
,
null
);
List
<
CommentQo
>
commentQos
=
ConvertUtil
.
commentEntity2Qos
(
commentEntities
);
List
<
CommentQo
>
commentQos
=
ConvertUtil
.
commentEntity2Qos
(
commentEntities
);
...
@@ -59,9 +60,9 @@ public class CommentManager {
...
@@ -59,9 +60,9 @@ public class CommentManager {
//是否点赞及点赞数
//是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
String
commentId
=
commentQo
.
getCommentId
();
if
(
likeCommentList
.
contains
(
commentId
)){
if
(
likeCommentList
.
contains
(
commentId
)){
commentQo
.
setLiked
(
true
);
commentQo
.
set
Has
Liked
(
true
);
}
else
{
}
else
{
commentQo
.
setLiked
(
false
);
commentQo
.
set
Has
Liked
(
false
);
}
}
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
...
@@ -74,4 +75,15 @@ public class CommentManager {
...
@@ -74,4 +75,15 @@ public class CommentManager {
return
commentQos
;
return
commentQos
;
}
}
//点赞评论/取消点赞
public
void
likeComment
(
LikeCommentReq
req
,
String
userId
)
{
//todo 枚举值
if
(
1
==
req
.
getType
()){
collectionService
.
addIfNotExist
(
req
.
getCommentId
(),
userId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
}
else
if
(
2
==
req
.
getType
())
{
collectionService
.
delete
(
req
.
getCommentId
(),
userId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
}
}
}
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
108f9fda
...
@@ -9,10 +9,7 @@ import com.tanpu.community.api.beans.qo.ThemeContentQo;
...
@@ -9,10 +9,7 @@ import com.tanpu.community.api.beans.qo.ThemeContentQo;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.theme.*
;
import
com.tanpu.community.api.beans.req.theme.*
;
import
com.tanpu.community.api.beans.vo.feign.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.*
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboDetailVO
;
import
com.tanpu.community.api.constants.CommunityConstant
;
import
com.tanpu.community.api.constants.CommunityConstant
;
import
com.tanpu.community.api.enums.*
;
import
com.tanpu.community.api.enums.*
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.dao.entity.community.*
;
...
@@ -324,13 +321,14 @@ public class ThemeManager {
...
@@ -324,13 +321,14 @@ public class ThemeManager {
//产品
//产品
String
productId
=
themeContentQo
.
getValue
();
String
productId
=
themeContentQo
.
getValue
();
CommonResp
<
ProductInfoVO
>
productDetailInfo
=
feignClientForProducts
.
getProductDetailInfo
(
productId
);
CommonResp
<
ProductInfoVO
>
productDetailInfo
=
feignClientForProducts
.
getProductDetailInfo
(
productId
);
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
product
InfoVO
(
productDetailInfo
.
getData
()).
build
());
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
product
(
productDetailInfo
.
getData
()).
build
());
}
else
if
(
RelTypeEnum
.
LIVE
.
type
.
equals
(
type
))
{
}
else
if
(
RelTypeEnum
.
LIVE
.
type
.
equals
(
type
))
{
//直播
//直播
String
zhiboId
=
themeContentQo
.
getValue
();
String
zhiboId
=
themeContentQo
.
getValue
();
CommonResp
<
ZhiboDetailVO
>
zhiboDetailVOCommonResp
=
feignClientForZhibo
.
queryZhiboDetail
(
zhiboId
);
String
[]
roomIds
=
new
String
[]{
zhiboId
};
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
zhiboDetailVO
(
zhiboDetailVOCommonResp
.
getData
()).
build
());
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
))
{
}
else
if
(
RelTypeEnum
.
SHORT_VIDEO
.
type
.
equals
(
type
))
{
//短视频
//短视频
...
@@ -338,13 +336,13 @@ public class ThemeManager {
...
@@ -338,13 +336,13 @@ public class ThemeManager {
String
[]
attachmentIds
=
new
String
[]{
videoId
};
String
[]
attachmentIds
=
new
String
[]{
videoId
};
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
shortVideoBaseInfo
=
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
shortVideoBaseInfo
=
feignClientForTanpuroom
.
getShortVideoBaseInfo
(
Arrays
.
asList
(
attachmentIds
));
feignClientForTanpuroom
.
getShortVideoBaseInfo
(
Arrays
.
asList
(
attachmentIds
));
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
shortVideo
BaseInfoResp
(
shortVideoBaseInfo
.
getData
().
get
(
0
)).
build
());
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
shortVideo
(
shortVideoBaseInfo
.
getData
().
get
(
0
)).
build
());
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WARE
.
type
.
equals
(
type
))
{
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WARE
.
type
.
equals
(
type
))
{
//课程
//课程
String
packageId
=
themeContentQo
.
getValue
();
String
packageId
=
themeContentQo
.
getValue
();
CommonResp
<
CoursePackageDetail
>
courseIdDetailInfo
=
feignClientForCourse
.
getCoursePackageDetailInfo
(
packageId
);
CommonResp
<
CoursePackageDetail
>
courseIdDetailInfo
=
feignClientForCourse
.
getCoursePackageDetailInfo
(
packageId
);
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
course
PackageDetail
(
courseIdDetailInfo
.
getData
()).
build
());
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
course
(
courseIdDetailInfo
.
getData
()).
build
());
}
else
if
(
RelTypeEnum
.
SINGLE_IMG
.
type
.
equals
(
type
))
{
}
else
if
(
RelTypeEnum
.
SINGLE_IMG
.
type
.
equals
(
type
))
{
//单图,根据id传入url
//单图,根据id传入url
String
imgId
=
themeContentQo
.
getValue
();
String
imgId
=
themeContentQo
.
getValue
();
...
...
community-service/src/main/java/com/tanpu/community/service/ProductService.java
0 → 100644
View file @
108f9fda
//package com.tanpu.community.service;
//
//import com.google.common.collect.Lists;
//import org.springframework.beans.BeanUtils;
//import org.springframework.util.CollectionUtils;
//
//import java.util.List;
//import java.util.Map;
//import java.util.stream.Collectors;
//
//public class ProductService {
//
// /**
// * 获取资源信息
// *
// * @param shortVideoMap
// * @param curriculumMap
// * @param zhiboMap
// * @param fundMap
// */
// private void getResInfo(Map<String, ShortVideoBaseInfoResp> shortVideoMap,
// Map<String, ShortVideoBaseInfoResp> curriculumMap,
// Map<String, ZhiboListResp> zhiboMap,
// Map<String, FundInfoBaseResp> fundMap,
// List<NewsFeedRes> newsFeedRes,
// Map<String, NewsFeedRes> newFeedMap
// ) {
// // 白名单基金id
// List<String> tanpuFundIds = Lists.newArrayList();
// // 私募基金id
// List<String> fundIds = Lists.newArrayList();
// // 理财师导入
// List<String> ifaFundIds = Lists.newArrayList();
// // 公募基金id
// List<String> publicFundIds = Lists.newArrayList();
// // 无净值产品id
// List<String> notNetFundIds = Lists.newArrayList();
// // 短视频id
// List<String> shortVideoIds = Lists.newArrayList();
// // 直播id
// List<String> zhiboIds = Lists.newArrayList();
// // 课程id
// List<String> curriculumIds = Lists.newArrayList();
// // 获取关联资源id
// if (newsFeedRes != null) {
//
// }
// if (!CollectionUtils.isEmpty(shortVideoIds)) {
// // 短视频列表
// }
// if (!CollectionUtils.isEmpty(curriculumIds)) {
// // 课程列表
// }
// if (!CollectionUtils.isEmpty(zhiboIds)) {
// // 直播列表
// }
// this.getFundInfo(tanpuFundIds, fundIds, publicFundIds, ifaFundIds, notNetFundIds, fundMap);
// }
//
// /**
// * 设置产品信息
// *
// * @param tanpuFundIds
// * @param fundIds
// * @param publicFundIds
// * @param fundMap
// */
// private void getFundInfo(List<String> tanpuFundIds,
// List<String> fundIds,
// List<String> publicFundIds,
// List<String> ifaFundIds,
// List<String> notNetFundIds,
// Map<String, FundInfoBaseResp> fundMap) {
// Map<String, FundInfoBaseResp> tampFundMap = null;
// Map<String, FundInfoBaseResp> privateFundMap = null;
// Map<String, FundInfoBaseResp> publicFundMap = null;
// Map<String, FundInfoBaseResp> ifaFundMap = null;
// Map<String, FundInfoBaseResp> notNetFundMap = null;
// if (!CollectionUtils.isEmpty(tanpuFundIds)) {
//// ProductListReq productListReq = ProductListReq.builder()
//// .fundIds(Lists.newArrayList(tanpuFundIds))
//// .build();
// // 探普产品
// CommonResp<List<ProductInfoVO>> commonResp = feignForProduct.getProductInfoByIds(tanpuFundIds);
// if (commonResp.isSuccess() && !CollectionUtils.isEmpty(commonResp.getAttributes())) {
// List<FundInfoBaseResp> fundInfoBaseRespList = commonResp.attributes.stream().map(item -> {
// FundInfoBaseResp fundInfoBaseResp = FundInfoBaseResp.builder().build();
// BeanUtils.copyProperties(item, fundInfoBaseResp);
// return fundInfoBaseResp;
// }).collect(Collectors.toList());
// tampFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
// }
//
// if (tampFundMap != null && tampFundMap.size() > 0) {
// fundMap.putAll(tampFundMap);
// }
// }
// // 私募产品
// if (!CollectionUtils.isEmpty(fundIds)) {
// // 私募产品
// CommonResp<List<ProductInfoVO>> fundResult = feignForFund.getProductList(fundIds);
// if (fundResult.isSuccess() && !CollectionUtils.isEmpty(fundResult.getAttributes())) {
// List<FundInfoBaseResp> fundInfoBaseRespList = fundResult.attributes.stream().map(item -> {
// FundInfoBaseResp fundInfoBaseResp = FundInfoBaseResp.builder().build();
// BeanUtils.copyProperties(item, fundInfoBaseResp);
// return fundInfoBaseResp;
// }).collect(Collectors.toList());
// privateFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
// }
//
// if (privateFundMap != null && privateFundMap.size() > 0) {
// fundMap.putAll(privateFundMap);
// }
// }
//
// // 理财师导入产品
// if (!CollectionUtils.isEmpty(ifaFundIds)) {
// CommonResp<List<ProductInfoVO>> ifaFundResult = feignForFund.getPrivateFundList(ifaFundIds);
// if (ifaFundResult.isSuccess() && !CollectionUtils.isEmpty(ifaFundResult.getAttributes())) {
// List<FundInfoBaseResp> fundInfoBaseRespList = ifaFundResult.attributes.stream().map(item -> {
// FundInfoBaseResp fundInfoBaseResp = FundInfoBaseResp.builder().build();
// BeanUtils.copyProperties(item, fundInfoBaseResp);
// return fundInfoBaseResp;
// }).collect(Collectors.toList());
// ifaFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
// }
//
// if (ifaFundMap != null && ifaFundMap.size() > 0) {
// fundMap.putAll(ifaFundMap);
// }
// }
//
// if (!CollectionUtils.isEmpty(publicFundIds)) {
// // 公募产品
// CommonResp<List<ProductInfoVO>> publicFundResult = feignForPublicFund.getProductList(publicFundIds);
// if (publicFundResult.isSuccess() && !CollectionUtils.isEmpty(publicFundResult.getAttributes())) {
// List<FundInfoBaseResp> fundInfoBaseRespList = publicFundResult.attributes.stream().map(item -> {
// FundInfoBaseResp fundInfoBaseResp = FundInfoBaseResp.builder().build();
// BeanUtils.copyProperties(item, fundInfoBaseResp);
// return fundInfoBaseResp;
// }).collect(Collectors.toList());
// publicFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
// }
// if (publicFundMap != null && publicFundMap.size() > 0) {
// fundMap.putAll(publicFundMap);
// }
// }
//
// if (!CollectionUtils.isEmpty(notNetFundIds)) {
// // 无净值产品
// CommonResp<List<ProductInfoVO>> notNetInfoResult = feignForFund.getProductListNotNetInfo(notNetFundIds);
// if (notNetInfoResult.isSuccess() && !CollectionUtils.isEmpty(notNetInfoResult.getAttributes())) {
// List<FundInfoBaseResp> fundInfoBaseRespList = notNetInfoResult.attributes.stream().map(item -> {
// FundInfoBaseResp fundInfoBaseResp = FundInfoBaseResp.builder().build();
// BeanUtils.copyProperties(item, fundInfoBaseResp);
// return fundInfoBaseResp;
// }).collect(Collectors.toList());
// notNetFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
// }
// if (notNetFundMap != null && notNetFundMap.size() > 0) {
// fundMap.putAll(notNetFundMap);
// }
// }
// }
//
// /**
// * 设置资源信息
// *
// * @param item
// * @param resp
// * @param newFeedMap
// * @param shortVideoMap
// * @param curriculumMap
// * @param zhiboMap
// * @param fundMap
// */
// private void setResInfo(NewsFeed item,
// NewsFeedResp resp,
// Map<String, NewsFeedRes> newFeedMap,
// Map<String, ShortVideoBaseInfoResp> shortVideoMap,
// Map<String, ShortVideoBaseInfoResp> curriculumMap,
// Map<String, ZhiboListResp> zhiboMap,
// Map<String, FundInfoBaseResp> fundMap) {
// if (newFeedMap.containsKey(item.getId())) {
// NewsFeedRes nf = newFeedMap.get(item.getId());
// if (nf.getRelType().equals(RelTypeEnum.LIVE.type)) {
// if (zhiboMap.containsKey(nf.getRemark())) {
// ZhiboListResp zhibo = zhiboMap.get(nf.getRemark());
// zhibo.setParentId(zhibo.getParentId());
// zhibo.setId(zhibo.getId());
// resp.setResList(RelContentResp.builder()
// .relType(RelTypeEnum.LIVE.type)
// .zhibo(zhibo).build());
// }
// } else if (nf.getRelType().equals(RelTypeEnum.SHORT_VIDEO.type)) {
// if (shortVideoMap.containsKey(nf.getRelId())) {
// resp.setResList(RelContentResp.builder()
// .relType(RelTypeEnum.SHORT_VIDEO.type)
// .shortVideo(shortVideoMap.get(nf.getRelId())).build());
// }
// } else if (nf.getRelType().equals(RelTypeEnum.VIDEO.type) || nf.getRelType().equals(RelTypeEnum.AUDIO.type)) {
// if (curriculumMap.containsKey(nf.getRelId())) {
// resp.setResList(RelContentResp.builder()
// .relType(curriculumMap.get(nf.getRelId()).getRelType())
// .curriculum(curriculumMap.get(nf.getRelId())).build());
// }
// } else if (nf.getRelType().equals(RelTypeEnum.FUND.type)) {
// if (fundMap.containsKey(nf.getRelId())) {
// FundInfoBaseResp product = fundMap.get(nf.getRelId());
// // 推荐语
// product.setRemark(nf.getRemark());
// // 产品类型
// product.setProductType(nf.getProductType());
// resp.setResList(RelContentResp.builder()
// .relType(RelTypeEnum.FUND.type)
// .product(product).build());
// }
// }
// }
// }
//}
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