Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-web
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
cloud-web
Commits
c8d25733
Commit
c8d25733
authored
Feb 17, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收藏
parent
3ef6b13a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
cloud-web-student/src/main/java/com/yizhi/application/caseLibrary/controller/StudyCaseController.java
+39
-3
cloud-web-student/src/main/java/com/yizhi/application/protal/controller/PortalApiController.java
+2
-3
No files found.
cloud-web-student/src/main/java/com/yizhi/application/caseLibrary/controller/StudyCaseController.java
View file @
c8d25733
...
...
@@ -7,21 +7,24 @@ import com.yizhi.library.application.feign.StudyCaseClient;
import
com.yizhi.library.application.param.InformParam
;
import
com.yizhi.library.application.vo.CommentReplyVO
;
import
com.yizhi.library.application.vo.CommentVO
;
import
com.yizhi.library.application.vo.FavoriteVO
;
import
com.yizhi.site.application.feign.InformationManageFeignClients
;
import
com.yizhi.site.application.feign.InformationStudentFeignClients
;
import
com.yizhi.site.application.feign.api.EventTrackApiClients
;
import
com.yizhi.site.application.vo.domain.InformationVo
;
import
com.yizhi.site.application.vo.site.IdOneVO
;
import
com.yizhi.site.application.vo.site.InformationViewVO
;
import
com.yizhi.util.application.domain.Response
;
import
com.yizhi.util.application.enums.i18n.Constants
;
import
io.swagger.annotations.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author Ding
...
...
@@ -43,6 +46,8 @@ public class StudyCaseController {
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
InformationStudentFeignClients
informationStudentFeignClients
;
@Autowired
private
InformationManageFeignClients
informationManageFeignClients
;
@ApiOperation
(
value
=
"学习案例点赞"
,
notes
=
"学习案例点赞"
)
@GetMapping
(
"/admire"
)
...
...
@@ -53,6 +58,7 @@ public class StudyCaseController {
RequestContext
context
=
ContextHolder
.
get
();
IdOneVO
idOneVO
=
new
IdOneVO
();
idOneVO
.
setId
(
studentCaseId
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
...
...
@@ -79,6 +85,7 @@ public class StudyCaseController {
RequestContext
context
=
ContextHolder
.
get
();
IdOneVO
idOneVO
=
new
IdOneVO
();
idOneVO
.
setId
(
studentCaseId
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
return
Response
.
ok
();
}
else
{
...
...
@@ -101,6 +108,7 @@ public class StudyCaseController {
RequestContext
context
=
ContextHolder
.
get
();
IdOneVO
idOneVO
=
new
IdOneVO
();
idOneVO
.
setId
(
studentCaseId
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
...
...
@@ -193,6 +201,7 @@ public class StudyCaseController {
RequestContext
context
=
ContextHolder
.
get
();
IdOneVO
idOneVO
=
new
IdOneVO
();
idOneVO
.
setId
(
commentId
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
...
...
@@ -263,4 +272,31 @@ public class StudyCaseController {
}
}
@ApiOperation
(
value
=
"微信端获取我的收藏列表"
,
notes
=
"微信端获取我的收藏列表"
,
response
=
FavoriteVO
.
class
)
@GetMapping
(
"/getFavorites"
)
public
Response
<
Page
<
FavoriteVO
>
>
getFavorites
(
@ApiParam
(
value
=
"当前第几页"
,
required
=
true
)
@RequestParam
(
name
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@ApiParam
(
value
=
"每页显示条数"
,
required
=
true
)
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
Integer
pageSize
)
{
try
{
Page
<
FavoriteVO
>
favoriteVOPage
=
studyCaseClient
.
getFavoriteList
(
pageNo
,
pageSize
);
if
(
favoriteVOPage
!=
null
&&
CollectionUtils
.
isNotEmpty
(
favoriteVOPage
.
getRecords
())){
List
<
Long
>
bizIds
=
favoriteVOPage
.
getRecords
().
stream
().
map
(
FavoriteVO:
:
getFavoriteId
).
collect
(
Collectors
.
toList
());
List
<
InformationVo
>
informationVoList
=
informationManageFeignClients
.
listbyIds
(
bizIds
);
if
(
CollectionUtils
.
isNotEmpty
(
informationVoList
)){
favoriteVOPage
.
getRecords
().
stream
().
forEach
(
vo
->{
Optional
<
InformationVo
>
optional
=
informationVoList
.
stream
().
filter
(
i
->
Objects
.
equals
(
i
.
getId
(),
vo
.
getFavoriteId
())).
findFirst
();
if
(
optional
!=
null
&&
optional
.
isPresent
()){
InformationVo
informationVo
=
optional
.
get
();
vo
.
setStudentCaseTittle
(
informationVo
.
getFileName
());
}
});
}
}
return
Response
.
ok
(
favoriteVOPage
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"############案例库服务调用出现异常"
,
e
);
return
Response
.
fail
(
Constants
.
MSG_BIZ_FAIL
);
}
}
}
cloud-web-student/src/main/java/com/yizhi/application/protal/controller/PortalApiController.java
View file @
c8d25733
...
...
@@ -278,8 +278,7 @@ public class PortalApiController {
@ApiOperation
(
value
=
"首页历史接口"
,
notes
=
"首页历史接口"
,
response
=
PortalHomeSearchOtherVO
.
class
)
@GetMapping
(
"/home/other/history"
)
public
Response
<
PortalHomeSearchOtherVO
>
listHomeHistory
(
@ApiParam
(
name
=
"searchName"
,
required
=
true
)
String
searchName
)
{
public
Response
<
PortalHomeSearchOtherVO
>
listHomeHistory
()
{
try
{
PortalHomeSearchOtherVO
vo
=
new
PortalHomeSearchOtherVO
();
List
<
EventTrackVo
>
eventTrackVoList
=
eventTrackApiClients
.
queryListByType
(
6
,
ContextHolder
.
get
().
getAccountId
());
...
...
@@ -290,7 +289,7 @@ public class PortalApiController {
e
.
setRemark1
(
DateUtil
.
format
(
e
.
getCreateTime
(),
"yyyy-MM-dd"
));
});
List
<
String
>
dateList
=
eventTrackVoList
.
stream
().
map
(
EventTrackVo:
:
getRemark1
).
collect
(
Collectors
.
toList
());
List
<
String
>
dateList
=
eventTrackVoList
.
stream
().
map
(
EventTrackVo:
:
getRemark1
).
distinct
().
collect
(
Collectors
.
toList
());
dateList
.
stream
().
forEach
(
d
->{
ClassificationVO
classificationVO
=
new
ClassificationVO
();
List
<
Long
>
idList
=
eventTrackVoList
.
stream
().
filter
(
e
->
Objects
.
equals
(
e
.
getRemark1
(),
d
)).
map
(
EventTrackVo:
:
getBusinessId
).
distinct
().
collect
(
Collectors
.
toList
());
...
...
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