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
1b72f29d
Commit
1b72f29d
authored
Jul 13, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加新课程Feign接口
parent
e1d54d59
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
76 additions
and
22 deletions
+76
-22
AttachmentDetailVo.java
.../com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
+7
-1
CourseExt.java
...ava/com/tanpu/community/api/beans/vo/feign/CourseExt.java
+0
-1
Course.java
...com/tanpu/community/api/beans/vo/feign/course/Course.java
+2
-1
CourseDetailExt.java
.../community/api/beans/vo/feign/course/CourseDetailExt.java
+2
-1
CourseExt.java
.../tanpu/community/api/beans/vo/feign/course/CourseExt.java
+1
-0
CoursePackageDetail.java
...munity/api/beans/vo/feign/course/CoursePackageDetail.java
+3
-1
CourseResExt.java
...npu/community/api/beans/vo/feign/course/CourseResExt.java
+1
-1
CourseSimpleResp.java
...community/api/beans/vo/feign/course/CourseSimpleResp.java
+1
-1
CurriCulumInfoDetailDto.java
...ty/api/beans/vo/feign/course/CurriCulumInfoDetailDto.java
+1
-1
CurriculumChapterVo.java
...munity/api/beans/vo/feign/course/CurriculumChapterVo.java
+1
-1
CurriculumDetailVo.java
...mmunity/api/beans/vo/feign/course/CurriculumDetailVo.java
+1
-1
FeignBackClientForCourse.java
...anpu/community/feign/course/FeignBackClientForCourse.java
+12
-2
FeignClientForCourse.java
...om/tanpu/community/feign/course/FeignClientForCourse.java
+9
-2
FeignBackClientForTanpuroom.java
...ommunity/feign/tanpuroom/FeignBackClientForTanpuroom.java
+2
-2
FeignClientForTanpuroom.java
...pu/community/feign/tanpuroom/FeignClientForTanpuroom.java
+2
-2
ProductService.java
...main/java/com/tanpu/community/service/ProductService.java
+31
-4
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/AttachmentDetailVo.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
com.tanpu.community.api.beans.vo.feign.*
;
import
com.tanpu.community.api.beans.vo.feign.FundInfoBaseResp
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboListResp
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -23,5 +26,8 @@ public class AttachmentDetailVo {
...
@@ -23,5 +26,8 @@ public class AttachmentDetailVo {
private
ShortVideoBaseInfoResp
shortVideo
;
private
ShortVideoBaseInfoResp
shortVideo
;
@ApiModelProperty
(
"课程"
)
@ApiModelProperty
(
"课程"
)
private
ShortVideoBaseInfoResp
curriculum
;
private
ShortVideoBaseInfoResp
curriculum
;
@ApiModelProperty
(
"新版课程"
)
private
CourseSimpleResp
course
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CourseExt.java
deleted
100644 → 0
View file @
e1d54d59
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/** * @author: zyh * @date: 2021-04-13 3:20 下午 * @description: */
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
CourseExt
extends
Course
{
@ApiModelProperty
(
"章节-小节ID"
)
private
String
coursePackageId
;
@Deprecated
@ApiModelProperty
(
"相关性知识课程小节类型 - 1:音频 2:视频"
)
private
Integer
relType
;
@ApiModelProperty
(
"相关性知识课程小节类型 扩展"
)
private
Integer
relTypeExt
;
@Deprecated
@ApiModelProperty
(
"章节-小节 音/视频类型 1:音频 2:视频"
)
private
Integer
type
;
@ApiModelProperty
(
"章节-小节 音/视频类型 扩展"
)
private
Integer
typeExt
;
@ApiModelProperty
(
"章节-小节 音/视频地址"
)
private
String
url
;
@ApiModelProperty
(
"相关性知识地址"
)
private
String
relUrl
;
@ApiModelProperty
(
"相关性知识 - 课程包ID"
)
private
String
relPackageId
;
@ApiModelProperty
(
"相关性知识音/视频时长"
)
private
Integer
relLengthTime
;
@ApiModelProperty
(
"多少人已学习"
)
private
Integer
readNum
;
@ApiModelProperty
(
"课程时长 单位s"
)
private
Integer
lengthTime
;
@ApiModelProperty
(
"讲师信息"
)
private
LecturerResp
lecturer
;
}
\ No newline at end of file
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/Course.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
Course.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
com.tanpu.community.api.beans.vo.feign.Progression
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CourseDetailExt.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CourseDetailExt.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
com.tanpu.community.api.beans.vo.feign.FileMetadata
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/course/CourseExt.java
0 → 100644
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
com.tanpu.community.api.beans.vo.feign.LecturerResp
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/** * @author: zyh * @date: 2021-04-13 3:20 下午 * @description: */
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
CourseExt
extends
Course
{
@ApiModelProperty
(
"章节-小节ID"
)
private
String
coursePackageId
;
@Deprecated
@ApiModelProperty
(
"相关性知识课程小节类型 - 1:音频 2:视频"
)
private
Integer
relType
;
@ApiModelProperty
(
"相关性知识课程小节类型 扩展"
)
private
Integer
relTypeExt
;
@Deprecated
@ApiModelProperty
(
"章节-小节 音/视频类型 1:音频 2:视频"
)
private
Integer
type
;
@ApiModelProperty
(
"章节-小节 音/视频类型 扩展"
)
private
Integer
typeExt
;
@ApiModelProperty
(
"章节-小节 音/视频地址"
)
private
String
url
;
@ApiModelProperty
(
"相关性知识地址"
)
private
String
relUrl
;
@ApiModelProperty
(
"相关性知识 - 课程包ID"
)
private
String
relPackageId
;
@ApiModelProperty
(
"相关性知识音/视频时长"
)
private
Integer
relLengthTime
;
@ApiModelProperty
(
"多少人已学习"
)
private
Integer
readNum
;
@ApiModelProperty
(
"课程时长 单位s"
)
private
Integer
lengthTime
;
@ApiModelProperty
(
"讲师信息"
)
private
LecturerResp
lecturer
;
}
\ No newline at end of file
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CoursePackageDetail.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CoursePackageDetail.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
com.tanpu.community.api.beans.vo.feign.BaseCoursePackage
;
import
com.tanpu.community.api.beans.vo.feign.LikeCourse
;
import
com.tanpu.community.api.beans.vo.feign.pay.GroupBuyConfig
;
import
com.tanpu.community.api.beans.vo.feign.pay.GroupBuyConfig
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CourseResExt.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CourseResExt.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CourseSimpleResp.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CourseSimpleResp.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CurriCulumInfoDetailDto.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CurriCulumInfoDetailDto.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CurriculumChapterVo.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CurriculumChapterVo.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/CurriculumDetailVo.java
→
community-api/src/main/java/com/tanpu/community/api/beans/vo/feign/
course/
CurriculumDetailVo.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
;
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
.
feign
.
course
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
community-service/src/main/java/com/tanpu/community/feign/course/FeignBackClientForCourse.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
feign
.
course
;
package
com
.
tanpu
.
community
.
feign
.
course
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.CourseDetailExt
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseDetailExt
;
import
com.tanpu.community.api.beans.vo.feign.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.course.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
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
;
import
java.util.List
;
@Slf4j
@Slf4j
@Component
@Component
public
class
FeignBackClientForCourse
implements
FallbackFactory
<
FeignClientForCourse
>
{
public
class
FeignBackClientForCourse
implements
FallbackFactory
<
FeignClientForCourse
>
{
...
@@ -20,6 +23,13 @@ public class FeignBackClientForCourse implements FallbackFactory<FeignClientForC
...
@@ -20,6 +23,13 @@ public class FeignBackClientForCourse implements FallbackFactory<FeignClientForC
return
CommonResp
.
failed
(
"调用getCourseIdDetailInfo失败"
);
return
CommonResp
.
failed
(
"调用getCourseIdDetailInfo失败"
);
}
}
@Override
public
CommonResp
<
List
<
CourseSimpleResp
>>
getCourseSimpleList
(
List
<
String
>
ids
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForCourse.getCourseSimpleList-查询课程基础信息列表ids:{}"
,
ids
);
return
CommonResp
.
failed
(
"调用getCourseSimpleList失败"
);
}
@Override
@Override
public
CommonResp
<
CoursePackageDetail
>
getCoursePackageDetailInfo
(
String
id
)
{
public
CommonResp
<
CoursePackageDetail
>
getCoursePackageDetailInfo
(
String
id
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"请求信息"
,
throwable
);
...
...
community-service/src/main/java/com/tanpu/community/feign/course/FeignClientForCourse.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
feign
.
course
;
package
com
.
tanpu
.
community
.
feign
.
course
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.CourseDetailExt
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseDetailExt
;
import
com.tanpu.community.api.beans.vo.feign.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.course.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
import
com.tanpu.community.feign.product.FeignBackClientForProducts
;
import
com.tanpu.community.feign.product.FeignBackClientForProducts
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -10,6 +11,8 @@ import org.springframework.cloud.openfeign.FeignClient;
...
@@ -10,6 +11,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
//@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForProducts.class, url = "${tamp-course-order-svc:}")
//@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForProducts.class, url = "${tamp-course-order-svc:}")
@FeignClient
(
value
=
"service-course"
,
contextId
=
"course"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://172.20.1.249:8060/course"
)
@FeignClient
(
value
=
"service-course"
,
contextId
=
"course"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://172.20.1.249:8060/course"
)
...
@@ -22,6 +25,10 @@ public interface FeignClientForCourse {
...
@@ -22,6 +25,10 @@ public interface FeignClientForCourse {
@ApiParam
(
"课程包id"
)
@RequestParam
(
"packageId"
)
String
packageId
);
@ApiParam
(
"课程包id"
)
@RequestParam
(
"packageId"
)
String
packageId
);
@ApiOperation
(
"课程基础信息列表"
)
@GetMapping
(
"/course/simple/list"
)
CommonResp
<
List
<
CourseSimpleResp
>>
getCourseSimpleList
(
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
@ApiOperation
(
"详情页信息"
)
@ApiOperation
(
"详情页信息"
)
@GetMapping
(
"/course/detail"
)
@GetMapping
(
"/course/detail"
)
...
...
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignBackClientForTanpuroom.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.CurriCulumInfoDetailDto
;
import
com.tanpu.community.api.beans.vo.feign.
course.
CurriCulumInfoDetailDto
;
import
com.tanpu.community.api.beans.vo.feign.CurriculumDetailVo
;
import
com.tanpu.community.api.beans.vo.feign.
course.
CurriculumDetailVo
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignClientForTanpuroom.java
View file @
1b72f29d
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.CurriCulumInfoDetailDto
;
import
com.tanpu.community.api.beans.vo.feign.
course.
CurriCulumInfoDetailDto
;
import
com.tanpu.community.api.beans.vo.feign.CurriculumDetailVo
;
import
com.tanpu.community.api.beans.vo.feign.
course.
CurriculumDetailVo
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.ShortVideoBaseInfoResp
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
community-service/src/main/java/com/tanpu/community/service/ProductService.java
View file @
1b72f29d
...
@@ -11,9 +11,11 @@ import com.tanpu.community.api.beans.vo.feign.FundInfoBaseResp;
...
@@ -11,9 +11,11 @@ import com.tanpu.community.api.beans.vo.feign.FundInfoBaseResp;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
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.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboListResp
;
import
com.tanpu.community.api.beans.vo.feign.ZhiboListResp
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
import
com.tanpu.community.api.enums.RelTypeEnum
;
import
com.tanpu.community.api.enums.RelTypeEnum
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.feign.product.FeignClientForProducts
;
import
com.tanpu.community.feign.product.FeignClientForProducts
;
import
com.tanpu.community.feign.product.FeignForFund
;
import
com.tanpu.community.feign.product.FeignForFund
;
...
@@ -43,6 +45,9 @@ public class ProductService {
...
@@ -43,6 +45,9 @@ public class ProductService {
@Resource
@Resource
private
FeignClientForProducts
feignForProduct
;
private
FeignClientForProducts
feignForProduct
;
@Resource
private
FeignClientForCourse
feignForCourse
;
@Resource
@Resource
private
FeignForFund
feignForFund
;
private
FeignForFund
feignForFund
;
...
@@ -65,6 +70,8 @@ public class ProductService {
...
@@ -65,6 +70,8 @@ public class ProductService {
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
=
Maps
.
newHashMap
();
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
=
Maps
.
newHashMap
();
// 课程信息
// 课程信息
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
=
Maps
.
newHashMap
();
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
=
Maps
.
newHashMap
();
// 新课程信息
Map
<
String
,
CourseSimpleResp
>
courseMap
=
Maps
.
newHashMap
();
// 直播信息
// 直播信息
Map
<
String
,
ZhiboListResp
>
zhiboMap
=
Maps
.
newHashMap
();
Map
<
String
,
ZhiboListResp
>
zhiboMap
=
Maps
.
newHashMap
();
// 设置产品信息
// 设置产品信息
...
@@ -74,9 +81,9 @@ public class ProductService {
...
@@ -74,9 +81,9 @@ public class ProductService {
// 话题标题
// 话题标题
Map
<
String
,
String
>
topicMap
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
topicMap
=
Maps
.
newHashMap
();
// 批量查询资源信息
// 批量查询资源信息
this
.
getResInfo
(
shortVideoMap
,
curriculumMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
,
themeQos
);
this
.
getResInfo
(
shortVideoMap
,
curriculumMap
,
courseMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
,
themeQos
);
//逐个装入
//逐个装入
setResInfo
(
themeQos
,
shortVideoMap
,
curriculumMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
);
setResInfo
(
themeQos
,
shortVideoMap
,
curriculumMap
,
courseMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
);
}
}
...
@@ -91,6 +98,7 @@ public class ProductService {
...
@@ -91,6 +98,7 @@ public class ProductService {
*/
*/
private
void
getResInfo
(
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
,
private
void
getResInfo
(
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
,
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
,
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
,
Map
<
String
,
CourseSimpleResp
>
courseMap
,
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
String
>
imgMap
,
Map
<
String
,
String
>
imgMap
,
...
@@ -113,6 +121,8 @@ public class ProductService {
...
@@ -113,6 +121,8 @@ public class ProductService {
List
<
String
>
zhiboIds
=
Lists
.
newArrayList
();
List
<
String
>
zhiboIds
=
Lists
.
newArrayList
();
// 课程id
// 课程id
List
<
String
>
curriculumIds
=
Lists
.
newArrayList
();
List
<
String
>
curriculumIds
=
Lists
.
newArrayList
();
// 新课程id
List
<
String
>
courseIds
=
Lists
.
newArrayList
();
// 图片id
// 图片id
List
<
String
>
imageIds
=
Lists
.
newArrayList
();
List
<
String
>
imageIds
=
Lists
.
newArrayList
();
// 话题id
// 话题id
...
@@ -142,6 +152,9 @@ public class ProductService {
...
@@ -142,6 +152,9 @@ public class ProductService {
curriculumIds
.
add
(
c
.
getValue
());
curriculumIds
.
add
(
c
.
getValue
());
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
imageIds
.
add
(
c
.
getValue
());
imageIds
.
add
(
c
.
getValue
());
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_AUDIO
.
type
)
||
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_VIDEO
.
type
))
{
courseIds
.
add
(
c
.
getValue
());
}
}
}));
}));
themeQos
.
stream
().
forEach
(
o
->
{
themeQos
.
stream
().
forEach
(
o
->
{
...
@@ -164,6 +177,13 @@ public class ProductService {
...
@@ -164,6 +177,13 @@ public class ProductService {
curriculumMap
.
putAll
(
commonResp
.
stream
().
collect
(
Collectors
.
toMap
(
ShortVideoBaseInfoResp:
:
getColumnRelId
,
item
->
item
)));
curriculumMap
.
putAll
(
commonResp
.
stream
().
collect
(
Collectors
.
toMap
(
ShortVideoBaseInfoResp:
:
getColumnRelId
,
item
->
item
)));
}
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
courseIds
))
{
// 新版课程列表
CommonResp
<
List
<
CourseSimpleResp
>>
commonResp
=
feignForCourse
.
getCourseSimpleList
(
courseIds
);
if
(
commonResp
.
isSuccess
()
&
!
CollectionUtils
.
isEmpty
(
commonResp
.
getData
()))
{
courseMap
.
putAll
(
commonResp
.
getData
().
stream
().
collect
(
Collectors
.
toMap
(
CourseSimpleResp:
:
getCourseId
,
item
->
item
)));
}
}
if
(!
CollectionUtils
.
isEmpty
(
zhiboIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
zhiboIds
))
{
// 直播列表
// 直播列表
CommonResp
<
List
<
ZhiboListResp
>>
commonResp
=
feignClientForZhibo
.
simpleList
(
zhiboIds
);
CommonResp
<
List
<
ZhiboListResp
>>
commonResp
=
feignClientForZhibo
.
simpleList
(
zhiboIds
);
...
@@ -302,12 +322,13 @@ public class ProductService {
...
@@ -302,12 +322,13 @@ public class ProductService {
private
void
setResInfo
(
List
<
ThemeQo
>
themeQos
,
private
void
setResInfo
(
List
<
ThemeQo
>
themeQos
,
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
,
Map
<
String
,
ShortVideoBaseInfoResp
>
shortVideoMap
,
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
,
Map
<
String
,
ShortVideoBaseInfoResp
>
curriculumMap
,
Map
<
String
,
CourseSimpleResp
>
courseMap
,
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
String
>
imgUrlMap
,
Map
<
String
,
String
>
imgUrlMap
,
Map
<
String
,
String
>
topicMap
)
{
Map
<
String
,
String
>
topicMap
)
{
for
(
ThemeQo
themeQo
:
themeQos
)
{
for
(
ThemeQo
themeQo
:
themeQos
)
{
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getTopicId
())
&&
topicMap
.
containsKey
(
themeQo
.
getTopicId
())){
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getTopicId
())
&&
topicMap
.
containsKey
(
themeQo
.
getTopicId
()))
{
themeQo
.
setTopicTitle
(
topicMap
.
get
(
themeQo
.
getTopicId
()));
themeQo
.
setTopicTitle
(
topicMap
.
get
(
themeQo
.
getTopicId
()));
}
}
for
(
ThemeContentQo
themeContent
:
themeQo
.
getContent
())
{
for
(
ThemeContentQo
themeContent
:
themeQo
.
getContent
())
{
...
@@ -327,6 +348,12 @@ public class ProductService {
...
@@ -327,6 +348,12 @@ public class ProductService {
themeContent
.
setDetail
(
AttachmentDetailVo
.
builder
()
themeContent
.
setDetail
(
AttachmentDetailVo
.
builder
()
.
curriculum
(
curriculumMap
.
get
(
themeContent
.
getValue
())).
build
());
.
curriculum
(
curriculumMap
.
get
(
themeContent
.
getValue
())).
build
());
}
}
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_VIDEO
.
type
)
||
themeContent
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_AUDIO
.
type
))
{
if
(
courseMap
.
containsKey
(
themeContent
.
getValue
()))
{
themeContent
.
setDetail
(
AttachmentDetailVo
.
builder
()
.
course
(
courseMap
.
get
(
themeContent
.
getValue
())).
build
());
}
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
FUND
.
type
))
{
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
FUND
.
type
))
{
if
(
fundMap
.
containsKey
(
themeContent
.
getValue
()))
{
if
(
fundMap
.
containsKey
(
themeContent
.
getValue
()))
{
FundInfoBaseResp
product
=
fundMap
.
get
(
themeContent
.
getValue
());
FundInfoBaseResp
product
=
fundMap
.
get
(
themeContent
.
getValue
());
...
@@ -337,7 +364,7 @@ public class ProductService {
...
@@ -337,7 +364,7 @@ public class ProductService {
themeContent
.
setDetail
(
AttachmentDetailVo
.
builder
()
themeContent
.
setDetail
(
AttachmentDetailVo
.
builder
()
.
product
(
product
).
build
());
.
product
(
product
).
build
());
}
}
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
if
(
imgUrlMap
.
containsKey
(
themeContent
.
getValue
()))
{
if
(
imgUrlMap
.
containsKey
(
themeContent
.
getValue
()))
{
themeContent
.
setValue
(
imgUrlMap
.
get
(
themeContent
.
getValue
()));
themeContent
.
setValue
(
imgUrlMap
.
get
(
themeContent
.
getValue
()));
}
}
...
...
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