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
44efaff1
Commit
44efaff1
authored
Oct 18, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.2.9' into dev
parents
85751728
255883aa
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
131 additions
and
37 deletions
+131
-37
ThemeAndUserSearchResp.java
...anpu/community/api/beans/resp/ThemeAndUserSearchResp.java
+26
-0
UserSearchResp.java
...va/com/tanpu/community/api/beans/resp/UserSearchResp.java
+22
-0
SearchController.java
...java/com/tanpu/community/controller/SearchController.java
+32
-4
FeignClientForActivity.java
...anpu/community/feign/activity/FeignClientForActivity.java
+1
-2
FeignClientForCommunity.java
...pu/community/feign/community/FeignClientForCommunity.java
+1
-1
FeignClientForCourse.java
...om/tanpu/community/feign/course/FeignClientForCourse.java
+1
-1
FeignClientForDiagnose.java
...anpu/community/feign/diagnose/FeignClientForDiagnose.java
+1
-1
FeignClientForFatools.java
.../tanpu/community/feign/fatools/FeignClientForFatools.java
+6
-1
FeignbackForFatools.java
...om/tanpu/community/feign/fatools/FeignbackForFatools.java
+6
-0
FeignClientForProducts.java
...tanpu/community/feign/product/FeignClientForProducts.java
+1
-2
FeignForFund.java
.../java/com/tanpu/community/feign/product/FeignForFund.java
+1
-1
FeignForPublicFund.java
...com/tanpu/community/feign/product/FeignForPublicFund.java
+1
-1
FeignClientForTanpuroom.java
...pu/community/feign/tanpuroom/FeignClientForTanpuroom.java
+1
-1
FeignClientForZhibo.java
.../com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
+1
-3
HomePageManager.java
...ain/java/com/tanpu/community/manager/HomePageManager.java
+12
-8
application-test.yml
community-service/src/main/resources/application-test.yml
+18
-11
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/resp/ThemeAndUserSearchResp.java
0 → 100644
View file @
44efaff1
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
@Builder
@AllArgsConstructor
@ApiModel
(
value
=
"主题搜索"
)
public
class
ThemeAndUserSearchResp
{
public
List
<
ThemeQo
>
themes
;
public
List
<
FollowQo
>
users
;
public
ThemeAndUserSearchResp
()
{
this
.
themes
=
new
ArrayList
<>();
this
.
users
=
new
ArrayList
<>();
}
}
community-api/src/main/java/com/tanpu/community/api/beans/resp/UserSearchResp.java
0 → 100644
View file @
44efaff1
package
com
.
tanpu
.
community
.
api
.
beans
.
resp
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
@Builder
@AllArgsConstructor
@ApiModel
(
value
=
"主题搜索"
)
public
class
UserSearchResp
{
public
List
<
FollowQo
>
users
;
public
UserSearchResp
()
{
this
.
users
=
new
ArrayList
<>();
}
}
community-service/src/main/java/com/tanpu/community/controller/SearchController.java
View file @
44efaff1
...
...
@@ -2,16 +2,21 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.common.auth.UserInfoHelper
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.TopicDetailQo
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.req.search.ThemeFullSearchReq
;
import
com.tanpu.community.api.beans.resp.ThemeAndUserSearchResp
;
import
com.tanpu.community.api.beans.resp.ThemeFullSearchResp
;
import
com.tanpu.community.api.beans.resp.UserSearchResp
;
import
com.tanpu.community.manager.HomePageManager
;
import
com.tanpu.community.manager.ThemeManager
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
...
...
@@ -27,6 +32,9 @@ public class SearchController {
@Autowired
private
ThemeManager
themeManager
;
@Autowired
private
HomePageManager
homePageManager
;
// 内容全文搜索
@ApiOperation
(
"全文搜索主题"
)
@PostMapping
(
value
=
"/themeFullText"
)
...
...
@@ -36,4 +44,24 @@ public class SearchController {
return
CommonResp
.
success
(
resp
);
}
// 用户+内容全文搜索
@ApiOperation
(
"全文搜索主题"
)
@PostMapping
(
value
=
"/themeFullTextAndUser"
)
@ResponseBody
public
CommonResp
<
ThemeAndUserSearchResp
>
themeFullTextAndUserSearch
(
@RequestBody
ThemeFullSearchReq
req
)
{
ThemeFullSearchResp
themeFullSearch
=
themeManager
.
themeFullSearch
(
req
.
keyword
,
req
.
page
.
pageNumber
,
req
.
page
.
pageSize
,
req
.
ident
,
userHolder
.
getUserId
());
List
<
FollowQo
>
users
=
homePageManager
.
userNameSerach
(
req
.
keyword
,
1
,
2
,
req
.
ident
,
userHolder
.
getUserId
());
return
CommonResp
.
success
(
ThemeAndUserSearchResp
.
builder
().
themes
(
themeFullSearch
.
getThemes
()).
users
(
users
).
build
());
}
// 用户搜索
@ApiOperation
(
"用户姓名模糊查询"
)
@PostMapping
(
value
=
"/userNameFuzzy"
)
@ResponseBody
public
CommonResp
<
UserSearchResp
>
userNameSerach
(
@RequestBody
ThemeFullSearchReq
req
)
{
List
<
FollowQo
>
users
=
homePageManager
.
userNameSerach
(
req
.
keyword
,
req
.
page
.
pageNumber
,
req
.
page
.
pageSize
,
req
.
ident
,
userHolder
.
getUserId
());
return
CommonResp
.
success
(
UserSearchResp
.
builder
().
users
(
users
).
build
());
}
}
community-service/src/main/java/com/tanpu/community/feign/activity/FeignClientForActivity.java
View file @
44efaff1
...
...
@@ -10,8 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-jifen"
,
contextId
=
"jifen"
,
fallbackFactory
=
FeignBackClientForActivity
.
class
,
url
=
"${tanpu.jifen.svc:http://tp-jifen-svc}"
,
path
=
"/jifen"
)
// @FeignClient(value = "service-jifen", contextId = "jifen", fallbackFactory = FeignBackClientForActivity.class, url = "http://127.0.0.1:8202/community")
@FeignClient
(
value
=
"service-jifen"
,
contextId
=
"jifen"
,
url
=
"${tanpu.jifen.svc:http://tp-jifen-svc}"
,
path
=
"/jifen"
)
public
interface
FeignClientForActivity
{
...
...
community-service/src/main/java/com/tanpu/community/feign/community/FeignClientForCommunity.java
View file @
44efaff1
...
...
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@FeignClient
(
value
=
"service-community"
,
contextId
=
"community"
,
fallbackFactory
=
FeignBackClientForCommunity
.
class
,
url
=
"http://tp-tamp-community-svc
"
,
path
=
"/community"
)
@FeignClient
(
value
=
"service-community"
,
url
=
"${tanpu.community.svc:}
"
,
path
=
"/community"
)
// @FeignClient(value = "service-community", contextId = "community", fallbackFactory = FeignBackClientForCommunity.class, url = "http://127.0.0.1:8202/community")
public
interface
FeignClientForCommunity
{
...
...
community-service/src/main/java/com/tanpu/community/feign/course/FeignClientForCourse.java
View file @
44efaff1
...
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-course"
,
contextId
=
"course"
,
fallbackFactory
=
FeignBackClientForCourse
.
class
,
url
=
"http://tp-course-svc
"
,
path
=
"/course"
)
@FeignClient
(
value
=
"service-course"
,
contextId
=
"course"
,
url
=
"${tanpu.course.svc:}
"
,
path
=
"/course"
)
//@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForCourse.class, url = "http://172.20.1.249:8060/course")
public
interface
FeignClientForCourse
{
...
...
community-service/src/main/java/com/tanpu/community/feign/diagnose/FeignClientForDiagnose.java
View file @
44efaff1
...
...
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-diagnose"
,
contextId
=
"diagnose"
,
fallbackFactory
=
FeignBackClientForDiagnose
.
class
,
url
=
"http://tp-diagnose-svc
"
,
path
=
"/diagnose"
)
@FeignClient
(
value
=
"service-diagnose"
,
url
=
"${tanpu.diagnose.svc:}
"
,
path
=
"/diagnose"
)
//@FeignClient(value = "service-diagnose", contextId = "diagnose", fallbackFactory = FeignBackClientForDiagnose.class, path = "http://172.20.1.249:8201/diagnose")
public
interface
FeignClientForDiagnose
{
...
...
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignClientForFatools.java
View file @
44efaff1
...
...
@@ -19,7 +19,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
@FeignClient
(
value
=
"fatools"
,
contextId
=
"fatools"
,
fallbackFactory
=
FeignbackForFatools
.
class
,
url
=
"${tanpu.fatools.svc:http://tp-fatools-svc
}"
,
path
=
"/fatools"
)
@FeignClient
(
value
=
"fatools"
,
contextId
=
"fatools"
,
url
=
"${tanpu.fatools.svc:
}"
,
path
=
"/fatools"
)
//@FeignClient(value = "fatools", contextId = "fatoolsUser", fallbackFactory = FeignbackForFatools.class, path = "/fatools")
public
interface
FeignClientForFatools
{
...
...
@@ -56,4 +56,9 @@ public interface FeignClientForFatools {
@GetMapping
(
value
=
"/queryChiefFinancialAdviserList"
)
CommonResp
<
Page
<
UserInfoNewChief
>>
queryChiefFinancialAdviserList
(
@RequestParam
(
"pageNumber"
)
Integer
pageNumber
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
);
@ApiOperation
(
value
=
"根据昵称模糊查询目标用户"
)
@GetMapping
(
value
=
"/queryByUserNameMp"
)
List
<
UserInfoResp
>
queryByUserNameMp
(
@RequestParam
(
"keyword"
)
String
keyword
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageNumber"
)
Integer
pageNumber
);
}
community-service/src/main/java/com/tanpu/community/feign/fatools/FeignbackForFatools.java
View file @
44efaff1
...
...
@@ -71,6 +71,12 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
log
.
info
(
"FeignbackForFatools.queryChiefFinancialAdviserList"
,
throwable
);
return
CommonResp
.
error
();
}
@Override
public
List
<
UserInfoResp
>
queryByUserNameMp
(
String
keyword
,
Integer
pageSize
,
Integer
pageNumber
)
{
log
.
info
(
"FeignbackForFatools.queryByUserNameMp"
,
throwable
);
return
null
;
}
};
}
...
...
community-service/src/main/java/com/tanpu/community/feign/product/FeignClientForProducts.java
View file @
44efaff1
...
...
@@ -3,7 +3,6 @@ package com.tanpu.community.feign.product;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.fund.FundCompanySimpleVO
;
import
com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO
;
import
com.tanpu.community.feign.fatools.FeignbackForFatools
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -12,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-product"
,
contextId
=
"product"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://tp-product-svc
"
,
path
=
"/product"
)
@FeignClient
(
value
=
"service-product"
,
url
=
"${tanpu.product.svc:}
"
,
path
=
"/product"
)
//@FeignClient(value = "service-product", contextId = "product", fallbackFactory = FeignBackClientForProducts.class, url = "http://172.20.0.68:8194/product")
public
interface
FeignClientForProducts
{
...
...
community-service/src/main/java/com/tanpu/community/feign/product/FeignForFund.java
View file @
44efaff1
...
...
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
//@FeignClient(value = "service-fund", url = "http://127.0.0.1:8194/fund")
@FeignClient
(
value
=
"service-fund"
,
contextId
=
"fund"
,
fallbackFactory
=
FeignbackForFund
.
class
,
url
=
"http://tp-fund-svc
"
,
path
=
"/fund"
)
@FeignClient
(
value
=
"service-fund"
,
url
=
"${tanpu.fund.svc:}
"
,
path
=
"/fund"
)
//@FeignClient(value = "service-fund", path = "/fund")
public
interface
FeignForFund
{
...
...
community-service/src/main/java/com/tanpu/community/feign/product/FeignForPublicFund.java
View file @
44efaff1
...
...
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-fundpublic"
,
contextId
=
"fundpublic"
,
fallbackFactory
=
FeignbackForPublicFund
.
class
,
url
=
"http://tp-fundpublic-svc
"
,
path
=
"/fundpublic"
)
@FeignClient
(
value
=
"service-fundpublic"
,
contextId
=
"fundpublic"
,
url
=
"${tanpu.fundpublic.svc:}
"
,
path
=
"/fundpublic"
)
//@FeignClient(value = "service-fundpublic",path = "/fundpublic")
public
interface
FeignForPublicFund
{
...
...
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignClientForTanpuroom.java
View file @
44efaff1
...
...
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
@FeignClient
(
value
=
"service-tanpuroom"
,
contextId
=
"tanpuroom"
,
fallbackFactory
=
FeignBackClientForTanpuroom
.
class
,
url
=
"http://tp-tanpuroom-svc
"
,
path
=
"/tanpuroom"
)
@FeignClient
(
value
=
"service-tanpuroom"
,
url
=
"${tanpu.tanpuroom.svc:}
"
,
path
=
"/tanpuroom"
)
//@FeignClient(value = "service-tanpuroom", contextId = "tanpuroom", fallbackFactory = FeignBackClientForTanpuroom.class, url = "http://172.20.0.183:8086/tanpuroom")
public
interface
FeignClientForTanpuroom
{
...
...
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
View file @
44efaff1
...
...
@@ -3,7 +3,6 @@ package com.tanpu.community.feign.zhibo;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboDetailVO
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp
;
import
com.tanpu.community.feign.tanpuroom.FeignBackClientForTanpuroom
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -14,8 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
java.util.List
;
//@FeignClient(value = "service-zhibo", url = "${tanpu.feo-zhibo.svc:}", fallbackFactory = FeignbackForZhibo.class, path = "/zhibo")
@FeignClient
(
value
=
"service-zhibo"
,
contextId
=
"zhibo"
,
fallbackFactory
=
FeignbackForZhibo
.
class
,
url
=
"http://tp-zhibo-svc"
,
path
=
"/zhibo"
)
@FeignClient
(
value
=
"service-zhibo"
,
url
=
"${tanpu.feo-zhibo.svc:}"
,
path
=
"/zhibo"
)
//@FeignClient(value = "service-zhibo", fallbackFactory = FeignbackForZhibo.class, url = "http://172.20.0.169:8183/zhibo")
public
interface
FeignClientForZhibo
{
...
...
community-service/src/main/java/com/tanpu/community/manager/HomePageManager.java
View file @
44efaff1
...
...
@@ -48,14 +48,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -301,4 +294,15 @@ public class HomePageManager {
return
userInfoNewCommonResp
.
getData
();
}
public
List
<
FollowQo
>
userNameSerach
(
String
keyword
,
Integer
pageNumber
,
Integer
pageSize
,
String
ident
,
String
userId
)
{
if
(
StringUtils
.
isBlank
(
keyword
)){
return
Collections
.
emptyList
();
}
List
<
UserInfoResp
>
userInfoResps
=
feignClientForFatools
.
queryByUserNameMp
(
keyword
,
pageSize
,
pageNumber
);
List
<
FollowQo
>
followQos
=
userInfoResps
.
stream
().
map
(
ConvertUtil:
:
userInfoNew2FollowQo
).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isNotEmpty
(
userId
))
{
judgeFollowed
(
followQos
,
userId
);
}
return
followQos
;
}
}
community-service/src/main/resources/application-test.yml
View file @
44efaff1
apollo.bootstrap.enabled
:
tru
e
apollo.bootstrap.enabled
:
fals
e
#app.id: tanpu-community
#apollo:
...
...
@@ -15,15 +15,7 @@ server:
spring.datasource
:
community
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
jdbc-url
:
jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
username
:
tamp_admin
password
:
'
@imeng123'
maxActive
:
2
minIdle
:
2
initialSize
:
2
user
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
jdbc-url
:
jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_user?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
jdbc-url
:
jdbc:mysql://rm-uf6r22t3d798q4kmk.mysql.rds.aliyuncs.com:3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
username
:
tamp_admin
password
:
'
@imeng123'
maxActive
:
2
...
...
@@ -103,7 +95,22 @@ tmpfile:
tanpu
:
fatools
:
svc
:
127.0.0.1:8189
product
:
svc
:
https://testtamper.tanpuyun.com
jifen
:
svc
:
https://testtamper.tanpuyun.com
fund
:
svc
:
https://testtamper.tanpuyun.com
course
:
svc
:
https://testtamper.tanpuyun.com
community
:
svc
:
https://testtamper.tanpuyun.com
order
:
svc
:
https://testtamper.tanpuyun.com
tanpuroom
:
svc
:
https://testtamper.tanpuyun.com
zhibo
:
svc
:
https://testtamper.tanpuyun.com
diagnose
:
svc
:
https://testtamper.tanpuyun.com
\ No newline at end of file
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