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
530e1c58
Commit
530e1c58
authored
Jul 05, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feign相关
parent
bdbff526
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
1313 additions
and
122 deletions
+1313
-122
ForwardThemeReq.java
...n/java/com/tanpu/community/api/beans/ForwardThemeReq.java
+17
-0
MainTextQo.java
...ain/java/com/tanpu/community/api/beans/qo/MainTextQo.java
+42
-0
ClientConstant.java
...ava/com/tanpu/community/api/constants/ClientConstant.java
+21
-0
BlockTypeEnum.java
...ain/java/com/tanpu/community/api/enums/BlockTypeEnum.java
+1
-1
CollectionTypeEnum.java
...ava/com/tanpu/community/api/enums/CollectionTypeEnum.java
+1
-1
CommentTypeEnum.java
...n/java/com/tanpu/community/api/enums/CommentTypeEnum.java
+1
-1
CurriculumEnum.java
...in/java/com/tanpu/community/api/enums/CurriculumEnum.java
+1
-1
DeleteTagEnum.java
...ain/java/com/tanpu/community/api/enums/DeleteTagEnum.java
+1
-1
ThemeAttachmentEnum.java
...va/com/tanpu/community/api/enums/ThemeAttachmentEnum.java
+34
-0
ThemeTypeEnum.java
...ain/java/com/tanpu/community/api/enums/ThemeTypeEnum.java
+32
-0
TopicStatusEnum.java
...n/java/com/tanpu/community/api/enums/TopicStatusEnum.java
+1
-1
pom.xml
community-service/pom.xml
+5
-0
CommunityApplication.java
...c/main/java/com/tanpu/community/CommunityApplication.java
+2
-0
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+47
-26
FeignBackClientForCourse.java
...anpu/community/feign/course/FeignBackClientForCourse.java
+23
-0
FeignClientForCourse.java
...om/tanpu/community/feign/course/FeignClientForCourse.java
+23
-0
ColumnVO.java
...in/java/com/tanpu/community/feign/course/vo/ColumnVO.java
+18
-0
Course.java
...main/java/com/tanpu/community/feign/course/vo/Course.java
+31
-0
CourseDetailExt.java
.../com/tanpu/community/feign/course/vo/CourseDetailExt.java
+53
-0
CourseExt.java
...n/java/com/tanpu/community/feign/course/vo/CourseExt.java
+1
-0
CourseResExt.java
...ava/com/tanpu/community/feign/course/vo/CourseResExt.java
+34
-0
FileMetadata.java
...ava/com/tanpu/community/feign/course/vo/FileMetadata.java
+42
-0
LecturerResp.java
...ava/com/tanpu/community/feign/course/vo/LecturerResp.java
+43
-0
Progression.java
...java/com/tanpu/community/feign/course/vo/Progression.java
+39
-0
FeignBackClientForProducts.java
...u/community/feign/product/FeignBackClientForProducts.java
+32
-0
FeignClientForProducts.java
...tanpu/community/feign/product/FeignClientForProducts.java
+25
-0
FeignBackClientForTanpuroom.java
...ommunity/feign/tanpuroom/FeignBackClientForTanpuroom.java
+35
-0
FeignClientForTanpuroom.java
...pu/community/feign/tanpuroom/FeignClientForTanpuroom.java
+28
-0
CurriCulumInfoDetailDto.java
...community/feign/tanpuroom/vo/CurriCulumInfoDetailDto.java
+23
-0
CurriculumChapterVo.java
...npu/community/feign/tanpuroom/vo/CurriculumChapterVo.java
+29
-0
CurriculumDetailVo.java
...anpu/community/feign/tanpuroom/vo/CurriculumDetailVo.java
+39
-0
Net.java
...rvice/src/main/java/com/tanpu/community/feign/vo/Net.java
+38
-0
ProductInfoVO.java
...main/java/com/tanpu/community/feign/vo/ProductInfoVO.java
+180
-0
ProductLabel.java
.../main/java/com/tanpu/community/feign/vo/ProductLabel.java
+20
-0
ShortVideoBaseInfoResp.java
.../com/tanpu/community/feign/vo/ShortVideoBaseInfoResp.java
+41
-0
Type.java
...vice/src/main/java/com/tanpu/community/feign/vo/Type.java
+31
-0
FeignClientForZhibo.java
.../com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
+26
-0
FeignbackForZhibo.java
...va/com/tanpu/community/feign/zhibo/FeignbackForZhibo.java
+37
-0
ZhiboDetailVO.java
...ava/com/tanpu/community/feign/zhibo/vo/ZhiboDetailVO.java
+83
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+97
-68
BlackListService.java
...in/java/com/tanpu/community/service/BlackListService.java
+27
-13
CollectionService.java
...n/java/com/tanpu/community/service/CollectionService.java
+2
-2
CurriculumResService.java
...ava/com/tanpu/community/service/CurriculumResService.java
+2
-2
OrderFlowService.java
...in/java/com/tanpu/community/service/OrderFlowService.java
+1
-1
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+2
-2
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+1
-1
create.sql
docs/create.sql
+1
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/ForwardTheme
DTO
.java
→
community-api/src/main/java/com/tanpu/community/api/beans/ForwardTheme
Req
.java
View file @
530e1c58
...
...
@@ -2,10 +2,16 @@ package com.tanpu.community.api.beans;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
@Data
public
class
ForwardTheme
DTO
{
public
class
ForwardTheme
Req
{
@NotEmpty
(
message
=
"转发对象id不能为空"
)
private
String
formerThemeId
;
@NotEmpty
(
message
=
"内容不能为空"
)
private
String
content
;
private
String
topicId
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/MainTextQo.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 正文
*/
public
class
MainTextQo
{
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题"
)
private
Integer
themeType
;
@ApiModelProperty
(
value
=
"文本内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"所属的话题"
)
private
String
topicId
;
@ApiModelProperty
(
value
=
"昵称"
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"用户头像"
)
private
String
userImg
;
@ApiModelProperty
(
value
=
"认证"
)
private
String
authLabel
;
@ApiModelProperty
(
value
=
"发表时间"
)
private
String
upToNowTime
;
@ApiModelProperty
(
value
=
"被转发的主题"
)
private
String
formerThemeId
;
}
community-api/src/main/java/com/tanpu/community/api/constants/ClientConstant.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constants
;
public
class
ClientConstant
{
private
static
final
String
PRODUCT_SERVICE_NAME
=
"service-product"
;
private
static
final
String
PRODUCT_WEB_BASE_PATH
=
"product"
;
private
static
final
String
PRODUCT_SERVICE_URL
=
"${tanpu.qm-product.svc}"
;
private
static
final
String
COURSE_SERVICE_NAME
=
"service-course"
;
private
static
final
String
COURSE_WEB_BASE_PATH
=
"course"
;
private
static
final
String
COURSE_SERVICE_URL
=
"${tanpu.qm-course.svc}"
;
private
static
final
String
TANPUROOM_SERVICE_NAME
=
"service-tanpuroom"
;
private
static
final
String
TANPUROOM_WEB_BASE_PATH
=
"tanpuroom"
;
private
static
final
String
TANPUROOM_SERVICE_URL
=
"${tanpu.qm-tanpuroom.svc}"
;
private
static
final
String
ZHIBO_SERVICE_NAME
=
"service-zhibo"
;
private
static
final
String
ZHIBO_WEB_BASE_PATH
=
"zhibo"
;
private
static
final
String
ZHIBO_SERVICE_URL
=
"${tanpu.qm-zhibo.svc}"
;
}
community-api/src/main/java/com/tanpu/community/api/
constant
s/BlockTypeEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/BlockTypeEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
enum
BlockTypeEnum
{
USER
(
1
,
"屏蔽用户"
),
...
...
community-api/src/main/java/com/tanpu/community/api/
constant
s/CollectionTypeEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/CollectionTypeEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
enum
CollectionTypeEnum
{
...
...
community-api/src/main/java/com/tanpu/community/api/
constant
s/CommentTypeEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/CommentTypeEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
enum
CommentTypeEnum
{
...
...
community-api/src/main/java/com/tanpu/community/api/
constant
s/CurriculumEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/CurriculumEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
class
CurriculumEnum
{
//课程类型
...
...
community-api/src/main/java/com/tanpu/community/api/
constant
s/DeleteTagEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/DeleteTagEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
enum
DeleteTagEnum
{
...
...
community-api/src/main/java/com/tanpu/community/api/enums/ThemeAttachmentEnum.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
enums
;
//1:产品 2:直播 3:短视频 4:课程
public
enum
ThemeAttachmentEnum
{
PRODUCT
(
1
,
"产品"
),
ZHIBO
(
2
,
"直播"
),
SHORTVIDEO
(
3
,
"短视频"
),
COURSE
(
4
,
"课程"
);
private
Integer
code
;
private
String
type
;
ThemeAttachmentEnum
(
Integer
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
community-api/src/main/java/com/tanpu/community/api/enums/ThemeTypeEnum.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
enums
;
public
enum
ThemeTypeEnum
{
DISCUSSION
(
1
,
"讨论无标题"
),
LONG_TEXT
(
2
,
"长文有标题"
);
private
Integer
code
;
private
String
type
;
ThemeTypeEnum
(
Integer
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
community-api/src/main/java/com/tanpu/community/api/
constant
s/TopicStatusEnum.java
→
community-api/src/main/java/com/tanpu/community/api/
enum
s/TopicStatusEnum.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
api
.
constant
s
;
package
com
.
tanpu
.
community
.
api
.
enum
s
;
public
enum
TopicStatusEnum
{
...
...
community-service/pom.xml
View file @
530e1c58
...
...
@@ -110,6 +110,11 @@
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-ribbon
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
community-service/src/main/java/com/tanpu/community/CommunityApplication.java
View file @
530e1c58
...
...
@@ -3,6 +3,7 @@ package com.tanpu.community;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -12,6 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableCaching
@EnableScheduling
@ComponentScan
({
"com.tanpu.common"
,
"com.tanpu.community"
})
@EnableFeignClients
public
class
CommunityApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
530e1c58
...
...
@@ -2,18 +2,22 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.ForwardThemeReq
;
import
com.tanpu.community.api.beans.qo.MainTextQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.CreateThemeReq
;
import
com.tanpu.community.api.beans.ForwardThemeDTO
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.service.FansRelService
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@Slf4j
...
...
@@ -26,46 +30,55 @@ public class ThemeController {
@Autowired
private
FansRelService
fansRelService
;
@ApiOperation
(
"
新增
主题"
)
@PostMapping
(
value
=
"/
add
"
)
@ApiOperation
(
"
发表
主题"
)
@PostMapping
(
value
=
"/
publish
"
)
@ResponseBody
public
CommonResp
insertTheme
(
@RequestBody
CreateThemeReq
req
)
{
String
userId
=
"liujm"
;
themeManager
.
createTheme
(
req
,
userId
);
public
CommonResp
publishTheme
(
@RequestBody
CreateThemeReq
req
)
{
String
userId
=
"liujm"
;
themeManager
.
publishTheme
(
req
,
userId
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"圈子首页-推荐"
)
@RequestMapping
(
value
=
"/recmend_list"
)
@ResponseBody
public
List
<
ThemeQo
>
selectHotList
(){
String
userId
=
"liujm"
;
public
List
<
ThemeQo
>
selectHotList
()
{
String
userId
=
"liujm"
;
return
themeManager
.
selectHotThemes
(
userId
);
}
@ApiOperation
(
"圈子首页-关注"
)
@RequestMapping
(
value
=
"/interest_list"
)
@ResponseBody
public
List
<
ThemeQo
>
selectInterestList
(){
String
userId
=
"liujm012"
;
public
List
<
ThemeQo
>
selectInterestList
()
{
String
userId
=
"liujm012"
;
return
themeManager
.
selectInterestThemes
(
userId
);
}
@ApiOperation
(
"评论"
)
@RequestMapping
(
value
=
"/comment"
)
@ResponseBody
public
CommonResp
commetOnTheme
(
@RequestBody
CreateCommentReq
req
){
String
userId
=
"liujm"
;
themeManager
.
comment
(
req
,
userId
);
public
CommonResp
commetOnTheme
(
@RequestBody
CreateCommentReq
req
)
{
String
userId
=
"liujm"
;
themeManager
.
comment
(
req
,
userId
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"主题正文"
)
@RequestMapping
(
value
=
"/main_text"
)
@ResponseBody
public
CommonResp
getThemeMainText
(
@RequestParam
String
topicId
)
{
String
userId
=
"liujm"
;
MainTextQo
mainTextQo
=
themeManager
.
getMainText
(
topicId
);
return
CommonResp
.
success
(
mainTextQo
);
}
@ApiOperation
(
"转发主题"
)
@RequestMapping
(
value
=
"/forward"
)
@ResponseBody
public
CommonResp
forwardTheme
(
ForwardThemeDTO
forwardThemeDTO
)
{
String
userId
=
"liujm"
;
themeManager
.
forward
(
forwardTheme
DTO
,
userId
);
public
CommonResp
forwardTheme
(
@Validated
@RequestBody
ForwardThemeReq
forwardThemeReq
)
{
String
userId
=
"liujm"
;
themeManager
.
forward
(
forwardTheme
Req
,
userId
);
return
CommonResp
.
success
();
}
...
...
@@ -73,24 +86,24 @@ public class ThemeController {
@ApiOperation
(
"点赞主题"
)
@GetMapping
(
value
=
"/like"
)
@ResponseBody
public
CommonResp
likeOnTheme
(
@RequestParam
String
themeId
){
String
user
=
"liujm"
;
themeManager
.
like
(
themeId
,
user
);
public
CommonResp
likeOnTheme
(
@RequestParam
String
themeId
)
{
String
user
=
"liujm"
;
themeManager
.
like
(
themeId
,
user
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"分享主题"
)
@GetMapping
(
value
=
"/share"
)
@ResponseBody
public
CommonResp
shareTheme
(
String
themeId
){
public
CommonResp
shareTheme
(
String
themeId
)
{
return
CommonResp
.
success
();
}
@ApiOperation
(
"收藏主题"
)
@RequestMapping
(
value
=
"/book"
)
@ResponseBody
public
CommonResp
bookTheme
(
String
themeId
){
String
user
=
"liujm"
;
public
CommonResp
bookTheme
(
String
themeId
)
{
String
user
=
"liujm"
;
// themeManager.book(themeId,user);
return
CommonResp
.
success
();
}
...
...
@@ -98,7 +111,7 @@ public class ThemeController {
@ApiOperation
(
"举报主题"
)
@GetMapping
(
value
=
"/complaint"
)
@ResponseBody
public
CommonResp
complaintTheme
(
@RequestParam
String
themeId
){
public
CommonResp
complaintTheme
(
@RequestParam
String
themeId
)
{
return
CommonResp
.
failed
(
"功能暂未开放"
);
}
...
...
@@ -106,9 +119,17 @@ public class ThemeController {
@ApiOperation
(
"屏蔽"
)
@RequestMapping
(
value
=
"/conceal"
)
@ResponseBody
public
CommonResp
concealTheme
(
String
themeId
){
String
user
=
"liujm"
;
public
CommonResp
concealTheme
(
String
themeId
)
{
String
user
=
"liujm"
;
// themeManager.blockContent(themeId,user);
return
CommonResp
.
success
();
}
@GetMapping
(
value
=
"/text"
)
@ResponseBody
public
Map
<
String
,
String
>
test
(
@RequestParam
String
themeId
)
{
HashMap
<
String
,
String
>
result
=
new
HashMap
<>();
result
.
put
(
"k"
,
"v"
);
return
result
;
}
}
community-service/src/main/java/com/tanpu/community/feign/course/FeignBackClientForCourse.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.course.vo.CourseDetailExt
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
@Slf4j
@Component
public
class
FeignBackClientForCourse
implements
FallbackFactory
<
FeignClientForCourse
>
{
@Override
public
FeignClientForCourse
create
(
Throwable
throwable
)
{
return
new
FeignClientForCourse
()
{
@Override
public
CommonResp
<
CourseDetailExt
>
getCourseIdDetailInfo
(
String
id
,
String
packageId
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForCourse.getCourseIdDetailInfo-查询课程id:{},package:{}"
,
id
,
packageId
);
return
null
;
}
};
}
}
community-service/src/main/java/com/tanpu/community/feign/course/FeignClientForCourse.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.course.vo.CourseDetailExt
;
import
com.tanpu.community.feign.product.FeignBackClientForProducts
;
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
;
//@FeignClient(value = "service-product", contextId = "product",fallbackFactory = FeignBackClientForProducts.class, path = "/product")
@FeignClient
(
value
=
"service-course"
,
contextId
=
"course"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://127.0.0.1:8198/course"
)
public
interface
FeignClientForCourse
{
@ApiOperation
(
"courseId 详情页"
)
@GetMapping
(
"/course/detail/info"
)
CommonResp
<
CourseDetailExt
>
getCourseIdDetailInfo
(
@ApiParam
(
"课程详情id"
)
@RequestParam
(
"id"
)
String
id
,
@ApiParam
(
"课程包id"
)
@RequestParam
(
"packageId"
)
String
packageId
);
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/ColumnVO.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author: zhoupeng
* @email: zhoupeng_08@163.com
*/
@ApiModel
(
"栏目信息"
)
@Data
public
class
ColumnVO
{
@ApiModelProperty
(
"栏目id"
)
private
String
id
;
@ApiModelProperty
(
"名称"
)
private
String
title
;
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/Course.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
Course
extends
Progression
{
// private List<>
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/CourseDetailExt.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.List
;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
CourseDetailExt
extends
CourseExt
{
@ApiModelProperty
(
"附件信息"
)
private
List
<
FileMetadata
>
resourcePayResps
;
@ApiModelProperty
(
"上线时间"
)
private
Long
lineTimeLong
;
@ApiModelProperty
(
"下一节"
)
private
CourseResExt
nextCourseResExt
;
@ApiModelProperty
(
"上一节"
)
private
CourseResExt
preCourseResExt
;
@ApiModelProperty
(
"背景图"
)
private
String
cover
;
@ApiModelProperty
(
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
"课程文本信息"
)
private
String
courseContext
;
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/CourseExt.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
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-service/src/main/java/com/tanpu/community/feign/course/vo/CourseResExt.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CourseResExt
{
private
String
id
;
private
Integer
type
;
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/FileMetadata.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
@Data
public
class
FileMetadata
{
@ApiModelProperty
(
value
=
"ID"
)
private
String
id
;
@ApiModelProperty
(
value
=
"文件标识"
)
private
String
fileId
;
@ApiModelProperty
(
value
=
"文件名"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"文件大小(单位:字节)"
)
private
Integer
fileSize
;
@ApiModelProperty
(
value
=
"文件类型"
)
private
String
fileType
;
@ApiModelProperty
(
value
=
"预览链接"
)
private
String
previewLink
;
@ApiModelProperty
(
value
=
"预览链接列表(多张图片预览)"
)
private
List
<
String
>
previewLinks
;
@ApiModelProperty
(
value
=
"原文件链接"
)
private
String
link
;
@ApiModelProperty
(
value
=
"文档转换状态"
)
private
Integer
status
;
@ApiModelProperty
(
"需不需要支付 1:需要 2:不需要"
)
private
Integer
needBuy
;
@ApiModelProperty
(
"付费模式 1:免费 2:积分 3:现金"
)
private
Integer
chargeMode
;
@ApiModelProperty
(
"价格"
)
private
String
price
;
@ApiModelProperty
(
"积分"
)
private
Integer
score
;
@ApiModelProperty
(
"有没有支付 1:未购买 2:已购买"
)
private
Integer
isBuy
;
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/LecturerResp.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Data
@ApiModel
(
"讲师信息 LecturerResp"
)
public
class
LecturerResp
{
@ApiModelProperty
(
"讲师ID"
)
private
String
id
;
@ApiModelProperty
(
"讲师姓名"
)
private
String
name
;
@ApiModelProperty
(
"讲师头像"
)
private
String
img
;
@ApiModelProperty
(
"讲师背景图"
)
private
String
bgImg
;
@ApiModelProperty
(
"讲师描述"
)
private
String
desc
;
}
community-service/src/main/java/com/tanpu/community/feign/course/vo/Progression.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
course
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@ApiModel
(
"发刊词信息 Progression"
)
@Data
public
class
Progression
{
@ApiModelProperty
(
"发刊词状态 1:有发刊词 2:没有发刊词"
)
private
Integer
progressionStatus
;
@ApiModelProperty
(
"名称"
)
private
String
progressionName
;
@ApiModelProperty
(
"时间"
)
private
Long
time
;
@ApiModelProperty
(
"发刊词地址"
)
private
String
progressionURL
;
}
community-service/src/main/java/com/tanpu/community/feign/product/FeignBackClientForProducts.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.vo.ProductInfoVO
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignBackClientForProducts
implements
FallbackFactory
<
FeignClientForProducts
>
{
@Override
public
FeignClientForProducts
create
(
Throwable
throwable
)
{
return
new
FeignClientForProducts
()
{
@Override
public
CommonResp
<
ProductInfoVO
>
getProductDetailInfo
(
String
id
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForProducts.getProductDetailInfo-查询产品id:{}"
,
id
);
return
null
;
}
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getProductInfoByIds
(
List
<
String
>
ids
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForProducts.getProductInfoByIds-查询产品ids:{}"
,
ids
);
return
null
;
}
};
}
}
community-service/src/main/java/com/tanpu/community/feign/product/FeignClientForProducts.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
product
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.vo.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-product", contextId = "product",fallbackFactory = FeignBackClientForProducts.class, path = "/product")
@FeignClient
(
value
=
"service-product"
,
contextId
=
"product"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://127.0.0.1:8194/product"
)
public
interface
FeignClientForProducts
{
@ApiOperation
(
"获取产品详情"
)
@GetMapping
(
"/product/detail"
)
CommonResp
<
ProductInfoVO
>
getProductDetailInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"根据id查询列表"
)
@GetMapping
(
"/getProductInfoByIds"
)
CommonResp
<
List
<
ProductInfoVO
>>
getProductInfoByIds
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"fundIds"
)
List
<
String
>
fundIds
);
}
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignBackClientForTanpuroom.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriCulumInfoDetailDto
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriculumDetailVo
;
import
com.tanpu.community.feign.vo.ShortVideoBaseInfoResp
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignBackClientForTanpuroom
implements
FallbackFactory
<
FeignClientForTanpuroom
>
{
@Override
public
FeignClientForTanpuroom
create
(
Throwable
throwable
)
{
return
new
FeignClientForTanpuroom
()
{
@Override
public
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
getShortVideoBaseInfo
(
List
<
String
>
sourceIds
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignBackClientForTanpuroom.getShortVideoBaseInfo-查询短视频ids:{}"
,
sourceIds
);
return
null
;
}
@Override
public
CommonResp
<
CurriculumDetailVo
>
queryCurriculumDetail
(
CurriCulumInfoDetailDto
req
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignBackClientForTanpuroom.getShortVideoBaseInfo-查询课程req:{}"
,
req
);
return
null
;
}
};
}
}
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignClientForTanpuroom.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriCulumInfoDetailDto
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriculumDetailVo
;
import
com.tanpu.community.feign.vo.ShortVideoBaseInfoResp
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
//@FeignClient(value = "service-tanpuroom", contextId = "tanpuroom", fallbackFactory = FeignBackClientForTanpuroom.class, path = "/tanpuroom")
@FeignClient
(
value
=
"service-tanpuroom"
,
contextId
=
"tanpuroom"
,
fallbackFactory
=
FeignBackClientForTanpuroom
.
class
,
path
=
"http://127.0.0.1:8194/tanpuroom"
)
public
interface
FeignClientForTanpuroom
{
@ApiOperation
(
"短视频基础信息"
)
@GetMapping
(
"/shortVideo/getShortVideoBaseInfo"
)
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
getShortVideoBaseInfo
(
@RequestParam
(
"sourceIds"
)
List
<
String
>
sourceIds
);
@ApiOperation
(
value
=
"查询精品课详情"
)
@PostMapping
(
value
=
"/curriculumInfos/detail"
,
produces
=
{
"application/json"
})
CommonResp
<
CurriculumDetailVo
>
queryCurriculumDetail
(
@RequestBody
CurriCulumInfoDetailDto
req
);
}
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/vo/CurriCulumInfoDetailDto.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@ApiModel
(
"查询精品课详情"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CurriCulumInfoDetailDto
{
@ApiModelProperty
(
value
=
"课程ID"
)
private
String
curriculumId
;
@ApiModelProperty
(
value
=
"用户ID"
)
private
String
userId
;
}
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/vo/CurriculumChapterVo.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
description
=
"精品课章节"
)
@Data
public
class
CurriculumChapterVo
{
@ApiModelProperty
(
"id"
)
private
String
id
;
@ApiModelProperty
(
"章节标题"
)
private
String
title
;
@ApiModelProperty
(
"推荐图"
)
private
String
baking
;
@ApiModelProperty
(
"学习人数"
)
private
Long
readNum
;
@ApiModelProperty
(
"讲师介绍"
)
private
String
teacherIntroduct
;
@ApiModelProperty
(
"推荐理由"
)
private
String
operatorsInfo
;
@ApiModelProperty
(
"所属标签"
)
private
String
label
;
@ApiModelProperty
(
"推荐图片"
)
private
String
recommendCover
;
}
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/vo/CurriculumDetailVo.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
tanpuroom
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
description
=
"精品课信息"
)
@Data
public
class
CurriculumDetailVo
{
@ApiModelProperty
(
"课程标题"
)
private
String
ciTitle
;
@ApiModelProperty
(
"封面图"
)
private
String
ciCover
;
@ApiModelProperty
(
"运营推荐话语"
)
private
String
ciOperatorsReason
;
@ApiModelProperty
(
"课程介绍"
)
private
String
ciBriefintro
;
@ApiModelProperty
(
"是否推荐课程"
)
private
int
ciIsrecommend
;
@ApiModelProperty
(
"学习人数"
)
private
int
ccReadActualnum
;
@ApiModelProperty
(
"讲师介绍"
)
private
String
ciTeacherInfo
;
@ApiModelProperty
(
"推荐码"
)
private
String
ciIntroduceCode
;
@ApiModelProperty
(
"推荐课程图片"
)
private
String
introduceImg
;
@ApiModelProperty
(
"推荐章节"
)
private
List
<
CurriculumChapterVo
>
operatorsReason
;
@ApiModelProperty
(
"是否常听"
)
private
String
isOften
;
@ApiModelProperty
private
String
ciFeeType
;
}
community-service/src/main/java/com/tanpu/community/feign/vo/Net.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
/**
* @author: zhoupeng
* @email: zhoupeng_08@163.com
*/
@ApiModel
(
"净值"
)
@Data
@Builder
@AllArgsConstructor
public
class
Net
{
@ApiModelProperty
(
"基金ID"
)
private
String
fundId
;
@ApiModelProperty
(
"净值日期 返回时间戳"
)
private
Long
netDate
;
@ApiModelProperty
(
"单位净值"
)
private
String
netValue
;
@ApiModelProperty
(
"累计净值(分红再投)"
)
private
String
cumulativeNav
;
public
Net
()
{
}
public
Net
(
Long
netDate
,
String
netValue
,
String
cumulativeNav
)
{
this
.
netDate
=
netDate
;
this
.
netValue
=
netValue
;
this
.
cumulativeNav
=
cumulativeNav
;
}
}
community-service/src/main/java/com/tanpu/community/feign/vo/ProductInfoVO.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
vo
;
import
com.tanpu.community.feign.course.vo.ColumnVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@ApiModel
(
"产品信息"
)
@Data
public
class
ProductInfoVO
{
@ApiModelProperty
(
"产品名称"
)
private
String
productName
;
@ApiModelProperty
(
"产品名称 (同productName) 请忽略此字段"
)
private
String
fundName
;
@ApiModelProperty
(
"产品id"
)
private
String
fundId
;
@ApiModelProperty
(
"对比产品id"
)
private
String
ratioId
;
@ApiModelProperty
(
"累计收益"
)
private
String
cumulativeProfit
;
@ApiModelProperty
(
"运行时间"
)
private
String
runTime
;
@ApiModelProperty
(
"产品编码"
)
private
String
productCode
;
@ApiModelProperty
(
"近一个月收益率"
)
private
String
ret1m
;
@ApiModelProperty
(
"最近一年"
)
private
String
ret1y
;
@ApiModelProperty
(
"最近一年"
)
private
BigDecimal
ret1ySort
;
@ApiModelProperty
(
"近一年收益 (同最近一年) 请忽略此字段"
)
private
String
near1YearProfit
;
@ApiModelProperty
(
"今年以来"
)
private
String
retYtd
;
@ApiModelProperty
(
"成立以来收益率"
)
private
String
retIncep
;
@ApiModelProperty
(
"成立以来"
)
private
BigDecimal
retIncepSort
;
@ApiModelProperty
(
"最新净值"
)
private
Net
net
;
@ApiModelProperty
(
"风险等级"
)
private
Integer
riskLevel
;
@ApiModelProperty
(
"基金类型名称"
)
private
String
fundTypeName
;
@ApiModelProperty
(
"起投金额 单位:万"
)
private
String
money
;
@ApiModelProperty
(
"初始规模"
)
private
String
initialSize
;
@ApiModelProperty
(
"最低追加金额"
)
private
String
minMoney
;
@ApiModelProperty
(
"封闭期"
)
private
Integer
lockupPeriod
;
@ApiModelProperty
(
"开放日"
)
private
String
openDay
;
@ApiModelProperty
(
"开放日"
)
private
String
redeemDayStr
;
@ApiModelProperty
(
"申购日"
)
private
Long
applyDay
;
@ApiModelProperty
(
"赎回日"
)
private
Long
redeemDay
;
@ApiModelProperty
(
"产品标签"
)
private
List
<
ProductLabel
>
productLabels
;
@ApiModelProperty
(
"管理人的解答"
)
private
List
<
String
>
problems
;
@ApiModelProperty
(
"回答总数"
)
private
Integer
answerCount
;
@ApiModelProperty
(
"描述"
)
private
String
desc
;
@ApiModelProperty
(
"产品来源 1:探普 2:私募排排 -1:自建产品"
)
private
Integer
dataSources
;
@ApiModelProperty
(
"产品类型 0:公募 1:私募 2:白名单 3:私有基金"
)
private
Integer
productType
;
@ApiModelProperty
(
"策略类型"
)
private
String
strategy
;
@ApiModelProperty
(
"策略类型"
)
private
String
substrategy
;
@ApiModelProperty
(
"策略类型"
)
private
String
substrategyName
;
@ApiModelProperty
(
"策略类型名称"
)
private
String
strategyName
;
@ApiModelProperty
(
"基金公司id"
)
private
String
trustId
;
@ApiModelProperty
(
"基金公司名称"
)
private
String
trustName
;
@ApiModelProperty
(
"是否可预约 0:不可预约 1:可预约"
)
private
Integer
isAppoint
;
@ApiModelProperty
(
"是否有研报 0:没有 1:有研报"
)
private
Integer
isReport
;
private
String
dailyIncrease
;
private
Type
type
;
@ApiModelProperty
(
"栏目信息"
)
private
List
<
ColumnVO
>
vos
;
@ApiModelProperty
(
"成立日期"
)
private
Long
inceptionDate
;
@ApiModelProperty
(
"备案编码"
)
private
String
registerNumber
;
@ApiModelProperty
(
"经理id"
)
private
String
managerId
;
@ApiModelProperty
(
"经理姓名"
)
private
String
managerName
;
@ApiModelProperty
(
"经理数量"
)
private
Integer
managerNum
;
@ApiModelProperty
(
"基金数量"
)
private
Integer
fundNum
;
@ApiModelProperty
(
"公司资产规模"
)
private
Integer
companyAssetSize
;
@ApiModelProperty
(
"点评"
)
private
List
<
Type
>
commentContent
;
@ApiModelProperty
(
"热推 1:表示热推"
)
private
Integer
hotPush
=
0
;
/**
* 是否推荐 0 否 1:是
*/
private
Integer
isRecommend
;
/**
* 推荐
*/
private
String
recommend
;
/**
* 基金文件
*/
private
String
fundFile
;
}
community-service/src/main/java/com/tanpu/community/feign/vo/ProductLabel.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
//@ApiModel("产品标签")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ProductLabel
{
// @ApiModelProperty("标签编码")
private
String
labelCode
;
// @ApiModelProperty("标签名称")
private
String
labelName
;
}
community-service/src/main/java/com/tanpu/community/feign/vo/ShortVideoBaseInfoResp.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@ApiModel
(
"短视频(基础信息)"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ShortVideoBaseInfoResp
{
@ApiModelProperty
(
"资源id"
)
private
String
sourceId
;
@ApiModelProperty
(
"关联栏目id"
)
private
String
columnRelId
;
@ApiModelProperty
(
"视频标题"
)
private
String
title
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
"视频url"
)
private
String
videoUrl
;
@ApiModelProperty
(
"视频url"
)
private
Integer
relType
;
@ApiModelProperty
(
value
=
"讲师"
)
private
String
managerName
;
@ApiModelProperty
(
value
=
"时间"
)
private
Long
createTime
;
}
community-service/src/main/java/com/tanpu/community/feign/vo/Type.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.SuperBuilder
;
@ApiModel
(
"类型"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public
class
Type
{
@ApiModelProperty
(
"类型id"
)
private
String
id
;
@ApiModelProperty
(
"类型value"
)
private
String
value
;
@ApiModelProperty
(
"资源数量"
)
private
Integer
resourceNum
;
@ApiModelProperty
(
"扩展字段"
)
private
String
ext
;
@ApiModelProperty
(
"产品名称"
)
private
String
productName
;
}
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
zhibo
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.zhibo.vo.ZhiboDetailVO
;
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.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.List
;
@FeignClient
(
value
=
"service-zhibo"
,
fallbackFactory
=
FeignbackForZhibo
.
class
,
path
=
"/zhibo"
)
//@FeignClient(value = "service-zhibo", fallbackFactory = FeignbackForZhibo.class, url = "http://127.0.0.1:8183/zhibo")
public
interface
FeignClientForZhibo
{
@ApiOperation
(
value
=
"根据直播间id查询直播间信息"
)
@GetMapping
(
"/theme/{roomId}/detail"
)
CommonResp
<
ZhiboDetailVO
>
queryZhiboDetail
(
@ApiParam
(
value
=
"直播房间"
,
required
=
true
)
@PathVariable
(
"roomId"
)
String
roomId
);
@ApiOperation
(
value
=
"根据id获取直播信息"
)
@PostMapping
(
"/theme/zhibo/detail"
)
CommonResp
<
List
<
ZhiboDetailVO
>>
getZhiBoByIds
(
@RequestBody
List
<
String
>
ids
);
}
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignbackForZhibo.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
zhibo
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.feign.zhibo.vo.ZhiboDetailVO
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignbackForZhibo
implements
FallbackFactory
<
FeignClientForZhibo
>
{
@Override
public
FeignClientForZhibo
create
(
Throwable
throwable
)
{
return
new
FeignClientForZhibo
()
{
@Override
public
CommonResp
queryZhiboDetail
(
String
roomId
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForZhiboTheme.queryZhiboDetail探普学堂-查询直播id:{}"
,
roomId
);
return
null
;
}
@Override
public
CommonResp
<
List
<
ZhiboDetailVO
>>
getZhiBoByIds
(
List
<
String
>
ids
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForZhiboTheme.queryZhiboDetail探普学堂-查询直播ids:{}"
,
ids
);
return
null
;
}
};
}
}
community-service/src/main/java/com/tanpu/community/feign/zhibo/vo/ZhiboDetailVO.java
0 → 100644
View file @
530e1c58
package
com
.
tanpu
.
community
.
feign
.
zhibo
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
description
=
"根据类型获取直播信息"
)
@Data
public
class
ZhiboDetailVO
{
@ApiModelProperty
(
"房间id"
)
private
String
id
;
@ApiModelProperty
(
"直播名称"
)
private
String
ztName
;
@ApiModelProperty
(
"开播时间"
)
private
Long
ztStarttime
;
@ApiModelProperty
(
"结束时间"
)
private
Long
ztEndtime
;
@ApiModelProperty
(
"主讲人信息"
)
private
String
ztUname
;
@ApiModelProperty
(
"直播状态"
)
private
String
ztStatus
;
@ApiModelProperty
(
"封面链接"
)
private
String
ztImg
;
@ApiModelProperty
(
"源封面"
)
private
String
sourceImg
;
@ApiModelProperty
(
"直播类型 1探普之夜,2探普八点半"
)
private
String
ztType
;
@ApiModelProperty
(
"直播l类型 name"
)
private
String
ztTypeName
;
@ApiModelProperty
(
"讲师介绍"
)
private
String
managerName
;
@ApiModelProperty
(
"预约人数"
)
private
Integer
reservationNum
;
@ApiModelProperty
(
"展示参与人次"
)
private
Integer
participantsNum
;
@ApiModelProperty
(
"参与人次"
)
private
Integer
participantsPv
;
@ApiModelProperty
(
"直播标签"
)
private
String
ztTag
;
@ApiModelProperty
(
"参与人次基数"
)
private
Integer
ztCardinal
;
@ApiModelProperty
(
"开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
"直播间描述"
)
private
String
ztDesc
;
@ApiModelProperty
(
"周几"
)
private
Integer
weekDay
;
@ApiModelProperty
(
value
=
"探普云参与权限 1所有人,2仅注册用户,3仅探普会员"
)
private
Integer
participationRigth
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
explain
;
@ApiModelProperty
(
"是否大于指定时间 0:不大于 1:大于"
)
private
Integer
isThanTime
;
@ApiModelProperty
(
value
=
"内容"
)
private
String
ztInfo
;
@ApiModelProperty
(
"可转播设置 1:可转播 0:不可转播"
)
private
Integer
canBroadcast
;
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.ForwardThemeReq
;
import
com.tanpu.community.api.beans.qo.MainTextQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.CreateThemeReq
;
import
com.tanpu.community.api.beans.ForwardThemeDTO
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.community.api.constants.CollectionTypeEnum
;
import
com.tanpu.community.api.constants.CommentTypeEnum
;
import
com.tanpu.community.api.enums.BlockTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.ThemeTypeEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.tanpu.community.dao.entity.user.OrderFlowEntity
;
import
com.tanpu.community.feign.product.FeignClientForProducts
;
import
com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriCulumInfoDetailDto
;
import
com.tanpu.community.feign.tanpuroom.vo.CurriculumDetailVo
;
import
com.tanpu.community.feign.vo.*
;
import
com.tanpu.community.feign.zhibo.FeignClientForZhibo
;
import
com.tanpu.community.feign.zhibo.vo.ZhiboDetailVO
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -21,6 +29,8 @@ import javax.annotation.Resource;
import
java.time.Duration
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
...
...
@@ -63,24 +73,32 @@ public class ThemeManager {
@Autowired
private
HomePageService
homePageService
;
public
void
createTheme
(
CreateThemeReq
req
,
String
userId
)
{
@Resource
private
FeignClientForTanpuroom
feignClientForTanpuroom
;
@Resource
private
FeignClientForZhibo
feignClientForZhibo
;
@Resource
private
FeignClientForProducts
feignClientForProducts
;
public
void
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
ThemeEntity
themeEntity
=
new
ThemeEntity
();
BeanUtils
.
copyProperties
(
req
,
themeEntity
);
BeanUtils
.
copyProperties
(
req
,
themeEntity
);
themeEntity
.
setAuthorId
(
userId
);
themeService
.
insertTheme
(
themeEntity
);
List
<
ThemeAttachmentEntity
>
themeAttachments
=
ConvertUtil
.
themeReqToAttachmentList
(
req
,
themeEntity
.
getId
());
List
<
ThemeAttachmentEntity
>
themeAttachments
=
ConvertUtil
.
themeReqToAttachmentList
(
req
,
themeEntity
.
getId
());
//TODO 敏感词过滤
themeAttachmentService
.
insertList
(
themeAttachments
);
}
// 返回推荐主题文章
public
List
<
ThemeQo
>
selectHotThemes
(
String
userId
)
{
// TODO:
根据算法计算推荐主题
// TODO:
推荐
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectAll
();
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
for
(
ThemeQo
themeQO
:
themeQos
)
{
fillDTOExtraInfo
(
themeQO
,
userId
);
}
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
return
themeQos
;
}
...
...
@@ -89,13 +107,11 @@ public class ThemeManager {
public
List
<
ThemeQo
>
selectInterestThemes
(
String
userId
)
{
List
<
String
>
fansList
=
fansRelService
.
queryFansByFollowerId
(
userId
);
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectByFans
(
fansList
);
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
for
(
ThemeQo
themeQO
:
themeQos
)
{
fillDTOExtraInfo
(
themeQO
,
userId
);
}
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
return
themeQos
;
}
//计算迄今时间
private
String
calUpToNowTime
(
LocalDateTime
start
)
{
Duration
between
=
Duration
.
between
(
LocalDateTime
.
now
(),
start
);
long
duration
=
between
.
toMinutes
();
...
...
@@ -133,13 +149,15 @@ public class ThemeManager {
}
//转发
public
void
forward
(
ForwardTheme
DTO
forwardThemeDTO
,
String
userId
)
{
ThemeEntity
targetTheme
=
themeService
.
selectById
(
forwardThemeDTO
.
getFormerThemeId
());
public
void
forward
(
ForwardTheme
Req
req
,
String
userId
)
{
ThemeEntity
targetTheme
=
themeService
.
selectById
(
req
.
getFormerThemeId
());
ThemeEntity
newTheme
=
ThemeEntity
.
builder
()
.
content
(
targetTheme
.
getContent
())
.
formerThemeId
(
targetTheme
.
getId
())
.
content
(
req
.
getContent
())
.
topicId
(
req
.
getTopicId
())
.
formerThemeId
(
req
.
getFormerThemeId
())
.
authorId
(
userId
)
.
createBy
(
userId
)
.
themeType
(
ThemeTypeEnum
.
DISCUSSION
.
getCode
())
.
build
();
themeService
.
insertTheme
(
newTheme
);
...
...
@@ -160,20 +178,22 @@ public class ThemeManager {
//TODO
}
//屏蔽(用户)
public
void
blockUser
(
String
themeId
,
String
userId
)
{
String
blockId
=
themeService
.
selectById
(
themeId
).
getAuthorId
();
blackListService
.
addBlock
(
blockId
,
userId
,
BlockTypeEnum
.
USER
);
// 屏蔽(用户)
public
void
blockUser
(
String
blockUser
,
String
userId
)
{
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
blockUser
,
userId
,
BlockTypeEnum
.
USER
.
getCode
());
if
(
selectOne
==
null
)
{
blackListService
.
addBlock
(
blockUser
,
userId
,
BlockTypeEnum
.
USER
);
}
}
// 解除屏蔽(用户)
public
void
unblockUser
(
String
themeId
,
String
userId
)
{
public
void
unblockUser
(
String
blockUser
,
String
userId
)
{
}
// 屏蔽(主题)
public
void
blockTheme
(
String
themeId
,
String
userId
)
{
blackListService
.
addBlock
(
themeId
,
userId
,
BlockTypeEnum
.
THEME
);
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
userId
,
BlockTypeEnum
.
USER
.
getCode
(),
themeService
.
selectById
(
themeId
).
getAuthorId
());
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
themeService
.
selectById
(
themeId
).
getAuthorId
(),
userId
,
BlockTypeEnum
.
USER
.
getCode
());
if
(
selectOne
==
null
)
{
blackListService
.
addBlock
(
themeService
.
selectById
(
themeId
).
getAuthorId
(),
userId
,
BlockTypeEnum
.
USER
);
}
...
...
@@ -184,61 +204,70 @@ public class ThemeManager {
blackListService
.
removeBlackList
(
themeId
,
userId
,
BlockTypeEnum
.
USER
);
}
//屏蔽(内容)
// public void blockContent(String themeId, String userId) {
// BlackListEntity selectOne = blackListService.selectOne(userId, BlockTypeEnum.USER.getCode(), themeId);
// if (selectOne==null){
// blackListService.insertBlackList(userId, BlockTypeEnum.USER.getCode(), themeId);
// }
// }
//查询话题所需关联信息
private
void
fillDTOExtraInfo
(
ThemeQo
themeQO
,
String
userId
)
{
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
themeQO
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
attachments
)){
return
;
}
List
<
Object
>
obs
=
attachments
.
stream
().
map
(
themeAttachmentEntity
->
transferAttachment
(
themeAttachmentEntity
,
userId
)).
collect
(
Collectors
.
toList
());
themeQO
.
setAttachment
(
obs
);
//是否关注
themeQO
.
setUpToNowTime
(
calUpToNowTime
(
themeQO
.
getCreateTime
()));
String
authorId
=
themeQO
.
getAuthorId
();
Set
<
String
>
fansSet
=
fansRelService
.
queryFansByFollowerId
(
userId
).
stream
().
collect
(
Collectors
.
toSet
());
if
(
fansSet
.
contains
(
authorId
))
{
themeQO
.
setFollow
(
true
);
}
else
{
themeQO
.
setFollow
(
false
);
//主题Entity转QO
private
List
<
ThemeQo
>
convertEntityToQo
(
List
<
ThemeEntity
>
themeEntities
,
String
userId
)
{
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
for
(
ThemeQo
themeQO
:
themeQos
)
{
//附件列表
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
themeQO
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
attachments
))
{
continue
;
}
List
<
Object
>
obs
=
attachments
.
stream
().
map
(
themeAttachmentEntity
->
transferAttachment
(
themeAttachmentEntity
,
userId
)).
collect
(
Collectors
.
toList
());
themeQO
.
setAttachment
(
obs
);
//是否关注作者
themeQO
.
setUpToNowTime
(
calUpToNowTime
(
themeQO
.
getCreateTime
()));
String
authorId
=
themeQO
.
getAuthorId
();
Set
<
String
>
fansSet
=
new
HashSet
<>(
fansRelService
.
queryFansByFollowerId
(
userId
));
themeQO
.
setFollow
(
fansSet
.
contains
(
authorId
));
//用户信息:头像、昵称
HomePageEntity
userEntity
=
homePageService
.
selectByUserId
(
userId
);
themeQO
.
setUserImg
(
userEntity
.
getHeadImg
());
themeQO
.
setNickName
(
userEntity
.
getNickName
());
}
HomePageEntity
userEntity
=
homePageService
.
selectByUserId
(
userId
);
themeQO
.
setUserImg
(
userEntity
.
getHeadImg
());
themeQO
.
setNickName
(
userEntity
.
getNickName
());
return
themeQos
;
}
public
Object
transferAttachment
(
ThemeAttachmentEntity
themeAttachment
,
String
userId
){
public
Object
transferAttachment
(
ThemeAttachmentEntity
themeAttachment
,
String
userId
)
{
String
attachmentId
=
themeAttachment
.
getAttchId
();
switch
(
themeAttachment
.
getAttachType
())
{
//附件类型 1:产品 2:直播 3:短视频 4:课程
//TODO ENTITY 转 DTO
case
1
:
return
finProResService
.
selectById
(
themeAttachment
.
getAttchId
());
CommonResp
<
ProductInfoVO
>
productDetailInfo
=
feignClientForProducts
.
getProductDetailInfo
(
attachmentId
);
return
productDetailInfo
.
getData
();
// return finProResService.selectById(themeAttachment.getAttchId());
case
2
:
return
zhiboService
.
selectByid
(
themeAttachment
.
getAttchId
());
CommonResp
<
ZhiboDetailVO
>
zhiboDetailVOCommonResp
=
feignClientForZhibo
.
queryZhiboDetail
(
attachmentId
);
return
zhiboDetailVOCommonResp
.
getData
();
// return zhiboService.selectByid(themeAttachment.getAttchId());
case
3
:
CurriculumResEntity
curriculumResEntity
=
curriculumResService
.
selectShortVideo
(
themeAttachment
.
getAttchId
());
return
curriculumResEntity
;
String
[]
attachmentIds
=
new
String
[]{
attachmentId
};
CommonResp
<
List
<
ShortVideoBaseInfoResp
>>
shortVideoBaseInfo
=
feignClientForTanpuroom
.
getShortVideoBaseInfo
(
Arrays
.
asList
(
attachmentIds
));
return
shortVideoBaseInfo
.
getData
().
get
(
0
);
// CurriculumResEntity curriculumResEntity = curriculumResService.selectShortVideo(themeAttachment.getAttchId());
// return curriculumResEntity;
case
4
:
curriculumResEntity
=
curriculumResService
.
selectById
(
themeAttachment
.
getAttchId
());
//todo 栏目详情,需要判断当前用户是否购买
OrderFlowEntity
orderFlowEntity
=
orderFlowService
.
queryByUserAndProId
(
themeAttachment
.
getThemeId
(),
userId
);
return
curriculumResEntity
;
CurriCulumInfoDetailDto
curriCulumInfoDetailDto
=
CurriCulumInfoDetailDto
.
builder
().
curriculumId
(
attachmentId
).
userId
(
userId
).
build
();
CommonResp
<
CurriculumDetailVo
>
curriculumDetailVoCommonResp
=
feignClientForTanpuroom
.
queryCurriculumDetail
(
curriCulumInfoDetailDto
);
return
curriculumDetailVoCommonResp
.
getData
();
// curriculumResEntity = curriculumResService.selectById(themeAttachment.getAttchId());
//
// OrderFlowEntity orderFlowEntity = orderFlowService.queryByUserAndProId(themeAttachment.getThemeId(), userId);
// return curriculumResEntity;
default
:
return
null
;
return
null
;
}
}
public
MainTextQo
getMainText
(
String
topicId
)
{
return
null
;
}
}
community-service/src/main/java/com/tanpu/community/service/BlackListService.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.enums.BlockTypeEnum
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.mapper.community.BlackListMapper
;
import
org.springframework.stereotype.Service
;
...
...
@@ -14,26 +16,38 @@ public class BlackListService {
private
BlackListMapper
blackListMapper
;
public
void
addBlock
(
String
blockId
,
String
userId
,
BlockTypeEnum
type
)
{
BlackListEntity
blackListEntity
=
BlackListEntity
.
builder
()
.
blocker
(
userId
)
.
blockedId
(
blockId
)
.
blockedType
(
type
.
getCode
())
.
build
();
blackListMapper
.
insert
(
blackListEntity
);
BlackListEntity
selected
=
selectOne
(
blockId
,
userId
,
type
.
getCode
());
//如果数据已存在,则修改delete_tag
if
(
selected
!=
null
)
{
selected
.
setDeleteTag
(
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
blackListMapper
.
updateById
(
selected
);
}
else
{
BlackListEntity
blackListEntity
=
BlackListEntity
.
builder
()
.
blocker
(
userId
)
.
blockedId
(
blockId
)
.
blockedType
(
type
.
getCode
())
.
build
();
blackListMapper
.
insert
(
blackListEntity
);
}
}
public
BlackListEntity
selectOne
(
String
block
er
,
Integer
blockType
,
String
blockId
)
{
public
BlackListEntity
selectOne
(
String
block
Id
,
String
blocker
,
Integer
blockType
)
{
return
blackListMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BlackListEntity
>()
.
eq
(
BlackListEntity:
:
getBlocker
,
blocker
)
.
eq
(
BlackListEntity:
:
getBlockedId
,
blockId
)
.
eq
(
BlackListEntity:
:
getBlockedType
,
blockType
));
.
eq
(
BlackListEntity:
:
getBlockedType
,
blockType
)
.
eq
(
BlackListEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
public
void
removeBlackList
(
String
blocker
,
String
blockId
,
BlockTypeEnum
blockType
)
{
blackListMapper
.
delete
(
new
LambdaQueryWrapper
<
BlackListEntity
>()
.
eq
(
BlackListEntity:
:
getBlocker
,
blocker
)
.
eq
(
BlackListEntity:
:
getBlockedId
,
blockId
)
.
eq
(
BlackListEntity:
:
getBlockedType
,
blockType
.
getCode
()));
BlackListEntity
selected
=
selectOne
(
blockId
,
blocker
,
blockType
.
getCode
());
if
(
selected
==
null
)
{
throw
new
BizException
(
"black_list数据不存在"
);
}
else
{
selected
.
setDeleteTag
(
DeleteTagEnum
.
DELETED
.
getCode
());
blackListMapper
.
updateById
(
selected
);
}
}
}
community-service/src/main/java/com/tanpu/community/service/CollectionService.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.
constant
s.CollectionTypeEnum
;
import
com.tanpu.community.api.
constant
s.DeleteTagEnum
;
import
com.tanpu.community.api.
enum
s.CollectionTypeEnum
;
import
com.tanpu.community.api.
enum
s.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.CollectionEntity
;
import
com.tanpu.community.dao.mapper.community.CollectionMapper
;
import
com.tanpu.community.util.ConvertUtil
;
...
...
community-service/src/main/java/com/tanpu/community/service/CurriculumResService.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.
constant
s.CurriculumEnum
;
import
com.tanpu.community.api.
constant
s.DeleteTagEnum
;
import
com.tanpu.community.api.
enum
s.CurriculumEnum
;
import
com.tanpu.community.api.
enum
s.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.tanpu.community.dao.mapper.user.CurriculumResMapper
;
import
org.springframework.stereotype.Service
;
...
...
community-service/src/main/java/com/tanpu/community/service/OrderFlowService.java
View file @
530e1c58
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.api.
constant
s.DeleteTagEnum
;
import
com.tanpu.community.api.
enum
s.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.user.OrderFlowEntity
;
import
com.tanpu.community.dao.mapper.user.OrderFlowMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
530e1c58
...
...
@@ -2,8 +2,8 @@ package com.tanpu.community.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.tanpu.community.api.
constant
s.DeleteTagEnum
;
import
com.tanpu.community.api.
constant
s.TopicStatusEnum
;
import
com.tanpu.community.api.
enum
s.DeleteTagEnum
;
import
com.tanpu.community.api.
enum
s.TopicStatusEnum
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
org.springframework.cache.annotation.EnableCaching
;
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
530e1c58
...
...
@@ -5,7 +5,7 @@ import com.tanpu.community.api.beans.req.CreateThemeReq;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.TopicBriefInfoDTO
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.
constant
s.DeleteTagEnum
;
import
com.tanpu.community.api.
enum
s.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.HomePageEntity
;
import
com.tanpu.community.dao.entity.community.ThemeAttachmentEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
...
...
docs/create.sql
View file @
530e1c58
...
...
@@ -37,7 +37,7 @@ CREATE TABLE `theme` (
`attach_type`
int
(
4
)
NOT
NULL
COMMENT
'附件类型'
,
`attachment`
text
NOT
NULL
COMMENT
'附件内容'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`former_theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'被转发的主题'
,
`former_theme_id`
varchar
(
64
)
COMMENT
'被转发的主题'
,
`topic_id`
varchar
(
64
)
NOT
NULL
COMMENT
'所属的话题'
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
...
...
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