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
1f84303a
Commit
1f84303a
authored
Jul 20, 2021
by
吴泽佳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://47.100.44.39:10001/tp-backend/tanpu-community
into dev
parents
8d9f4c33
547cb7e9
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
473 additions
and
1544 deletions
+473
-1544
ESThemeQo.java
...main/java/com/tanpu/community/api/beans/qo/ESThemeQo.java
+17
-17
ThemeContentQo.java
...java/com/tanpu/community/api/beans/qo/ThemeContentQo.java
+0
-1
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+10
-2
Pageable.java
...java/com/tanpu/community/api/beans/req/page/Pageable.java
+2
-2
ThemeFullSearchReq.java
...pu/community/api/beans/req/search/ThemeFullSearchReq.java
+5
-1
ThemeFullSearchResp.java
...m/tanpu/community/api/beans/resp/ThemeFullSearchResp.java
+18
-0
pom.xml
community-service/pom.xml
+7
-0
CommunityApplication.java
...c/main/java/com/tanpu/community/CommunityApplication.java
+1
-0
ESConfig.java
...ce/src/main/java/com/tanpu/community/config/ESConfig.java
+4
-5
SearchController.java
...java/com/tanpu/community/controller/SearchController.java
+7
-3
CurriculumPriceEntity.java
...anpu/community/dao/entity/user/CurriculumPriceEntity.java
+0
-244
CurriculumResEntity.java
.../tanpu/community/dao/entity/user/CurriculumResEntity.java
+0
-305
FinProResEntity.java
.../com/tanpu/community/dao/entity/user/FinProResEntity.java
+0
-463
OrderFlowEntity.java
.../com/tanpu/community/dao/entity/user/OrderFlowEntity.java
+0
-377
UserInfoEntity.java
...a/com/tanpu/community/dao/entity/user/UserInfoEntity.java
+17
-4
CurriculumPriceMapper.java
...anpu/community/dao/mapper/user/CurriculumPriceMapper.java
+0
-16
CurriculumResMapper.java
.../tanpu/community/dao/mapper/user/CurriculumResMapper.java
+0
-16
FinProResMapper.java
.../com/tanpu/community/dao/mapper/user/FinProResMapper.java
+0
-16
OrderFlowMapper.java
.../com/tanpu/community/dao/mapper/user/OrderFlowMapper.java
+0
-16
FeignClientForFatools.java
.../tanpu/community/feign/fatools/FeignClientForFatools.java
+4
-0
FeignbackForFatools.java
...om/tanpu/community/feign/fatools/FeignbackForFatools.java
+7
-0
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+7
-7
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+71
-17
ESWrapper.java
...ce/src/main/java/com/tanpu/community/model/ESWrapper.java
+21
-0
BatchFeignCallService.java
...va/com/tanpu/community/service/BatchFeignCallService.java
+18
-12
ESHelper.java
.../main/java/com/tanpu/community/service/base/ESHelper.java
+20
-15
ESService.java
...main/java/com/tanpu/community/service/base/ESService.java
+15
-3
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+30
-0
TencentcloudUtils.java
...main/java/com/tanpu/community/util/TencentcloudUtils.java
+184
-0
application-dev.yml
community-service/src/main/resources/application-dev.yml
+7
-2
UserInfoEntityMapper.xml
...e/src/main/resources/mapper/user/UserInfoEntityMapper.xml
+1
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/ESThemeQo.java
View file @
1f84303a
...
@@ -18,23 +18,23 @@ public class ESThemeQo {
...
@@ -18,23 +18,23 @@ public class ESThemeQo {
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题 3:转发 4:评论"
)
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题 3:转发 4:评论"
)
public
Integer
themeType
;
public
Integer
themeType
;
@ApiModelProperty
(
value
=
"内容"
)
@ApiModelProperty
(
value
=
"
文本
内容"
)
public
String
c
ontent
;
public
String
textC
ontent
;
@ApiModelProperty
(
value
=
"话题名称"
)
//
@ApiModelProperty(value = "话题名称")
public
String
topicTitle
;
//
public String topicTitle;
//
@ApiModelProperty
(
value
=
"昵称"
)
//
@ApiModelProperty(value = "昵称")
public
String
nickName
;
//
public String nickName;
//
@ApiModelProperty
(
value
=
"作者认证"
)
//
@ApiModelProperty(value = "作者认证")
public
String
authLabel
;
//
public String authLabel;
//
@ApiModelProperty
(
value
=
"转发的主题"
)
//
@ApiModelProperty(value = "转发的主题")
public
FormerThemeQo
formerTheme
;
//
public FormerThemeQo formerTheme;
//
@ApiModelProperty
(
value
=
"评论Id(我的评论列表使用)"
)
//
@ApiModelProperty(value = "评论Id(我的评论列表使用)")
public
String
commentId
;
//
public String commentId;
public
Long
createTime
;
public
Long
createTime
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeContentQo.java
View file @
1f84303a
...
@@ -23,7 +23,6 @@ public class ThemeContentQo {
...
@@ -23,7 +23,6 @@ public class ThemeContentQo {
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
private
String
value
;
private
String
value
;
@ApiModelProperty
(
value
=
"产品类型,0 公募,1 私募,2 白名单,3 私有"
)
@ApiModelProperty
(
value
=
"产品类型,0 公募,1 私募,2 白名单,3 私有"
)
private
Integer
productType
;
private
Integer
productType
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
1f84303a
...
@@ -57,8 +57,16 @@ public class ThemeQo implements Serializable {
...
@@ -57,8 +57,16 @@ public class ThemeQo implements Serializable {
@ApiModelProperty
(
value
=
"当前用户是否关注该作者"
)
@ApiModelProperty
(
value
=
"当前用户是否关注该作者"
)
public
boolean
follow
;
public
boolean
follow
;
@ApiModelProperty
(
value
=
"作者认证"
)
@ApiModelProperty
(
"认证标签用-用户等级体系 0 游客 1注册用户 10投资人 20 探普理顾 30 探普专家理顾 40 交易理财师 50 首席投顾"
)
private
Integer
authLabel
;
private
Integer
levelGrade
;
@ApiModelProperty
(
"认证标签用-当levelGrade=10有值 1投资萌新 2投资达人"
)
private
String
userInvestorType
;
@ApiModelProperty
(
"认证标签用-用户类型 1普通账号 2机构账号 3机构人员"
)
private
Integer
userType
;
@ApiModelProperty
(
"认证标签用-所属机构id"
)
private
String
belongUserOrgId
;
@ApiModelProperty
(
"认证标签用-所属机构名"
)
private
String
belongUserOrgName
;
@ApiModelProperty
(
value
=
"认证机构"
)
@ApiModelProperty
(
value
=
"认证机构"
)
private
String
authOrg
;
private
String
authOrg
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/page/Pageable.java
View file @
1f84303a
...
@@ -15,9 +15,9 @@ public class Pageable {
...
@@ -15,9 +15,9 @@ public class Pageable {
public
static
final
Integer
DEFAULT_PAGE_NUMBER
=
0
;
public
static
final
Integer
DEFAULT_PAGE_NUMBER
=
0
;
p
rivate
Integer
pageNumber
=
DEFAULT_PAGE_NUMBER
;
p
ublic
Integer
pageNumber
=
DEFAULT_PAGE_NUMBER
;
p
rivate
Integer
pageSize
=
DEFAULT_PAGE_SIZE
;
p
ublic
Integer
pageSize
=
DEFAULT_PAGE_SIZE
;
public
Pageable
()
{
public
Pageable
()
{
}
}
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/search/ThemeFullSearchReq.java
View file @
1f84303a
...
@@ -3,7 +3,11 @@ package com.tanpu.community.api.beans.req.search;
...
@@ -3,7 +3,11 @@ package com.tanpu.community.api.beans.req.search;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
ThemeFullSearchReq
extends
Pageable
{
public
class
ThemeFullSearchReq
{
public
Pageable
page
;
public
String
keyword
;
public
String
keyword
;
public
List
<
String
>
excludeIds
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/resp/ThemeFullSearchResp.java
0 → 100644
View file @
1f84303a
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
public
class
ThemeFullSearchResp
{
public
List
<
String
>
excludeIds
;
public
List
<
ThemeQo
>
themes
;
public
ThemeFullSearchResp
()
{
this
.
excludeIds
=
new
ArrayList
<>();
this
.
themes
=
new
ArrayList
<>();
}
}
community-service/pom.xml
View file @
1f84303a
...
@@ -167,6 +167,13 @@
...
@@ -167,6 +167,13 @@
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<!--腾讯云内容校验-->
<dependency>
<groupId>
com.tencentcloudapi
</groupId>
<artifactId>
tencentcloud-sdk-java
</artifactId>
<version>
4.0.11
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
community-service/src/main/java/com/tanpu/community/CommunityApplication.java
View file @
1f84303a
...
@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableCaching
@EnableCaching
@EnableScheduling
@EnableScheduling
@EnableFeignClients
@EnableFeignClients
@EnableConfigurationProperties
({
ESConfig
.
class
})
public
class
CommunityApplication
{
public
class
CommunityApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
community-service/src/main/java/com/tanpu/community/config/ESConfig.java
View file @
1f84303a
package
com
.
tanpu
.
community
.
config
;
package
com
.
tanpu
.
community
.
config
;
import
lombok.Data
;
import
org.apache.http.HttpHost
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
...
@@ -16,16 +17,14 @@ import org.springframework.context.annotation.Bean;
...
@@ -16,16 +17,14 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
@Configuration
@Data
@Component
@ConfigurationProperties
(
prefix
=
"es"
)
public
class
ESConfig
{
public
class
ESConfig
{
@Value
(
"${es.userName}"
)
private
String
userName
;
private
String
userName
;
@Value
(
"${es.userPasswd}"
)
private
String
userPasswd
;
private
String
userPasswd
;
@Value
(
"${es.host}"
)
private
String
host
;
private
String
host
;
@Value
(
"${es.port}"
)
private
Integer
port
;
private
Integer
port
;
@Bean
@Bean
...
...
community-service/src/main/java/com/tanpu/community/controller/SearchController.java
View file @
1f84303a
...
@@ -6,6 +6,7 @@ import com.tanpu.common.auth.UserInfoHelper;
...
@@ -6,6 +6,7 @@ import com.tanpu.common.auth.UserInfoHelper;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.TopicDetailQo
;
import
com.tanpu.community.api.beans.qo.TopicDetailQo
;
import
com.tanpu.community.api.beans.req.search.ThemeFullSearchReq
;
import
com.tanpu.community.api.beans.req.search.ThemeFullSearchReq
;
import
com.tanpu.community.api.beans.resp.ThemeFullSearchResp
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.manager.ThemeManager
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -27,9 +28,12 @@ public class SearchController {
...
@@ -27,9 +28,12 @@ public class SearchController {
private
ThemeManager
themeManager
;
private
ThemeManager
themeManager
;
// 内容全文搜索
// 内容全文搜索
public
CommonResp
<
List
<
ThemeQo
>>
themeSearch
(
ThemeFullSearchReq
req
)
{
@ApiOperation
(
"全文搜索主题"
)
List
<
ThemeQo
>
list
=
themeManager
.
themeFullSearch
(
req
.
keyword
,
req
.
getPageNumber
(),
req
.
getPageSize
(),
userHolder
.
getUserId
());
@PostMapping
(
value
=
"/themeFullText"
)
return
CommonResp
.
success
(
list
);
@ResponseBody
public
CommonResp
<
ThemeFullSearchResp
>
themeFullText
(
@RequestBody
ThemeFullSearchReq
req
)
{
ThemeFullSearchResp
resp
=
themeManager
.
themeFullSearch
(
req
.
keyword
,
req
.
page
.
pageNumber
,
req
.
page
.
pageSize
,
req
.
excludeIds
,
userHolder
.
getUserId
());
return
CommonResp
.
success
(
resp
);
}
}
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/CurriculumPriceEntity.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <p>
* 定价表
* </p>
*
* @author xudong
* @since 2021-06-24
*/
@TableName
(
"curriculum_price"
)
@ApiModel
(
value
=
"CurriculumPriceEntity对象"
,
description
=
"定价表"
)
public
class
CurriculumPriceEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
@ApiModelProperty
(
value
=
"关联id"
)
private
String
relId
;
@ApiModelProperty
(
value
=
"付费模式 1:免费 2:积分 3:现金"
)
private
Integer
chargeMode
;
@ApiModelProperty
(
value
=
"价格"
)
private
Long
price
;
@ApiModelProperty
(
value
=
"划线价"
)
private
Long
crossedPrice
;
@ApiModelProperty
(
value
=
"是否促销 0:否 1 :是 "
)
private
Integer
promo
;
@ApiModelProperty
(
value
=
"促销价格"
)
private
Long
promoPrice
;
@ApiModelProperty
(
value
=
"促销开始日期"
)
private
LocalDateTime
promoStartTime
;
@ApiModelProperty
(
value
=
"促销结束日期"
)
private
LocalDateTime
promoEndTime
;
@ApiModelProperty
(
value
=
"使用积分 0:不使用 1:使用 (保留字段)"
)
private
Integer
useScore
;
@ApiModelProperty
(
value
=
"积分"
)
private
Integer
score
;
@ApiModelProperty
(
value
=
"是否有角色价 0:没有 1:有"
)
private
Integer
isRolePrice
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"删除"
)
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
@ApiModelProperty
(
value
=
"机构id"
)
private
String
orgId
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getRelId
()
{
return
relId
;
}
public
void
setRelId
(
String
relId
)
{
this
.
relId
=
relId
;
}
public
Integer
getChargeMode
()
{
return
chargeMode
;
}
public
void
setChargeMode
(
Integer
chargeMode
)
{
this
.
chargeMode
=
chargeMode
;
}
public
Long
getPrice
()
{
return
price
;
}
public
void
setPrice
(
Long
price
)
{
this
.
price
=
price
;
}
public
Long
getCrossedPrice
()
{
return
crossedPrice
;
}
public
void
setCrossedPrice
(
Long
crossedPrice
)
{
this
.
crossedPrice
=
crossedPrice
;
}
public
Integer
getPromo
()
{
return
promo
;
}
public
void
setPromo
(
Integer
promo
)
{
this
.
promo
=
promo
;
}
public
Long
getPromoPrice
()
{
return
promoPrice
;
}
public
void
setPromoPrice
(
Long
promoPrice
)
{
this
.
promoPrice
=
promoPrice
;
}
public
LocalDateTime
getPromoStartTime
()
{
return
promoStartTime
;
}
public
void
setPromoStartTime
(
LocalDateTime
promoStartTime
)
{
this
.
promoStartTime
=
promoStartTime
;
}
public
LocalDateTime
getPromoEndTime
()
{
return
promoEndTime
;
}
public
void
setPromoEndTime
(
LocalDateTime
promoEndTime
)
{
this
.
promoEndTime
=
promoEndTime
;
}
public
Integer
getUseScore
()
{
return
useScore
;
}
public
void
setUseScore
(
Integer
useScore
)
{
this
.
useScore
=
useScore
;
}
public
Integer
getScore
()
{
return
score
;
}
public
void
setScore
(
Integer
score
)
{
this
.
score
=
score
;
}
public
Integer
getIsRolePrice
()
{
return
isRolePrice
;
}
public
void
setIsRolePrice
(
Integer
isRolePrice
)
{
this
.
isRolePrice
=
isRolePrice
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
LocalDateTime
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
LocalDateTime
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getDeleteTag
()
{
return
deleteTag
;
}
public
void
setDeleteTag
(
Integer
deleteTag
)
{
this
.
deleteTag
=
deleteTag
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
@Override
public
String
toString
()
{
return
"CurriculumPriceEntity{"
+
"id="
+
id
+
", relId="
+
relId
+
", chargeMode="
+
chargeMode
+
", price="
+
price
+
", crossedPrice="
+
crossedPrice
+
", promo="
+
promo
+
", promoPrice="
+
promoPrice
+
", promoStartTime="
+
promoStartTime
+
", promoEndTime="
+
promoEndTime
+
", useScore="
+
useScore
+
", score="
+
score
+
", isRolePrice="
+
isRolePrice
+
", createTime="
+
createTime
+
", createBy="
+
createBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
", updateBy="
+
updateBy
+
", orgId="
+
orgId
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/CurriculumResEntity.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <p>
* 课程资源
* </p>
*
* @author xudong
* @since 2021-06-23
*/
@TableName
(
"curriculum_res"
)
@ApiModel
(
value
=
"CurriculumResEntity对象"
,
description
=
"课程资源"
)
public
class
CurriculumResEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
title
;
@ApiModelProperty
(
value
=
"课程音视频"
)
private
String
audio
;
@ApiModelProperty
(
value
=
"音/视频类型 1:音频 2:视频 3:小视频"
)
private
Integer
audioType
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
String
teacherId
;
@ApiModelProperty
(
value
=
"讲师姓名"
)
private
String
teacherName
;
@ApiModelProperty
(
value
=
"文稿内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"时长"
)
private
Integer
duration
;
@ApiModelProperty
(
value
=
"文件大小KB"
)
private
Integer
fileSize
;
@ApiModelProperty
(
value
=
"组织id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"房间密码"
)
private
String
roomPwd
;
@ApiModelProperty
(
value
=
"白名单 1:白名单 2:黑名单"
)
private
Integer
whiteList
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
value
=
"阅读数"
)
private
Integer
readNum
;
@ApiModelProperty
(
value
=
"阅读基础数"
)
private
Integer
readBaseNum
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"删除标识"
)
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"简介"
)
private
String
info
;
@ApiModelProperty
(
value
=
"封面"
)
private
String
cover
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getAudio
()
{
return
audio
;
}
public
void
setAudio
(
String
audio
)
{
this
.
audio
=
audio
;
}
public
Integer
getAudioType
()
{
return
audioType
;
}
public
void
setAudioType
(
Integer
audioType
)
{
this
.
audioType
=
audioType
;
}
public
String
getTeacherId
()
{
return
teacherId
;
}
public
void
setTeacherId
(
String
teacherId
)
{
this
.
teacherId
=
teacherId
;
}
public
String
getTeacherName
()
{
return
teacherName
;
}
public
void
setTeacherName
(
String
teacherName
)
{
this
.
teacherName
=
teacherName
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
Integer
getDuration
()
{
return
duration
;
}
public
void
setDuration
(
Integer
duration
)
{
this
.
duration
=
duration
;
}
public
Integer
getFileSize
()
{
return
fileSize
;
}
public
void
setFileSize
(
Integer
fileSize
)
{
this
.
fileSize
=
fileSize
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getRoomPwd
()
{
return
roomPwd
;
}
public
void
setRoomPwd
(
String
roomPwd
)
{
this
.
roomPwd
=
roomPwd
;
}
public
Integer
getWhiteList
()
{
return
whiteList
;
}
public
void
setWhiteList
(
Integer
whiteList
)
{
this
.
whiteList
=
whiteList
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
Integer
getReadNum
()
{
return
readNum
;
}
public
void
setReadNum
(
Integer
readNum
)
{
this
.
readNum
=
readNum
;
}
public
Integer
getReadBaseNum
()
{
return
readBaseNum
;
}
public
void
setReadBaseNum
(
Integer
readBaseNum
)
{
this
.
readBaseNum
=
readBaseNum
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
LocalDateTime
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
LocalDateTime
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getDeleteTag
()
{
return
deleteTag
;
}
public
void
setDeleteTag
(
Integer
deleteTag
)
{
this
.
deleteTag
=
deleteTag
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
String
getCover
()
{
return
cover
;
}
public
void
setCover
(
String
cover
)
{
this
.
cover
=
cover
;
}
@Override
public
String
toString
()
{
return
"CurriculumResEntity{"
+
"id="
+
id
+
", title="
+
title
+
", audio="
+
audio
+
", audioType="
+
audioType
+
", teacherId="
+
teacherId
+
", teacherName="
+
teacherName
+
", content="
+
content
+
", duration="
+
duration
+
", fileSize="
+
fileSize
+
", orgId="
+
orgId
+
", roomPwd="
+
roomPwd
+
", whiteList="
+
whiteList
+
", createBy="
+
createBy
+
", readNum="
+
readNum
+
", readBaseNum="
+
readBaseNum
+
", createTime="
+
createTime
+
", updateBy="
+
updateBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
", status="
+
status
+
", sort="
+
sort
+
", info="
+
info
+
", cover="
+
cover
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/FinProResEntity.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <p>
*
* </p>
*
* @author xudong
* @since 2021-06-23
*/
@TableName
(
"fin_pro_res"
)
@ApiModel
(
value
=
"FinProResEntity对象"
,
description
=
""
)
public
class
FinProResEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
String
id
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"名称简拼"
)
private
String
abbr
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
bak
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"标识0:机构产品 1:用户自定义产品"
)
private
String
flag
;
@ApiModelProperty
(
value
=
"产品资料"
)
private
String
resjson
;
@ApiModelProperty
(
value
=
"宣传文案"
)
private
String
desjson
;
@ApiModelProperty
(
value
=
"产品缩略图"
)
private
String
proImgurl
;
@ApiModelProperty
(
value
=
"产品亮点"
)
private
String
proBright
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"修改人"
)
private
String
updateBy
;
@ApiModelProperty
(
value
=
"删除标识"
)
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"机构Id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"产品标签"
)
private
String
proTag
;
@ApiModelProperty
(
value
=
"名称开关"
)
private
String
titleSw
;
@ApiModelProperty
(
value
=
"列表名称"
)
private
String
proTitle
;
@ApiModelProperty
(
value
=
"风险揭示书配置"
)
private
String
proRiskConfig
;
@ApiModelProperty
(
value
=
"风险管控开关"
)
private
Integer
investorCertificationSwitch
;
@ApiModelProperty
(
value
=
"风险评级"
)
private
Integer
riskLevel
;
@ApiModelProperty
(
value
=
"审核人"
)
private
String
arReviewBy
;
@ApiModelProperty
(
value
=
"审核时间"
)
private
LocalDateTime
arReviewTime
;
@ApiModelProperty
(
value
=
"提交发布人"
)
private
String
arSubmitBy
;
@ApiModelProperty
(
value
=
"提交发布时间"
)
private
LocalDateTime
arSubmitTime
;
@ApiModelProperty
(
value
=
"上架人"
)
private
String
arReleaseBy
;
@ApiModelProperty
(
value
=
"上架时间"
)
private
LocalDateTime
arReleaseTime
;
@ApiModelProperty
(
value
=
"产品类型"
)
private
String
proType
;
@ApiModelProperty
(
value
=
"下架人"
)
private
String
arSoltBy
;
@ApiModelProperty
(
value
=
"下架时间"
)
private
LocalDateTime
arSoltTime
;
@ApiModelProperty
(
value
=
"预下架时间"
)
@TableField
(
"pro_soldout_Time"
)
private
LocalDateTime
proSoldoutTime
;
@ApiModelProperty
(
value
=
"募集开始时间"
)
private
LocalDateTime
raiseStart
;
@ApiModelProperty
(
value
=
"募集结束时间"
)
private
LocalDateTime
raiseEnd
;
@ApiModelProperty
(
value
=
"产品状态"
)
private
String
proStatus
;
@ApiModelProperty
(
value
=
"募集量"
)
private
String
raiseNum
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getAbbr
()
{
return
abbr
;
}
public
void
setAbbr
(
String
abbr
)
{
this
.
abbr
=
abbr
;
}
public
String
getBak
()
{
return
bak
;
}
public
void
setBak
(
String
bak
)
{
this
.
bak
=
bak
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getFlag
()
{
return
flag
;
}
public
void
setFlag
(
String
flag
)
{
this
.
flag
=
flag
;
}
public
String
getResjson
()
{
return
resjson
;
}
public
void
setResjson
(
String
resjson
)
{
this
.
resjson
=
resjson
;
}
public
String
getDesjson
()
{
return
desjson
;
}
public
void
setDesjson
(
String
desjson
)
{
this
.
desjson
=
desjson
;
}
public
String
getProImgurl
()
{
return
proImgurl
;
}
public
void
setProImgurl
(
String
proImgurl
)
{
this
.
proImgurl
=
proImgurl
;
}
public
String
getProBright
()
{
return
proBright
;
}
public
void
setProBright
(
String
proBright
)
{
this
.
proBright
=
proBright
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
LocalDateTime
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
LocalDateTime
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
Integer
getDeleteTag
()
{
return
deleteTag
;
}
public
void
setDeleteTag
(
Integer
deleteTag
)
{
this
.
deleteTag
=
deleteTag
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getProTag
()
{
return
proTag
;
}
public
void
setProTag
(
String
proTag
)
{
this
.
proTag
=
proTag
;
}
public
String
getTitleSw
()
{
return
titleSw
;
}
public
void
setTitleSw
(
String
titleSw
)
{
this
.
titleSw
=
titleSw
;
}
public
String
getProTitle
()
{
return
proTitle
;
}
public
void
setProTitle
(
String
proTitle
)
{
this
.
proTitle
=
proTitle
;
}
public
String
getProRiskConfig
()
{
return
proRiskConfig
;
}
public
void
setProRiskConfig
(
String
proRiskConfig
)
{
this
.
proRiskConfig
=
proRiskConfig
;
}
public
Integer
getInvestorCertificationSwitch
()
{
return
investorCertificationSwitch
;
}
public
void
setInvestorCertificationSwitch
(
Integer
investorCertificationSwitch
)
{
this
.
investorCertificationSwitch
=
investorCertificationSwitch
;
}
public
Integer
getRiskLevel
()
{
return
riskLevel
;
}
public
void
setRiskLevel
(
Integer
riskLevel
)
{
this
.
riskLevel
=
riskLevel
;
}
public
String
getArReviewBy
()
{
return
arReviewBy
;
}
public
void
setArReviewBy
(
String
arReviewBy
)
{
this
.
arReviewBy
=
arReviewBy
;
}
public
LocalDateTime
getArReviewTime
()
{
return
arReviewTime
;
}
public
void
setArReviewTime
(
LocalDateTime
arReviewTime
)
{
this
.
arReviewTime
=
arReviewTime
;
}
public
String
getArSubmitBy
()
{
return
arSubmitBy
;
}
public
void
setArSubmitBy
(
String
arSubmitBy
)
{
this
.
arSubmitBy
=
arSubmitBy
;
}
public
LocalDateTime
getArSubmitTime
()
{
return
arSubmitTime
;
}
public
void
setArSubmitTime
(
LocalDateTime
arSubmitTime
)
{
this
.
arSubmitTime
=
arSubmitTime
;
}
public
String
getArReleaseBy
()
{
return
arReleaseBy
;
}
public
void
setArReleaseBy
(
String
arReleaseBy
)
{
this
.
arReleaseBy
=
arReleaseBy
;
}
public
LocalDateTime
getArReleaseTime
()
{
return
arReleaseTime
;
}
public
void
setArReleaseTime
(
LocalDateTime
arReleaseTime
)
{
this
.
arReleaseTime
=
arReleaseTime
;
}
public
String
getProType
()
{
return
proType
;
}
public
void
setProType
(
String
proType
)
{
this
.
proType
=
proType
;
}
public
String
getArSoltBy
()
{
return
arSoltBy
;
}
public
void
setArSoltBy
(
String
arSoltBy
)
{
this
.
arSoltBy
=
arSoltBy
;
}
public
LocalDateTime
getArSoltTime
()
{
return
arSoltTime
;
}
public
void
setArSoltTime
(
LocalDateTime
arSoltTime
)
{
this
.
arSoltTime
=
arSoltTime
;
}
public
LocalDateTime
getProSoldoutTime
()
{
return
proSoldoutTime
;
}
public
void
setProSoldoutTime
(
LocalDateTime
proSoldoutTime
)
{
this
.
proSoldoutTime
=
proSoldoutTime
;
}
public
LocalDateTime
getRaiseStart
()
{
return
raiseStart
;
}
public
void
setRaiseStart
(
LocalDateTime
raiseStart
)
{
this
.
raiseStart
=
raiseStart
;
}
public
LocalDateTime
getRaiseEnd
()
{
return
raiseEnd
;
}
public
void
setRaiseEnd
(
LocalDateTime
raiseEnd
)
{
this
.
raiseEnd
=
raiseEnd
;
}
public
String
getProStatus
()
{
return
proStatus
;
}
public
void
setProStatus
(
String
proStatus
)
{
this
.
proStatus
=
proStatus
;
}
public
String
getRaiseNum
()
{
return
raiseNum
;
}
public
void
setRaiseNum
(
String
raiseNum
)
{
this
.
raiseNum
=
raiseNum
;
}
@Override
public
String
toString
()
{
return
"FinProResEntity{"
+
"id="
+
id
+
", name="
+
name
+
", abbr="
+
abbr
+
", bak="
+
bak
+
", status="
+
status
+
", flag="
+
flag
+
", resjson="
+
resjson
+
", desjson="
+
desjson
+
", proImgurl="
+
proImgurl
+
", proBright="
+
proBright
+
", createTime="
+
createTime
+
", createBy="
+
createBy
+
", updateTime="
+
updateTime
+
", updateBy="
+
updateBy
+
", deleteTag="
+
deleteTag
+
", orgId="
+
orgId
+
", proTag="
+
proTag
+
", titleSw="
+
titleSw
+
", proTitle="
+
proTitle
+
", proRiskConfig="
+
proRiskConfig
+
", investorCertificationSwitch="
+
investorCertificationSwitch
+
", riskLevel="
+
riskLevel
+
", arReviewBy="
+
arReviewBy
+
", arReviewTime="
+
arReviewTime
+
", arSubmitBy="
+
arSubmitBy
+
", arSubmitTime="
+
arSubmitTime
+
", arReleaseBy="
+
arReleaseBy
+
", arReleaseTime="
+
arReleaseTime
+
", proType="
+
proType
+
", arSoltBy="
+
arSoltBy
+
", arSoltTime="
+
arSoltTime
+
", proSoldoutTime="
+
proSoldoutTime
+
", raiseStart="
+
raiseStart
+
", raiseEnd="
+
raiseEnd
+
", proStatus="
+
proStatus
+
", raiseNum="
+
raiseNum
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/OrderFlowEntity.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* <p>
*
* </p>
*
* @author xudong
* @since 2021-06-24
*/
@TableName
(
"order_flow"
)
@ApiModel
(
value
=
"OrderFlowEntity对象"
,
description
=
""
)
public
class
OrderFlowEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
String
id
;
@ApiModelProperty
(
value
=
"订单号"
)
private
String
abOrdernum
;
@ApiModelProperty
(
value
=
"产品价格"
)
private
Long
abPrice
;
@ApiModelProperty
(
value
=
"积分"
)
private
Long
abScore
;
@ApiModelProperty
(
value
=
"积分抵扣"
)
private
Long
abScoreDeduct
;
@ApiModelProperty
(
value
=
"账户余额抵扣"
)
private
Long
abAccountDeduct
;
@ApiModelProperty
(
value
=
"支付通道付款金额"
)
private
Long
abPayment
;
@ApiModelProperty
(
value
=
"支付方式 1:免费 2:积分 3现金"
)
private
String
abPayMode
;
@ApiModelProperty
(
value
=
"订单总额"
)
private
Long
abTotalMoney
;
@ApiModelProperty
(
value
=
"产品类型"
)
private
String
abType
;
@ApiModelProperty
(
value
=
"产品ID"
)
private
String
abProid
;
@ApiModelProperty
(
value
=
"产品规格ID"
)
private
String
abProSiid
;
@ApiModelProperty
(
value
=
"产品规格类型"
)
private
String
abSiType
;
@ApiModelProperty
(
value
=
"产品规格规格名称"
)
private
String
abSiName
;
@ApiModelProperty
(
value
=
"产品规格规格编码"
)
private
String
abSiCode
;
@ApiModelProperty
(
value
=
"产品规格定价模式"
)
private
String
abSiPattern
;
@ApiModelProperty
(
value
=
"状态 WAIT:待支付 SUCCESS:支付成功 FAIL:支付失败 CANCEL:取消交易"
)
private
String
abStatus
;
@ApiModelProperty
(
value
=
"权益分配状态"
)
private
String
abRightsStatus
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createtime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createby
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
updatetime
;
@ApiModelProperty
(
value
=
"修改人"
)
private
String
updateby
;
@ApiModelProperty
(
value
=
"删除标识"
)
private
String
deletetag
;
@ApiModelProperty
(
value
=
"微信unionid"
)
private
String
unionid
;
@ApiModelProperty
(
value
=
"交易流水号"
)
private
String
transactionSerialNo
;
@ApiModelProperty
(
value
=
"付款时间"
)
private
LocalDateTime
payTime
;
@ApiModelProperty
(
value
=
"完成时间"
)
private
LocalDateTime
completeTime
;
@ApiModelProperty
(
value
=
"机构id"
)
private
String
orgId
;
@ApiModelProperty
(
value
=
"注册手机号"
)
private
String
registerPhone
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getAbOrdernum
()
{
return
abOrdernum
;
}
public
void
setAbOrdernum
(
String
abOrdernum
)
{
this
.
abOrdernum
=
abOrdernum
;
}
public
Long
getAbPrice
()
{
return
abPrice
;
}
public
void
setAbPrice
(
Long
abPrice
)
{
this
.
abPrice
=
abPrice
;
}
public
Long
getAbScore
()
{
return
abScore
;
}
public
void
setAbScore
(
Long
abScore
)
{
this
.
abScore
=
abScore
;
}
public
Long
getAbScoreDeduct
()
{
return
abScoreDeduct
;
}
public
void
setAbScoreDeduct
(
Long
abScoreDeduct
)
{
this
.
abScoreDeduct
=
abScoreDeduct
;
}
public
Long
getAbAccountDeduct
()
{
return
abAccountDeduct
;
}
public
void
setAbAccountDeduct
(
Long
abAccountDeduct
)
{
this
.
abAccountDeduct
=
abAccountDeduct
;
}
public
Long
getAbPayment
()
{
return
abPayment
;
}
public
void
setAbPayment
(
Long
abPayment
)
{
this
.
abPayment
=
abPayment
;
}
public
String
getAbPayMode
()
{
return
abPayMode
;
}
public
void
setAbPayMode
(
String
abPayMode
)
{
this
.
abPayMode
=
abPayMode
;
}
public
Long
getAbTotalMoney
()
{
return
abTotalMoney
;
}
public
void
setAbTotalMoney
(
Long
abTotalMoney
)
{
this
.
abTotalMoney
=
abTotalMoney
;
}
public
String
getAbType
()
{
return
abType
;
}
public
void
setAbType
(
String
abType
)
{
this
.
abType
=
abType
;
}
public
String
getAbProid
()
{
return
abProid
;
}
public
void
setAbProid
(
String
abProid
)
{
this
.
abProid
=
abProid
;
}
public
String
getAbProSiid
()
{
return
abProSiid
;
}
public
void
setAbProSiid
(
String
abProSiid
)
{
this
.
abProSiid
=
abProSiid
;
}
public
String
getAbSiType
()
{
return
abSiType
;
}
public
void
setAbSiType
(
String
abSiType
)
{
this
.
abSiType
=
abSiType
;
}
public
String
getAbSiName
()
{
return
abSiName
;
}
public
void
setAbSiName
(
String
abSiName
)
{
this
.
abSiName
=
abSiName
;
}
public
String
getAbSiCode
()
{
return
abSiCode
;
}
public
void
setAbSiCode
(
String
abSiCode
)
{
this
.
abSiCode
=
abSiCode
;
}
public
String
getAbSiPattern
()
{
return
abSiPattern
;
}
public
void
setAbSiPattern
(
String
abSiPattern
)
{
this
.
abSiPattern
=
abSiPattern
;
}
public
String
getAbStatus
()
{
return
abStatus
;
}
public
void
setAbStatus
(
String
abStatus
)
{
this
.
abStatus
=
abStatus
;
}
public
String
getAbRightsStatus
()
{
return
abRightsStatus
;
}
public
void
setAbRightsStatus
(
String
abRightsStatus
)
{
this
.
abRightsStatus
=
abRightsStatus
;
}
public
LocalDateTime
getCreatetime
()
{
return
createtime
;
}
public
void
setCreatetime
(
LocalDateTime
createtime
)
{
this
.
createtime
=
createtime
;
}
public
String
getCreateby
()
{
return
createby
;
}
public
void
setCreateby
(
String
createby
)
{
this
.
createby
=
createby
;
}
public
LocalDateTime
getUpdatetime
()
{
return
updatetime
;
}
public
void
setUpdatetime
(
LocalDateTime
updatetime
)
{
this
.
updatetime
=
updatetime
;
}
public
String
getUpdateby
()
{
return
updateby
;
}
public
void
setUpdateby
(
String
updateby
)
{
this
.
updateby
=
updateby
;
}
public
String
getDeletetag
()
{
return
deletetag
;
}
public
void
setDeletetag
(
String
deletetag
)
{
this
.
deletetag
=
deletetag
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getTransactionSerialNo
()
{
return
transactionSerialNo
;
}
public
void
setTransactionSerialNo
(
String
transactionSerialNo
)
{
this
.
transactionSerialNo
=
transactionSerialNo
;
}
public
LocalDateTime
getPayTime
()
{
return
payTime
;
}
public
void
setPayTime
(
LocalDateTime
payTime
)
{
this
.
payTime
=
payTime
;
}
public
LocalDateTime
getCompleteTime
()
{
return
completeTime
;
}
public
void
setCompleteTime
(
LocalDateTime
completeTime
)
{
this
.
completeTime
=
completeTime
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getRegisterPhone
()
{
return
registerPhone
;
}
public
void
setRegisterPhone
(
String
registerPhone
)
{
this
.
registerPhone
=
registerPhone
;
}
@Override
public
String
toString
()
{
return
"OrderFlowEntity{"
+
"id="
+
id
+
", abOrdernum="
+
abOrdernum
+
", abPrice="
+
abPrice
+
", abScore="
+
abScore
+
", abScoreDeduct="
+
abScoreDeduct
+
", abAccountDeduct="
+
abAccountDeduct
+
", abPayment="
+
abPayment
+
", abPayMode="
+
abPayMode
+
", abTotalMoney="
+
abTotalMoney
+
", abType="
+
abType
+
", abProid="
+
abProid
+
", abProSiid="
+
abProSiid
+
", abSiType="
+
abSiType
+
", abSiName="
+
abSiName
+
", abSiCode="
+
abSiCode
+
", abSiPattern="
+
abSiPattern
+
", abStatus="
+
abStatus
+
", abRightsStatus="
+
abRightsStatus
+
", createtime="
+
createtime
+
", createby="
+
createby
+
", updatetime="
+
updatetime
+
", updateby="
+
updateby
+
", deletetag="
+
deletetag
+
", unionid="
+
unionid
+
", transactionSerialNo="
+
transactionSerialNo
+
", payTime="
+
payTime
+
", completeTime="
+
completeTime
+
", orgId="
+
orgId
+
", registerPhone="
+
registerPhone
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/user/UserInfoEntity.java
View file @
1f84303a
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
package
com
.
tanpu
.
community
.
dao
.
entity
.
user
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializabl
e
;
import
com.baomidou.mybatisplus.annotation.TableNam
e
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
/**
* <p>
* <p>
*
*
* </p>
* </p>
*
*
* @author xudong
* @author xudong
* @since 2021-07-
14
* @since 2021-07-
20
*/
*/
@TableName
(
"user_info"
)
@TableName
(
"user_info"
)
@ApiModel
(
value
=
"UserInfoEntity对象"
,
description
=
""
)
@ApiModel
(
value
=
"UserInfoEntity对象"
,
description
=
""
)
...
@@ -24,6 +25,9 @@ public class UserInfoEntity implements Serializable {
...
@@ -24,6 +25,9 @@ public class UserInfoEntity implements Serializable {
@ApiModelProperty
(
value
=
"唯一主键"
)
@ApiModelProperty
(
value
=
"唯一主键"
)
private
String
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"账户类型 1普通账号 2机构账号 3机构人员"
)
private
Integer
userType
;
@ApiModelProperty
(
value
=
"微信openId"
)
@ApiModelProperty
(
value
=
"微信openId"
)
private
String
uiOpenid
;
private
String
uiOpenid
;
...
@@ -253,6 +257,14 @@ public class UserInfoEntity implements Serializable {
...
@@ -253,6 +257,14 @@ public class UserInfoEntity implements Serializable {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Integer
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
Integer
userType
)
{
this
.
userType
=
userType
;
}
public
String
getUiOpenid
()
{
public
String
getUiOpenid
()
{
return
uiOpenid
;
return
uiOpenid
;
}
}
...
@@ -889,6 +901,7 @@ public class UserInfoEntity implements Serializable {
...
@@ -889,6 +901,7 @@ public class UserInfoEntity implements Serializable {
public
String
toString
()
{
public
String
toString
()
{
return
"UserInfoEntity{"
+
return
"UserInfoEntity{"
+
"id="
+
id
+
"id="
+
id
+
", userType="
+
userType
+
", uiOpenid="
+
uiOpenid
+
", uiOpenid="
+
uiOpenid
+
", uiUnionid="
+
uiUnionid
+
", uiUnionid="
+
uiUnionid
+
", uiTelphone="
+
uiTelphone
+
", uiTelphone="
+
uiTelphone
+
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/user/CurriculumPriceMapper.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.CurriculumPriceEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 定价表 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-24
*/
public
interface
CurriculumPriceMapper
extends
BaseMapper
<
CurriculumPriceEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/CurriculumResMapper.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.CurriculumResEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 课程资源 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-23
*/
public
interface
CurriculumResMapper
extends
BaseMapper
<
CurriculumResEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/FinProResMapper.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.FinProResEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-23
*/
public
interface
FinProResMapper
extends
BaseMapper
<
FinProResEntity
>
{
}
community-service/src/main/java/com/tanpu/community/dao/mapper/user/OrderFlowMapper.java
deleted
100644 → 0
View file @
8d9f4c33
package
com
.
tanpu
.
community
.
dao
.
mapper
.
user
;
import
com.tanpu.community.dao.entity.user.OrderFlowEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-24
*/
public
interface
OrderFlowMapper
extends
BaseMapper
<
OrderFlowEntity
>
{
}
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignClientForFatools.java
View file @
1f84303a
...
@@ -42,6 +42,10 @@ public interface FeignClientForFatools {
...
@@ -42,6 +42,10 @@ public interface FeignClientForFatools {
@GetMapping
(
value
=
"/queryUserInfoNew"
)
@GetMapping
(
value
=
"/queryUserInfoNew"
)
CommonResp
<
UserInfoNew
>
queryUsersListNew
(
@RequestParam
(
"userId"
)
String
userId
);
CommonResp
<
UserInfoNew
>
queryUsersListNew
(
@RequestParam
(
"userId"
)
String
userId
);
@ApiOperation
(
value
=
"批量查询查询基本信息"
)
@GetMapping
(
value
=
"/queryUserBaseInfoList"
)
List
<
UserInfoNew
>
queryUserListNew
(
@RequestParam
(
"userIds"
)
List
<
String
>
userIds
);
@ApiOperation
(
value
=
"根据机构用户id 查询旗下机构用户信息"
)
@ApiOperation
(
value
=
"根据机构用户id 查询旗下机构用户信息"
)
@GetMapping
(
value
=
"/getUsetInfoByOrgUserId"
)
@GetMapping
(
value
=
"/getUsetInfoByOrgUserId"
)
CommonResp
<
List
<
UserInfoOrg
>>
getUsetInfoByOrgUserId
(
@RequestParam
(
"orgUserId"
)
String
orgUserId
);
CommonResp
<
List
<
UserInfoOrg
>>
getUsetInfoByOrgUserId
(
@RequestParam
(
"orgUserId"
)
String
orgUserId
);
...
...
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignbackForFatools.java
View file @
1f84303a
...
@@ -10,6 +10,7 @@ import feign.hystrix.FallbackFactory;
...
@@ -10,6 +10,7 @@ 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.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -51,6 +52,12 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
...
@@ -51,6 +52,12 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
return
CommonResp
.
error
();
return
CommonResp
.
error
();
}
}
@Override
public
List
<
UserInfoNew
>
queryUserListNew
(
List
<
String
>
userIds
)
{
log
.
info
(
"FeignbackForFatools.queryUserListNew"
,
throwable
);
return
Collections
.
emptyList
();
}
@Override
@Override
public
CommonResp
<
List
<
UserInfoOrg
>>
getUsetInfoByOrgUserId
(
String
orgUserId
)
{
public
CommonResp
<
List
<
UserInfoOrg
>>
getUsetInfoByOrgUserId
(
String
orgUserId
)
{
log
.
info
(
"FeignbackForFatools.getUsetInfoByOrgUserId"
,
throwable
);
log
.
info
(
"FeignbackForFatools.getUsetInfoByOrgUserId"
,
throwable
);
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
1f84303a
...
@@ -17,8 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -17,8 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
CommentManager
{
public
class
CommentManager
{
...
@@ -68,11 +70,7 @@ public class CommentManager {
...
@@ -68,11 +70,7 @@ public class CommentManager {
}
}
//是否点赞及点赞数
//是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
String
commentId
=
commentQo
.
getCommentId
();
if
(
likeCommentList
.
contains
(
commentId
))
{
commentQo
.
setHasLiked
(
likeCommentList
.
contains
(
commentId
));
commentQo
.
setHasLiked
(
true
);
}
else
{
commentQo
.
setHasLiked
(
false
);
}
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
...
@@ -81,8 +79,10 @@ public class CommentManager {
...
@@ -81,8 +79,10 @@ public class CommentManager {
// List<CommentLv2Qo> commentLv2Qos = ConvertUtil.commentLv2Entity2Qos(CommentLv2Entities);
// List<CommentLv2Qo> commentLv2Qos = ConvertUtil.commentLv2Entity2Qos(CommentLv2Entities);
// commentQo.setCommentLv2Qos(commentLv2Qos);
// commentQo.setCommentLv2Qos(commentLv2Qos);
}
}
//排序:点赞降序+时间降序
return
commentQos
;
return
commentQos
.
stream
().
sorted
(
Comparator
.
comparing
(
CommentQo:
:
getLikeCount
,
Comparator
.
reverseOrder
()).
thenComparing
(
CommentQo:
:
getUpdateTime
,
Comparator
.
reverseOrder
()))
.
collect
(
Collectors
.
toList
());
}
}
//点赞评论/取消点赞
//点赞评论/取消点赞
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
1f84303a
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.google.common.collect.Sets
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.qo.ESThemeQo
;
import
com.tanpu.community.api.beans.qo.ESThemeQo
;
...
@@ -9,14 +11,19 @@ import com.tanpu.community.api.beans.qo.ThemeQo;
...
@@ -9,14 +11,19 @@ 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.resp.CreateThemeResp
;
import
com.tanpu.community.api.beans.resp.CreateThemeResp
;
import
com.tanpu.community.api.beans.resp.ThemeFullSearchResp
;
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.*
;
import
com.tanpu.community.dao.entity.user.UserInfoEntity
;
import
com.tanpu.community.dao.entity.user.UserInfoEntity
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.base.ESService
;
import
com.tanpu.community.service.base.ESService
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.TencentcloudUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -27,6 +34,7 @@ import java.time.LocalDateTime;
...
@@ -27,6 +34,7 @@ import java.time.LocalDateTime;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@Service
public
class
ThemeManager
{
public
class
ThemeManager
{
@Resource
@Resource
...
@@ -51,7 +59,7 @@ public class ThemeManager {
...
@@ -51,7 +59,7 @@ public class ThemeManager {
private
ThemeAttachmentService
themeAttachmentService
;
private
ThemeAttachmentService
themeAttachmentService
;
@Resource
@Resource
private
ProductService
product
Service
;
private
BatchFeignCallService
batchFeignCall
Service
;
@Autowired
@Autowired
private
VisitSummaryService
visitSummaryService
;
private
VisitSummaryService
visitSummaryService
;
...
@@ -62,23 +70,46 @@ public class ThemeManager {
...
@@ -62,23 +70,46 @@ public class ThemeManager {
@Autowired
@Autowired
private
ESService
esService
;
private
ESService
esService
;
public
List
<
ThemeQo
>
themeFullSearch
(
String
keyword
,
Integer
pageNo
,
Integer
pageSize
,
String
userId
)
{
@Autowired
private
FeignClientForFatools
feignClientForFatools
;
public
ThemeFullSearchResp
themeFullSearch
(
String
keyword
,
Integer
pageNo
,
Integer
pageSize
,
List
<
String
>
excludeIds
,
String
userId
)
{
Integer
from
=
(
pageNo
-
1
)
*
pageSize
;
Integer
from
=
(
pageNo
-
1
)
*
pageSize
;
ThemeFullSearchResp
resp
=
new
ThemeFullSearchResp
();
// 按时间倒叙查询
// 按时间倒叙查询
List
<
ESThemeQo
>
themes
=
esService
.
queryThemeIdByContentAndTitle
(
keyword
,
from
,
pageSize
);
// todo redis
if
(
themes
.
isEmpty
())
{
List
<
ESThemeQo
>
esIds
=
esService
.
queryThemeIdByContentAndTitle
(
keyword
,
from
,
pageSize
*
5
);
return
new
ArrayList
<>();
if
(
esIds
.
isEmpty
())
{
return
resp
;
}
}
List
<
ThemeEntity
>
themeEntities
=
themeService
.
queryByThemeIds
(
themes
.
stream
().
map
(
ESThemeQo:
:
getThemeId
).
collect
(
Collectors
.
toList
()));
// 排除已经展示过的id
return
convertEntityToQo
(
themeEntities
,
userId
);
List
<
String
>
filterEsIds
=
esIds
.
stream
().
map
(
ESThemeQo:
:
getThemeId
).
filter
(
tId
->
{
return
!
excludeIds
.
contains
(
tId
);
}).
limit
(
pageSize
).
collect
(
Collectors
.
toList
());
resp
.
themes
=
convertEntityToQo
(
themeService
.
queryByThemeIds
(
filterEsIds
),
userId
);
resp
.
excludeIds
.
addAll
(
filterEsIds
);
return
resp
;
}
}
@Transactional
@Transactional
public
CreateThemeResp
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
public
CreateThemeResp
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
//直播类型做转播检查
//TODO 敏感词过滤
List
<
ThemeContentReq
>
contents
=
req
.
getContent
();
for
(
ThemeContentReq
content
:
contents
)
{
if
(
content
!=
null
&&
content
.
getType
().
equals
(
RelTypeEnum
.
LIVE
.
type
))
{
CommonResp
<
Set
<
String
>>
notRelayResp
=
feignClientForFatools
.
getNotRelaySet
(
userId
,
Sets
.
newHashSet
(
content
.
getValue
()));
if
(!
notRelayResp
.
isSuccess
())
{
throw
new
BizException
(
"转播失败"
);
}
if
(
CollectionUtils
.
isEmpty
(
notRelayResp
.
getData
()))
{
throw
new
BizException
(
"9999"
,
"很抱歉!您需要购买或报名成功后才可以添加这个直播哦~"
);
}
}
}
//保存主题表
//保存主题表
ThemeEntity
themeEntity
=
new
ThemeEntity
();
ThemeEntity
themeEntity
=
new
ThemeEntity
();
...
@@ -86,6 +117,8 @@ public class ThemeManager {
...
@@ -86,6 +117,8 @@ public class ThemeManager {
themeEntity
.
setAuthorId
(
userId
);
themeEntity
.
setAuthorId
(
userId
);
themeEntity
.
setContent
(
JsonUtil
.
toJson
(
req
.
getContent
()));
themeEntity
.
setContent
(
JsonUtil
.
toJson
(
req
.
getContent
()));
//TODO 敏感词过滤
checkContent
(
themeEntity
.
getContent
());
if
(
StringUtils
.
isEmpty
(
req
.
getEditThemeId
()))
{
if
(
StringUtils
.
isEmpty
(
req
.
getEditThemeId
()))
{
//新建
//新建
...
@@ -103,10 +136,16 @@ public class ThemeManager {
...
@@ -103,10 +136,16 @@ public class ThemeManager {
}
}
themeAttachmentService
.
insertList
(
themeAttachments
);
themeAttachmentService
.
insertList
(
themeAttachments
);
try
{
esService
.
insertOrUpdateTheme
(
ConvertUtil
.
convert
(
themeEntity
));
}
catch
(
Exception
e
)
{
log
.
error
(
"error in save theme to ES. themeId:{}, error:{}"
,
themeEntity
.
getThemeId
(),
ExceptionUtils
.
getStackTrace
(
e
));
}
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
}
}
/**
/**
* 返回主题列表
* 返回主题列表
*
*
...
@@ -120,7 +159,7 @@ public class ThemeManager {
...
@@ -120,7 +159,7 @@ public class ThemeManager {
// TODO:推荐
// TODO:推荐
// themeEntities = themeService.selectExcludeUser(userId, req.getLastId(), req.getPageSize());
// themeEntities = themeService.selectExcludeUser(userId, req.getLastId(), req.getPageSize());
List
<
String
>
recommendThemeIds
=
rankService
.
getHotAndNewThemes
(
100
,
100
);
List
<
String
>
recommendThemeIds
=
rankService
.
getHotAndNewThemes
(
100
,
100
);
themeEntities
=
themeService
.
queryByThemeIdsExcludeUser
(
recommendThemeIds
,
userId
,
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByThemeIdsExcludeUser
(
recommendThemeIds
,
userId
,
req
.
getLastId
(),
req
.
getPageSize
());
}
else
if
(
ThemeListTypeEnum
.
FOLLOW
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
ThemeListTypeEnum
.
FOLLOW
.
getCode
().
equals
(
req
.
getType
()))
{
//根据关注列表查询
//根据关注列表查询
...
@@ -168,7 +207,7 @@ public class ThemeManager {
...
@@ -168,7 +207,7 @@ public class ThemeManager {
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
replyThemeIds
));
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
replyThemeIds
));
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
//组装附件
//组装附件
product
Service
.
getAttachDetailByBatch
(
themeQos
);
batchFeignCall
Service
.
getAttachDetailByBatch
(
themeQos
);
//主题列表
//主题列表
Map
<
String
,
ThemeQo
>
themeMap
=
themeQos
.
stream
()
Map
<
String
,
ThemeQo
>
themeMap
=
themeQos
.
stream
()
.
collect
(
Collectors
.
toMap
(
ThemeQo:
:
getThemeId
,
o
->
o
));
.
collect
(
Collectors
.
toMap
(
ThemeQo:
:
getThemeId
,
o
->
o
));
...
@@ -198,11 +237,11 @@ public class ThemeManager {
...
@@ -198,11 +237,11 @@ public class ThemeManager {
}
}
return
commentThemeList
;
return
commentThemeList
;
case
3
:
//点赞
case
3
:
//点赞
Set
<
String
>
likeThemeIds
=
collectionService
.
getListByUser
(
userId
,
CollectionTypeEnum
.
LIKE_THEME
);
Set
<
String
>
likeThemeIds
=
collectionService
.
getListByUser
(
req
.
getLastId
()
,
CollectionTypeEnum
.
LIKE_THEME
);
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
likeThemeIds
),
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
likeThemeIds
),
req
.
getLastId
(),
req
.
getPageSize
());
break
;
break
;
case
4
:
//收藏
case
4
:
//收藏
Set
<
String
>
collectThemeIds
=
collectionService
.
getListByUser
(
userId
,
CollectionTypeEnum
.
COLLECT_THEME
);
Set
<
String
>
collectThemeIds
=
collectionService
.
getListByUser
(
req
.
getLastId
()
,
CollectionTypeEnum
.
COLLECT_THEME
);
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
collectThemeIds
),
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByThemeIds
(
new
ArrayList
<>(
collectThemeIds
),
req
.
getLastId
(),
req
.
getPageSize
());
break
;
break
;
}
}
...
@@ -212,14 +251,13 @@ public class ThemeManager {
...
@@ -212,14 +251,13 @@ public class ThemeManager {
//查询正文
//查询正文
// @CacheGet(prefix = "getThemeDetail", expireSeconds = 600)
public
ThemeQo
getDetail
(
String
themeId
,
String
userId
)
{
public
ThemeQo
getDetail
(
String
themeId
,
String
userId
)
{
ThemeEntity
themeEntity
=
themeService
.
queryByThemeId
(
themeId
);
ThemeEntity
themeEntity
=
themeService
.
queryByThemeId
(
themeId
);
if
(
themeEntity
==
null
)
{
if
(
themeEntity
==
null
)
{
throw
new
BizException
(
"找不到帖子id:"
+
themeId
);
throw
new
BizException
(
"找不到帖子id:"
+
themeId
);
}
}
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
product
Service
.
getAttachDetail
(
themeQo
);
batchFeignCall
Service
.
getAttachDetail
(
themeQo
);
buildThemeQoExtraInfo
(
userId
,
themeQo
);
buildThemeQoExtraInfo
(
userId
,
themeQo
);
return
themeQo
;
return
themeQo
;
}
}
...
@@ -300,7 +338,7 @@ public class ThemeManager {
...
@@ -300,7 +338,7 @@ public class ThemeManager {
//Entity转Qo
//Entity转Qo
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
List
<
ThemeQo
>
themeQos
=
ConvertUtil
.
themeEntitiesToDTOs
(
themeEntities
);
//批量查询附件detail
//批量查询附件detail
product
Service
.
getAttachDetailByBatch
(
themeQos
);
batchFeignCall
Service
.
getAttachDetailByBatch
(
themeQos
);
//其他信息
//其他信息
for
(
ThemeQo
themeQO
:
themeQos
)
{
for
(
ThemeQo
themeQO
:
themeQos
)
{
buildThemeQoExtraInfo
(
userId
,
themeQO
);
buildThemeQoExtraInfo
(
userId
,
themeQO
);
...
@@ -350,7 +388,7 @@ public class ThemeManager {
...
@@ -350,7 +388,7 @@ public class ThemeManager {
if
(
formerTheme
!=
null
)
{
if
(
formerTheme
!=
null
)
{
//单个查询详情
//单个查询详情
product
Service
.
getAttachDetail
(
formerTheme
);
batchFeignCall
Service
.
getAttachDetail
(
formerTheme
);
FormerThemeQo
f
=
ConvertUtil
.
themeQo2FormerThemeQo
(
formerTheme
);
FormerThemeQo
f
=
ConvertUtil
.
themeQo2FormerThemeQo
(
formerTheme
);
themeQo
.
setFormerTheme
(
f
);
themeQo
.
setFormerTheme
(
f
);
}
}
...
@@ -376,4 +414,20 @@ public class ThemeManager {
...
@@ -376,4 +414,20 @@ public class ThemeManager {
}
}
private
void
checkContent
(
String
content
)
{
// 腾讯云接口最多支持5000文字校验,超过5000执行2次
// 检查内容是否涉黄违法
CommonResp
commonResp
=
TencentcloudUtils
.
textModeration
(
content
.
length
()
>
5000
?
content
.
substring
(
0
,
5000
)
:
content
);
if
(!
commonResp
.
isSuccess
())
{
throw
new
BizException
(
"内容校验失败,请检查内容后重新发送"
);
}
if
(
content
.
length
()
>
5000
)
{
CommonResp
commonResp2
=
TencentcloudUtils
.
textModeration
(
content
.
substring
(
5000
,
content
.
length
()));
if
(!
commonResp2
.
isSuccess
())
{
throw
new
BizException
(
"内容校验失败,请检查内容后重新发送"
);
}
}
return
;
}
}
}
community-service/src/main/java/com/tanpu/community/model/ESWrapper.java
0 → 100644
View file @
1f84303a
package
com
.
tanpu
.
community
.
model
;
import
com.alibaba.fastjson.JSONArray
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
@Data
public
class
ESWrapper
<
T
>
{
@JsonProperty
(
"_index"
)
public
String
index
;
@JsonProperty
(
"_type"
)
public
String
type
;
@JsonProperty
(
"_id"
)
public
String
id
;
@JsonProperty
(
"_score"
)
public
String
score
;
@JsonProperty
(
"_source"
)
public
T
source
;
@JsonProperty
(
"sort"
)
public
JSONArray
sort
;
}
community-service/src/main/java/com/tanpu/community/service/
Product
Service.java
→
community-service/src/main/java/com/tanpu/community/service/
BatchFeignCall
Service.java
View file @
1f84303a
...
@@ -11,13 +11,13 @@ import com.tanpu.community.api.beans.qo.ThemeQo;
...
@@ -11,13 +11,13 @@ import com.tanpu.community.api.beans.qo.ThemeQo;
import
com.tanpu.community.api.beans.vo.ImagesDTO
;
import
com.tanpu.community.api.beans.vo.ImagesDTO
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
import
com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp
;
import
com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew
;
import
com.tanpu.community.api.beans.vo.feign.product.FundInfoBaseResp
;
import
com.tanpu.community.api.beans.vo.feign.product.FundInfoBaseResp
;
import
com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO
;
import
com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp
;
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.dao.entity.user.UserInfoEntity
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
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
;
...
@@ -35,7 +35,7 @@ import java.util.*;
...
@@ -35,7 +35,7 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
Product
Service
{
public
class
BatchFeignCall
Service
{
@Resource
@Resource
...
@@ -93,7 +93,7 @@ public class ProductService {
...
@@ -93,7 +93,7 @@ public class ProductService {
// 话题标题
// 话题标题
Map
<
String
,
String
>
topicMap
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
topicMap
=
Maps
.
newHashMap
();
// 图片信息
// 图片信息
Map
<
String
,
UserInfo
Entity
>
userMap
=
Maps
.
newHashMap
();
Map
<
String
,
UserInfo
New
>
userMap
=
Maps
.
newHashMap
();
// 批量查询资源信息
// 批量查询资源信息
this
.
getResInfo
(
shortVideoMap
,
curriculumMap
,
courseMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
,
userMap
,
themeQos
);
this
.
getResInfo
(
shortVideoMap
,
curriculumMap
,
courseMap
,
zhiboMap
,
fundMap
,
imgMap
,
topicMap
,
userMap
,
themeQos
);
//逐个装入
//逐个装入
...
@@ -117,7 +117,7 @@ public class ProductService {
...
@@ -117,7 +117,7 @@ public class ProductService {
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FileRecordEntity
>
imgMap
,
Map
<
String
,
FileRecordEntity
>
imgMap
,
Map
<
String
,
String
>
topicMap
,
Map
<
String
,
String
>
topicMap
,
Map
<
String
,
UserInfo
Entity
>
userMap
,
Map
<
String
,
UserInfo
New
>
userMap
,
List
<
ThemeQo
>
themeQos
List
<
ThemeQo
>
themeQos
)
{
)
{
// 白名单基金id
// 白名单基金id
...
@@ -238,12 +238,12 @@ public class ProductService {
...
@@ -238,12 +238,12 @@ public class ProductService {
}
}
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
// 查询用户信息
// 查询用户信息
List
<
UserInfoEntity
>
userInfos
=
List
<
UserInfoNew
>
queryUsersListNew
=
feignClientForFatools
.
queryUserListNew
(
setToList
(
userIds
));
userInfoService
.
queryUserByIds
(
setToList
(
userIds
));
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
userMap
.
putAll
(
userInfos
.
stream
().
collect
(
Collectors
userMap
.
putAll
(
queryUsersListNew
.
stream
().
collect
(
Collectors
.
toMap
(
UserInfo
Entity:
:
get
Id
,
o
->
o
)));
.
toMap
(
UserInfo
New:
:
getUser
Id
,
o
->
o
)));
}
}
}
}
this
.
getFundInfo
(
tanpuFundIds
,
fundIds
,
publicFundIds
,
ifaFundIds
,
notNetFundIds
,
fundMap
);
this
.
getFundInfo
(
tanpuFundIds
,
fundIds
,
publicFundIds
,
ifaFundIds
,
notNetFundIds
,
fundMap
);
}
}
...
@@ -369,16 +369,22 @@ public class ProductService {
...
@@ -369,16 +369,22 @@ public class ProductService {
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
ZhiboListResp
>
zhiboMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FundInfoBaseResp
>
fundMap
,
Map
<
String
,
FileRecordEntity
>
imgUrlMap
,
Map
<
String
,
FileRecordEntity
>
imgUrlMap
,
Map
<
String
,
UserInfo
Entity
>
userMap
,
Map
<
String
,
UserInfo
New
>
userMap
,
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
()));
}
}
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getAuthorId
())
&&
userMap
.
containsKey
(
themeQo
.
getAuthorId
()))
{
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getAuthorId
())
&&
userMap
.
containsKey
(
themeQo
.
getAuthorId
()))
{
themeQo
.
setNickName
(
userMap
.
get
(
themeQo
.
getAuthorId
()).
getUiUsernameMp
());
UserInfoNew
userInfo
=
userMap
.
get
(
themeQo
.
getAuthorId
());
themeQo
.
setUserImg
(
userMap
.
get
(
themeQo
.
getAuthorId
()).
getUiHeadimgMp
());
themeQo
.
setNickName
(
userInfo
.
getNickName
());
themeQo
.
setUserIntroduction
(
userMap
.
get
(
themeQo
.
getAuthorId
()).
getUiIntroductionMp
());
themeQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
themeQo
.
setUserIntroduction
(
userInfo
.
getIntroduction
());
themeQo
.
setUserType
(
userInfo
.
getUserType
());
themeQo
.
setLevelGrade
(
userInfo
.
getLevelGrade
());
themeQo
.
setUserInvestorType
(
userInfo
.
getUserInvestorType
());
themeQo
.
setBelongUserOrgId
(
userInfo
.
getBelongUserOrgId
());
themeQo
.
setBelongUserOrgName
(
userInfo
.
getBelongUserOrgName
());
}
}
if
(
themeQo
.
getContent
()
==
null
)
{
if
(
themeQo
.
getContent
()
==
null
)
{
continue
;
continue
;
...
...
community-service/src/main/java/com/tanpu/community/service/base/ESHelper.java
View file @
1f84303a
...
@@ -49,7 +49,7 @@ public class ESHelper {
...
@@ -49,7 +49,7 @@ public class ESHelper {
req
.
source
(
json
,
XContentType
.
JSON
);
req
.
source
(
json
,
XContentType
.
JSON
);
IndexResponse
resp
=
client
.
index
(
req
,
RequestOptions
.
DEFAULT
);
IndexResponse
resp
=
client
.
index
(
req
,
RequestOptions
.
DEFAULT
);
validStatus
(
resp
.
status
(),
RestStatus
.
CREATED
);
validStatus
(
resp
.
status
(),
RestStatus
.
CREATED
,
RestStatus
.
OK
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"ES Helper error:{}"
,
ExceptionUtils
.
getStackTrace
(
e
));
log
.
error
(
"ES Helper error:{}"
,
ExceptionUtils
.
getStackTrace
(
e
));
}
}
...
@@ -64,7 +64,7 @@ public class ESHelper {
...
@@ -64,7 +64,7 @@ public class ESHelper {
req
.
source
(
data
);
req
.
source
(
data
);
IndexResponse
resp
=
client
.
index
(
req
,
RequestOptions
.
DEFAULT
);
IndexResponse
resp
=
client
.
index
(
req
,
RequestOptions
.
DEFAULT
);
validStatus
(
resp
.
status
(),
RestStatus
.
CREATED
);
validStatus
(
resp
.
status
(),
RestStatus
.
OK
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"ES Helper error:{}"
,
ExceptionUtils
.
getStackTrace
(
e
));
log
.
error
(
"ES Helper error:{}"
,
ExceptionUtils
.
getStackTrace
(
e
));
}
}
...
@@ -86,11 +86,12 @@ public class ESHelper {
...
@@ -86,11 +86,12 @@ public class ESHelper {
}
}
private
void
validStatus
(
RestStatus
status
,
RestStatus
expect
)
{
private
void
validStatus
(
RestStatus
status
,
RestStatus
...
expect
)
{
if
(
status
!=
expect
)
{
for
(
RestStatus
ex
:
expect
)
{
log
.
error
(
"ES Helper fail! status:{}"
,
status
.
toString
());
if
(
ex
==
status
)
return
;
throw
new
RuntimeException
(
"ES fail"
);
}
}
log
.
error
(
"ES Helper fail! status:{}"
,
status
.
toString
());
throw
new
RuntimeException
(
"ES fail"
);
}
}
...
@@ -111,11 +112,14 @@ public class ESHelper {
...
@@ -111,11 +112,14 @@ public class ESHelper {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
"1"
,
"2"
));
RestClientBuilder
builder
=
RestClient
.
builder
(
new
HttpHost
(
"42.194.224.208"
,
9200
))
RestClientBuilder
builder
=
RestClient
.
builder
(
new
HttpHost
(
"42.194.224.208"
,
9200
))
.
setHttpClientConfigCallback
(
new
RestClientBuilder
.
HttpClientConfigCallback
()
{
.
setHttpClientConfigCallback
(
new
RestClientBuilder
.
HttpClientConfigCallback
()
{
@Override
@Override
public
HttpAsyncClientBuilder
customizeHttpClient
(
HttpAsyncClientBuilder
httpClientBuilder
)
{
public
HttpAsyncClientBuilder
customizeHttpClient
(
HttpAsyncClientBuilder
httpClientBuilder
)
{
return
httpClientBuilder
;
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
)
;
}
}
});
});
...
@@ -128,29 +132,30 @@ public class ESHelper {
...
@@ -128,29 +132,30 @@ public class ESHelper {
System
.
out
.
println
(
"insert"
);
System
.
out
.
println
(
"insert"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"
小行星2
"
);
map
.
put
(
"name"
,
"
太阳44444444444444
"
);
map
.
put
(
"context"
,
"这里有一个小
行星2
"
);
map
.
put
(
"context"
,
"这里有一个小
太阳444444444
"
);
// helper.insert("test_index", "2", map);
// helper.insert("test_index", "
", "
2", map);
SearchSourceBuilder
search
=
new
SearchSourceBuilder
();
SearchSourceBuilder
search
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolQb
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolQb
=
QueryBuilders
.
boolQuery
();
MatchQueryBuilder
matchQb
=
QueryBuilders
.
matchQuery
(
"
context"
,
"
星"
);
MatchQueryBuilder
matchQb
=
QueryBuilders
.
matchQuery
(
"
textContent"
,
"小星
星"
);
boolQb
.
must
(
matchQb
);
boolQb
.
must
(
matchQb
);
String
[]
includes
=
new
String
[]{
"id"
};
//
String[] includes = new String[]{"id"};
String
[]
excludes
=
new
String
[]{};
//
String[] excludes = new String[]{};
search
.
query
(
boolQb
).
f
etchSource
(
includes
,
excludes
).
f
rom
(
0
).
size
(
50
);
search
.
query
(
boolQb
).
from
(
0
).
size
(
50
);
SearchHit
[]
hits
=
helper
.
selectLike
(
"t
est_index
"
,
search
);
SearchHit
[]
hits
=
helper
.
selectLike
(
"t
heme
"
,
search
);
System
.
out
.
println
(
hits
.
length
);
System
.
out
.
println
(
hits
.
length
);
for
(
SearchHit
hit
:
hits
)
{
for
(
SearchHit
hit
:
hits
)
{
System
.
out
.
println
(
hit
.
toString
());
System
.
out
.
println
(
hit
.
toString
());
System
.
out
.
println
(
hit
.
getFields
());
System
.
out
.
println
(
hit
.
getFields
());
}
}
System
.
out
.
println
(
"done"
);
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/base/ESService.java
View file @
1f84303a
package
com
.
tanpu
.
community
.
service
.
base
;
package
com
.
tanpu
.
community
.
service
.
base
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.qo.ESThemeQo
;
import
com.tanpu.community.api.beans.qo.ESThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.model.ESWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.MatchQueryBuilder
;
import
org.elasticsearch.index.query.MatchQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
@@ -18,6 +22,7 @@ import java.util.Arrays;
...
@@ -18,6 +22,7 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@Service
public
class
ESService
{
public
class
ESService
{
...
@@ -26,7 +31,13 @@ public class ESService {
...
@@ -26,7 +31,13 @@ public class ESService {
private
static
final
String
INDEX_THEME
=
"theme"
;
private
static
final
String
INDEX_THEME
=
"theme"
;
public
void
insertTheme
(
ESThemeQo
qo
)
{
public
void
insertOrUpdateThemes
(
List
<
ESThemeQo
>
qos
)
{
for
(
ESThemeQo
qo
:
qos
)
{
insertOrUpdateTheme
(
qo
);
}
}
// 只要设置了_id,则直接覆盖
public
void
insertOrUpdateTheme
(
ESThemeQo
qo
)
{
helper
.
insert
(
INDEX_THEME
,
String
.
valueOf
(
qo
.
themeType
),
qo
.
themeId
,
JSON
.
toJSONString
(
qo
));
helper
.
insert
(
INDEX_THEME
,
String
.
valueOf
(
qo
.
themeType
),
qo
.
themeId
,
JSON
.
toJSONString
(
qo
));
}
}
...
@@ -34,7 +45,7 @@ public class ESService {
...
@@ -34,7 +45,7 @@ public class ESService {
SearchSourceBuilder
search
=
new
SearchSourceBuilder
();
SearchSourceBuilder
search
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolQb
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolQb
=
QueryBuilders
.
boolQuery
();
MatchQueryBuilder
contentQb
=
QueryBuilders
.
matchQuery
(
"
c
ontent"
,
keyword
);
MatchQueryBuilder
contentQb
=
QueryBuilders
.
matchQuery
(
"
textC
ontent"
,
keyword
);
MatchQueryBuilder
titleQb
=
QueryBuilders
.
matchQuery
(
"title"
,
keyword
);
MatchQueryBuilder
titleQb
=
QueryBuilders
.
matchQuery
(
"title"
,
keyword
);
boolQb
.
should
(
contentQb
);
boolQb
.
should
(
contentQb
);
boolQb
.
should
(
titleQb
);
boolQb
.
should
(
titleQb
);
...
@@ -42,10 +53,11 @@ public class ESService {
...
@@ -42,10 +53,11 @@ public class ESService {
String
[]
includes
=
new
String
[]{
"id"
,
"themeId"
,
"createTime"
};
String
[]
includes
=
new
String
[]{
"id"
,
"themeId"
,
"createTime"
};
String
[]
excludes
=
new
String
[]{};
String
[]
excludes
=
new
String
[]{};
search
.
query
(
boolQb
).
fetchSource
(
includes
,
excludes
).
sort
(
"createTime"
,
SortOrder
.
DESC
).
from
(
from
).
size
(
size
);
search
.
query
(
boolQb
).
fetchSource
(
includes
,
excludes
).
sort
(
"createTime"
,
SortOrder
.
DESC
).
from
(
from
).
size
(
size
);
search
.
query
(
boolQb
).
sort
(
"createTime"
,
SortOrder
.
DESC
).
from
(
from
).
size
(
size
);
SearchHit
[]
hits
=
helper
.
selectLike
(
INDEX_THEME
,
search
);
SearchHit
[]
hits
=
helper
.
selectLike
(
INDEX_THEME
,
search
);
return
Arrays
.
stream
(
hits
).
map
(
h
->
{
return
Arrays
.
stream
(
hits
).
map
(
h
->
{
return
J
SON
.
parseObject
(
h
.
to
String
(),
ESThemeQo
.
class
);
return
J
sonUtil
.
toBean
(
h
.
getSourceAs
String
(),
ESThemeQo
.
class
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
}
}
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
1f84303a
...
@@ -16,6 +16,9 @@ import com.tanpu.community.dao.entity.user.UserInfoEntity;
...
@@ -16,6 +16,9 @@ import com.tanpu.community.dao.entity.user.UserInfoEntity;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.temporal.TemporalField
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -57,6 +60,33 @@ public class ConvertUtil {
...
@@ -57,6 +60,33 @@ public class ConvertUtil {
return
themeEntities
.
stream
().
map
(
ConvertUtil:
:
themeEntityToQo
).
collect
(
Collectors
.
toList
());
return
themeEntities
.
stream
().
map
(
ConvertUtil:
:
themeEntityToQo
).
collect
(
Collectors
.
toList
());
}
}
public
static
ESThemeQo
convert
(
ThemeEntity
entity
)
{
ESThemeQo
qo
=
new
ESThemeQo
();
BeanUtils
.
copyProperties
(
entity
,
qo
);
// 抽取文本内容
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
entity
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{});
StringBuilder
sb
=
new
StringBuilder
();
themeContentQos
.
stream
().
filter
(
q
->
{
// todo enum
return
q
.
getType
().
equals
(
"108"
);
}).
forEach
(
q
->
{
sb
.
append
(
q
.
getValue
());
});
qo
.
textContent
=
sb
.
toString
();
Long
now
=
LocalDateTime
.
now
().
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
();
if
(
entity
.
getCreateTime
()
==
null
)
{
qo
.
setCreateTime
(
now
);
qo
.
setUpdateTime
(
now
);
}
else
{
qo
.
setCreateTime
(
entity
.
getCreateTime
().
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
qo
.
setUpdateTime
(
now
);
}
return
qo
;
}
public
static
TopicDTO
topicEntityToDTO
(
TopicEntity
topicEntity
)
{
public
static
TopicDTO
topicEntityToDTO
(
TopicEntity
topicEntity
)
{
TopicDTO
topicDTO
=
new
TopicDTO
();
TopicDTO
topicDTO
=
new
TopicDTO
();
...
...
community-service/src/main/java/com/tanpu/community/util/TencentcloudUtils.java
0 → 100644
View file @
1f84303a
package
com
.
tanpu
.
community
.
util
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.constant.ErrorCodeConstant
;
import
com.tencentcloudapi.cms.v20190321.CmsClient
;
import
com.tencentcloudapi.cms.v20190321.models.ImageModerationRequest
;
import
com.tencentcloudapi.cms.v20190321.models.ImageModerationResponse
;
import
com.tencentcloudapi.common.Credential
;
import
com.tencentcloudapi.common.exception.TencentCloudSDKException
;
import
com.tencentcloudapi.tms.v20200713.TmsClient
;
import
com.tencentcloudapi.tms.v20200713.models.TextModerationRequest
;
import
com.tencentcloudapi.tms.v20200713.models.TextModerationResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Arrays
;
import
java.util.Base64
;
/**
* 腾讯云工具类
*/
@Slf4j
@Configuration
public
class
TencentcloudUtils
{
/**
* 腾讯云的SecretId
*/
private
static
String
secretId
;
/**
* 腾讯云的SecretKey
*/
private
static
String
secretKey
;
/**
* 腾讯云地区
*/
private
static
String
region
;
private
static
TmsClient
tmsClient
;
private
static
CmsClient
cmsClient
;
@Value
(
"${tencent.cloud.secretId}"
)
public
void
setSecretId
(
String
secretId
)
{
TencentcloudUtils
.
secretId
=
secretId
;
}
@Value
(
"${tencent.cloud.secretKey}"
)
public
void
setSecretKey
(
String
secretKey
)
{
TencentcloudUtils
.
secretKey
=
secretKey
;
}
@Value
(
"${tencent.cloud.region}"
)
public
void
setRegion
(
String
region
)
{
TencentcloudUtils
.
region
=
region
;
}
public
static
TmsClient
getTmsClient
()
{
if
(
tmsClient
==
null
)
{
tmsClient
=
new
TmsClient
(
new
Credential
(
secretId
,
secretKey
),
region
);
}
return
tmsClient
;
}
public
static
CmsClient
getCmsClient
()
{
if
(
cmsClient
==
null
)
{
cmsClient
=
new
CmsClient
(
new
Credential
(
secretId
,
secretKey
),
region
);
}
return
cmsClient
;
}
/**
* 文本内容安全
*
* @param text
* @return
*/
public
static
CommonResp
textModeration
(
String
text
)
{
TextModerationRequest
req
=
new
TextModerationRequest
();
req
.
setContent
(
Base64
.
getEncoder
().
encodeToString
(
text
.
getBytes
(
StandardCharsets
.
UTF_8
)));
TextModerationResponse
res
=
null
;
try
{
res
=
getTmsClient
().
TextModeration
(
req
);
// suggestion Block 不通过
if
(
res
.
getSuggestion
().
equals
(
"Block"
))
{
// TODO: 2021/7/20
return
CommonResp
.
error
();
// return CommonResp.error(CommonResp.CONTENT_ILLEGAL, getTextLabel(res.getLabel(), res.getKeywords()));
}
}
catch
(
TencentCloudSDKException
e
)
{
log
.
error
(
"调用腾文本内容安全异常"
);
e
.
printStackTrace
();
return
CommonResp
.
failed
(
"文本检查异常"
);
}
return
CommonResp
.
success
();
}
/**
* 图片内容检测
*
* @param imageUrl
* @return
*/
public
static
CommonResp
imageModeration
(
String
imageUrl
)
{
ImageModerationRequest
req
=
new
ImageModerationRequest
();
req
.
setFileUrl
(
imageUrl
);
ImageModerationResponse
res
=
null
;
try
{
res
=
getCmsClient
().
ImageModeration
(
req
);
if
(
res
.
getData
()
!=
null
&&
res
.
getData
().
getEvilType
()
!=
100
)
{
return
CommonResp
.
error
(
ErrorCodeConstant
.
CONTENT_ILLEGAL
,
getImageLabel
(
res
.
getData
().
getEvilType
()));
}
}
catch
(
TencentCloudSDKException
e
)
{
log
.
error
(
"调用腾讯图片内容检测异常"
);
e
.
printStackTrace
();
return
CommonResp
.
failed
(
"图片检查异常"
);
}
return
CommonResp
.
success
();
}
public
static
void
main
(
String
[]
args
)
{
final
Base64
.
Encoder
encoder
=
Base64
.
getEncoder
();
Credential
cred
=
new
Credential
(
"AKIDTjjV2IhK4ZKBm8z5g14vPedNSJuFnTIq"
,
"PaVBZfeQwDVXKr7TZOzM6c9VZNwGJGyA"
);
TmsClient
client
=
new
TmsClient
(
cred
,
"ap-shanghai"
);
CmsClient
cmsClient
=
new
CmsClient
(
cred
,
"ap-shanghai"
);
TextModerationRequest
req
=
new
TextModerationRequest
();
req
.
setContent
(
encoder
.
encodeToString
(
"卖毒品"
.
getBytes
(
StandardCharsets
.
UTF_8
)));
ImageModerationRequest
imgReq
=
new
ImageModerationRequest
();
imgReq
.
setFileUrl
(
"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.08lr.cn%2Fuploads%2Fallimg%2F170513%2F1-1F513164126.jpg&refer=http%3A%2F%2Fwww.08lr.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617540249&t=2506e9bd61a31ea3bf89d07f4fe49744"
);
try
{
TextModerationResponse
res
=
client
.
TextModeration
(
req
);
ImageModerationResponse
imgRes
=
cmsClient
.
ImageModeration
(
imgReq
);
System
.
out
.
println
(
Arrays
.
toString
(
res
.
getKeywords
()));
System
.
out
.
println
(
imgRes
.
getData
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
static
String
getTextLabel
(
String
label
,
String
[]
keywords
)
{
StringBuilder
message
=
new
StringBuilder
(
"该内容包含"
);
if
(
label
.
equals
(
"Porn"
))
{
message
.
append
(
"色情"
);
}
else
if
(
label
.
equals
(
"Abuse"
))
{
message
.
append
(
"谩骂"
);
}
else
if
(
label
.
equals
(
"Ad"
))
{
message
.
append
(
"广告"
);
}
else
if
(
label
.
equals
(
"Polity"
))
{
message
.
append
(
"政治"
);
}
else
if
(
label
.
equals
(
"Illegal"
))
{
message
.
append
(
"违法"
);
}
message
.
append
(
"等敏感词"
);
if
(
keywords
!=
null
&&
keywords
.
length
>
0
)
{
message
.
append
(
" "
);
message
.
append
(
Arrays
.
toString
(
keywords
));
}
return
message
.
toString
();
}
public
static
String
getImageLabel
(
Long
label
)
{
StringBuilder
message
=
new
StringBuilder
(
"该图片可能包含"
);
if
(
label
.
equals
(
20002
))
{
message
.
append
(
"色情"
);
}
else
if
(
label
.
equals
(
20007
))
{
message
.
append
(
"谩骂"
);
}
else
if
(
label
.
equals
(
20001
)
||
label
.
equals
(
24001
))
{
message
.
append
(
"政治"
);
}
else
if
(
label
.
equals
(
20006
))
{
message
.
append
(
"违法"
);
}
else
if
(
label
.
equals
(
20103
))
{
message
.
append
(
"性感"
);
}
message
.
append
(
"敏感内容"
);
return
message
.
toString
();
}
}
community-service/src/main/resources/application-dev.yml
View file @
1f84303a
apollo.bootstrap.enabled
:
false
apollo.bootstrap.enabled
:
false
#app.id: tanpu-community
#app.id: tanpu-community
...
@@ -97,4 +96,10 @@ es:
...
@@ -97,4 +96,10 @@ es:
host
:
42.194.224.208
host
:
42.194.224.208
port
:
9200
port
:
9200
userName
:
1
userName
:
1
userPasswd
:
2
userPasswd
:
2
\ No newline at end of file
tencent
:
cloud
:
secretId
:
AKIDTjjV2IhK4ZKBm8z5g14vPedNSJuFnTIq
secretKey
:
PaVBZfeQwDVXKr7TZOzM6c9VZNwGJGyA
region
:
ap-shanghai
\ No newline at end of file
community-service/src/main/resources/mapper/user/UserInfoEntityMapper.xml
View file @
1f84303a
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.user.UserInfoEntity"
>
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.user.UserInfoEntity"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"user_type"
property=
"userType"
/>
<result
column=
"ui_openid"
property=
"uiOpenid"
/>
<result
column=
"ui_openid"
property=
"uiOpenid"
/>
<result
column=
"ui_unionId"
property=
"uiUnionid"
/>
<result
column=
"ui_unionId"
property=
"uiUnionid"
/>
<result
column=
"ui_telphone"
property=
"uiTelphone"
/>
<result
column=
"ui_telphone"
property=
"uiTelphone"
/>
...
...
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