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
7df9158d
Commit
7df9158d
authored
Oct 28, 2021
by
胡定国
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改首页推荐列表
parent
1987a22a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
81 deletions
+27
-81
HotRecommendDetailResp.java
...anpu/community/api/beans/resp/HotRecommendDetailResp.java
+0
-34
HotRecommendResp.java
.../com/tanpu/community/api/beans/resp/HotRecommendResp.java
+3
-2
HotRecommendController.java
...om/tanpu/community/controller/HotRecommendController.java
+2
-4
HotRecommendService.java
...java/com/tanpu/community/service/HotRecommendService.java
+22
-41
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/resp/HotRecommendDetailResp.java
deleted
100644 → 0
View file @
1987a22a
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
value
=
"热门推荐详情列表"
)
public
class
HotRecommendDetailResp
{
@ApiModelProperty
(
value
=
"type为1: 首席理顾id type为2:机构id type为3:用户id"
)
private
String
relId
;
@ApiModelProperty
(
value
=
"1:首席理顾 2:认证机构 3:指定用户"
)
private
Integer
type
;
@ApiModelProperty
(
"名称"
)
private
String
name
;
@ApiModelProperty
(
"头像"
)
private
String
headimg
;
@ApiModelProperty
(
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
"认证名称"
)
private
String
certName
;
}
community-api/src/main/java/com/tanpu/community/api/beans/resp/HotRecommendResp.java
View file @
7df9158d
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -22,6 +23,6 @@ public class HotRecommendResp {
...
@@ -22,6 +23,6 @@ public class HotRecommendResp {
@ApiModelProperty
(
"热门推荐"
)
@ApiModelProperty
(
"热门推荐"
)
private
String
hotRecommendId
;
private
String
hotRecommendId
;
@ApiModelProperty
(
"
头像
"
)
@ApiModelProperty
(
"
用户信息
"
)
private
List
<
String
>
headimg
;
private
List
<
FollowQo
>
userInfo
;
}
}
community-service/src/main/java/com/tanpu/community/controller/HotRecommendController.java
View file @
7df9158d
package
com
.
tanpu
.
community
.
controller
;
package
com
.
tanpu
.
community
.
controller
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.qo.feign.fatools.UserInfoCorpReq
;
import
com.tanpu.community.api.beans.qo.feign.fatools.UserInfoCorpReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
import
com.tanpu.community.api.beans.resp.HotRecommendDetailResp
;
import
com.tanpu.community.api.beans.resp.HotRecommendResp
;
import
com.tanpu.community.api.beans.resp.HotRecommendResp
;
import
com.tanpu.community.service.HotRecommendService
;
import
com.tanpu.community.service.HotRecommendService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -35,7 +33,7 @@ public class HotRecommendController {
...
@@ -35,7 +33,7 @@ public class HotRecommendController {
@PostMapping
(
value
=
"/hotRecommend/list"
)
@PostMapping
(
value
=
"/hotRecommend/list"
)
@ApiOperation
(
"首页热门推荐详情列表v2.2.10"
)
@ApiOperation
(
"首页热门推荐详情列表v2.2.10"
)
public
CommonResp
<
Page
<
HotRecommendDetailResp
>>
hotRecommendList
(
@RequestBody
UserInfoCorpReq
req
)
{
public
CommonResp
<
Page
<
FollowQo
>>
hotRecommendList
(
@RequestBody
UserInfoCorpReq
req
)
{
return
CommonResp
.
success
(
hotRecommendService
.
hotRecommendDetailList
(
req
));
return
CommonResp
.
success
(
hotRecommendService
.
hotRecommendDetailList
(
req
));
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/HotRecommendService.java
View file @
7df9158d
...
@@ -5,11 +5,11 @@ import com.github.pagehelper.PageHelper;
...
@@ -5,11 +5,11 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.qo.feign.fatools.UserInfoCorpReq
;
import
com.tanpu.community.api.beans.qo.feign.fatools.UserInfoCorpReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
com.tanpu.community.api.beans.resp.HomeSettingsResp
;
import
com.tanpu.community.api.beans.resp.HomeSettingsResp
;
import
com.tanpu.community.api.beans.resp.HotRecommendDetailResp
;
import
com.tanpu.community.api.beans.resp.HotRecommendResp
;
import
com.tanpu.community.api.beans.resp.HotRecommendResp
;
import
com.tanpu.community.api.beans.resp.SysConstantResp
;
import
com.tanpu.community.api.beans.resp.SysConstantResp
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoChiefInvAdvResp
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoChiefInvAdvResp
;
...
@@ -21,8 +21,8 @@ import com.tanpu.community.dao.entity.community.HotRecommendUser;
...
@@ -21,8 +21,8 @@ import com.tanpu.community.dao.entity.community.HotRecommendUser;
import
com.tanpu.community.dao.mapper.community.HotRecommendMapper
;
import
com.tanpu.community.dao.mapper.community.HotRecommendMapper
;
import
com.tanpu.community.dao.mapper.community.HotRecommendUserMapper
;
import
com.tanpu.community.dao.mapper.community.HotRecommendUserMapper
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -57,33 +57,33 @@ public class HotRecommendService {
...
@@ -57,33 +57,33 @@ public class HotRecommendService {
.
orderByDesc
(
HotRecommend:
:
getCreateTime
);
.
orderByDesc
(
HotRecommend:
:
getCreateTime
);
List
<
HotRecommend
>
hotRecommends
=
hotRecommendMapper
.
selectList
(
queryWrapper
);
List
<
HotRecommend
>
hotRecommends
=
hotRecommendMapper
.
selectList
(
queryWrapper
);
return
hotRecommends
.
stream
().
map
(
item
->
{
return
hotRecommends
.
stream
().
map
(
item
->
{
List
<
HotRecommendDetailResp
>
list
=
Lists
.
newArrayList
();
List
<
FollowQo
>
list
=
Lists
.
newArrayList
();
if
(
item
.
getType
()
==
1
)
{
if
(
item
.
getType
()
==
1
)
{
list
=
this
.
getChiefInvAdv
(
UserInfoCorpReq
.
builder
()
list
=
this
.
getChiefInvAdv
(
UserInfoCorpReq
.
builder
()
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
page
(
new
Pageable
(
1
,
10
)).
build
()).
getContent
();
.
page
(
new
Pageable
(
1
,
4
)).
build
()).
getContent
();
}
else
if
(
item
.
getType
()
==
2
)
{
}
else
if
(
item
.
getType
()
==
2
)
{
list
=
this
.
getCorpInfo
(
UserInfoCorpReq
.
builder
()
list
=
this
.
getCorpInfo
(
UserInfoCorpReq
.
builder
()
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
page
(
new
Pageable
(
1
,
10
)).
build
()).
getContent
();
.
page
(
new
Pageable
(
1
,
4
)).
build
()).
getContent
();
}
else
if
(
item
.
getType
()
==
3
)
{
}
else
if
(
item
.
getType
()
==
3
)
{
list
=
this
.
getUserInfo
(
UserInfoCorpReq
.
builder
()
list
=
this
.
getUserInfo
(
UserInfoCorpReq
.
builder
()
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
page
(
new
Pageable
(
1
,
10
)).
build
()).
getContent
();
.
page
(
new
Pageable
(
1
,
4
)).
build
()).
getContent
();
}
}
return
HotRecommendResp
.
builder
()
return
HotRecommendResp
.
builder
()
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
hotRecommendId
(
item
.
getHotRecommendId
())
.
name
(
item
.
getName
())
.
name
(
item
.
getName
())
.
headimg
(
list
.
stream
().
map
(
HotRecommendDetailResp:
:
getHeadimg
).
collect
(
Collectors
.
toList
())
)
.
userInfo
(
list
)
.
build
();
.
build
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
public
Page
<
HotRecommendDetailResp
>
hotRecommendDetailList
(
UserInfoCorpReq
req
)
{
public
Page
<
FollowQo
>
hotRecommendDetailList
(
UserInfoCorpReq
req
)
{
LambdaQueryWrapper
<
HotRecommend
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HotRecommend
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
HotRecommend:
:
getHotRecommendId
,
req
.
getHotRecommendId
());
queryWrapper
.
eq
(
HotRecommend:
:
getHotRecommendId
,
req
.
getHotRecommendId
());
HotRecommend
hotRecommend
=
hotRecommendMapper
.
selectOne
(
queryWrapper
);
HotRecommend
hotRecommend
=
hotRecommendMapper
.
selectOne
(
queryWrapper
);
List
<
HotRecommendDetailResp
>
list
=
null
;
List
<
FollowQo
>
list
=
null
;
if
(
hotRecommend
.
getType
()
==
1
)
{
if
(
hotRecommend
.
getType
()
==
1
)
{
return
this
.
getChiefInvAdv
(
req
);
return
this
.
getChiefInvAdv
(
req
);
}
else
if
(
hotRecommend
.
getType
()
==
2
)
{
}
else
if
(
hotRecommend
.
getType
()
==
2
)
{
...
@@ -94,7 +94,7 @@ public class HotRecommendService {
...
@@ -94,7 +94,7 @@ public class HotRecommendService {
return
null
;
return
null
;
}
}
private
Page
<
HotRecommendDetailResp
>
getCorpInfo
(
UserInfoCorpReq
req
)
{
private
Page
<
FollowQo
>
getCorpInfo
(
UserInfoCorpReq
req
)
{
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
1
);
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
1
);
...
@@ -107,18 +107,9 @@ public class HotRecommendService {
...
@@ -107,18 +107,9 @@ public class HotRecommendService {
List
<
String
>
userIds
=
pageCommonResp
.
getData
().
getContent
().
stream
()
List
<
String
>
userIds
=
pageCommonResp
.
getData
().
getContent
().
stream
()
.
map
(
UserInfoCorpResp:
:
getApplyUserId
).
collect
(
Collectors
.
toList
());
.
map
(
UserInfoCorpResp:
:
getApplyUserId
).
collect
(
Collectors
.
toList
());
List
<
UserInfoResp
>
userInfoResps
=
this
.
feignClientForFatools
.
queryUserListNew
(
userIds
);
List
<
UserInfoResp
>
userInfoResps
=
this
.
feignClientForFatools
.
queryUserListNew
(
userIds
);
Map
<
String
,
String
>
headimgMap
=
userInfoResps
.
stream
().
collect
(
Collectors
.
toMap
(
UserInfoResp:
:
getUserId
,
UserInfoResp:
:
getHeadImageUrl
,
(
v1
,
v2
)
->
v1
));
List
<
FollowQo
>
list
=
userInfoResps
.
stream
().
map
(
item
->
{
return
ConvertUtil
.
userInfoNew2FollowQo
(
item
);
List
<
HotRecommendDetailResp
>
list
=
pageCommonResp
.
getData
().
getContent
().
stream
().
map
(
item
->
{
return
HotRecommendDetailResp
.
builder
()
.
relId
(
item
.
getCorpId
())
.
userId
(
item
.
getApplyUserId
())
.
certName
(
item
.
getCertName
())
.
type
(
2
)
.
name
(
item
.
getCorpName
())
.
headimg
(
headimgMap
.
get
(
item
.
getApplyUserId
()))
.
build
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
Page
page
=
new
Page
();
Page
page
=
new
Page
();
page
.
setPageNum
(
pageCommonResp
.
getData
().
getPageNum
());
page
.
setPageNum
(
pageCommonResp
.
getData
().
getPageNum
());
...
@@ -129,7 +120,7 @@ public class HotRecommendService {
...
@@ -129,7 +120,7 @@ public class HotRecommendService {
return
page
;
return
page
;
}
}
private
Page
<
HotRecommendDetailResp
>
getChiefInvAdv
(
UserInfoCorpReq
req
)
{
private
Page
<
FollowQo
>
getChiefInvAdv
(
UserInfoCorpReq
req
)
{
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
1
);
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
1
);
List
<
HotRecommendUser
>
hotRecommendUsers
=
this
.
hotRecommendUserMapper
.
selectList
(
queryWrapper
);
List
<
HotRecommendUser
>
hotRecommendUsers
=
this
.
hotRecommendUserMapper
.
selectList
(
queryWrapper
);
...
@@ -138,14 +129,10 @@ public class HotRecommendService {
...
@@ -138,14 +129,10 @@ public class HotRecommendService {
.
excludeIds
(
hotRecommendUsers
.
stream
().
map
(
HotRecommendUser:
:
getRelId
).
collect
(
Collectors
.
toList
()))
.
excludeIds
(
hotRecommendUsers
.
stream
().
map
(
HotRecommendUser:
:
getRelId
).
collect
(
Collectors
.
toList
()))
.
page
(
req
.
getPage
())
.
page
(
req
.
getPage
())
.
build
());
.
build
());
List
<
HotRecommendDetailResp
>
list
=
pageCommonResp
.
getData
().
getContent
().
stream
().
map
(
item
->
{
List
<
UserInfoResp
>
userInfoResps
=
this
.
feignClientForFatools
.
queryUserListNew
(
pageCommonResp
.
getData
().
getContent
().
stream
()
return
HotRecommendDetailResp
.
builder
()
.
map
(
UserInfoChiefInvAdvResp:
:
getUserId
).
collect
(
Collectors
.
toList
()));
.
relId
(
item
.
getId
()
+
""
)
List
<
FollowQo
>
list
=
userInfoResps
.
stream
().
map
(
item
->
{
.
userId
(
item
.
getUserId
())
return
ConvertUtil
.
userInfoNew2FollowQo
(
item
);
.
type
(
1
)
.
name
(
item
.
getUserName
())
.
headimg
(
item
.
getHeadImageUrl
())
.
build
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
Page
page
=
new
Page
();
Page
page
=
new
Page
();
page
.
setPageNum
(
pageCommonResp
.
getData
().
getPageNum
());
page
.
setPageNum
(
pageCommonResp
.
getData
().
getPageNum
());
...
@@ -156,7 +143,7 @@ public class HotRecommendService {
...
@@ -156,7 +143,7 @@ public class HotRecommendService {
return
page
;
return
page
;
}
}
private
Page
<
HotRecommendDetailResp
>
getUserInfo
(
UserInfoCorpReq
req
)
{
private
Page
<
FollowQo
>
getUserInfo
(
UserInfoCorpReq
req
)
{
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HotRecommendUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
0
);
queryWrapper
.
eq
(
HotRecommendUser:
:
getHotRecommendId
,
req
.
getHotRecommendId
()).
eq
(
HotRecommendUser:
:
getIsExclude
,
0
);
...
@@ -168,21 +155,15 @@ public class HotRecommendService {
...
@@ -168,21 +155,15 @@ public class HotRecommendService {
}
}
List
<
UserInfoResp
>
userInfoResps
=
this
.
feignClientForFatools
.
queryUserListNew
(
hotRecommendUsers
.
stream
()
List
<
UserInfoResp
>
userInfoResps
=
this
.
feignClientForFatools
.
queryUserListNew
(
hotRecommendUsers
.
stream
()
.
map
(
HotRecommendUser:
:
getRelId
).
collect
(
Collectors
.
toList
()));
.
map
(
HotRecommendUser:
:
getRelId
).
collect
(
Collectors
.
toList
()));
List
<
HotRecommendDetailResp
>
list
=
userInfoResps
.
stream
().
map
(
item
->
{
List
<
FollowQo
>
list
=
userInfoResps
.
stream
().
map
(
item
->
{
return
HotRecommendDetailResp
.
builder
()
return
ConvertUtil
.
userInfoNew2FollowQo
(
item
);
.
relId
(
item
.
getUserId
())
.
userId
(
item
.
getUserId
())
.
type
(
1
)
.
name
(
item
.
getNickName
())
.
headimg
(
item
.
getHeadImageUrl
())
.
certName
(
item
.
getCertPosition
())
.
build
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
new
Page
<>(
page
,
list
);
return
new
Page
<>(
page
,
list
);
}
}
/**
/**
* 获取首页配置
* 获取首页配置
*
* @return
* @return
*/
*/
public
CommonResp
<
HomeSettingsResp
>
getHomeSettings
()
{
public
CommonResp
<
HomeSettingsResp
>
getHomeSettings
()
{
...
...
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