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
64b2208d
Commit
64b2208d
authored
Nov 25, 2024
by
梅存智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动添加创建人和时间信息、增加枚举:培训测验
parent
66d3b9a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
cloud-web-student/src/main/java/com/yizhi/application/protal/constant/BannerNameEnum.java
+1
-1
cloud-web-student/src/main/java/com/yizhi/application/protal/controller/BannerApiController.java
+27
-2
No files found.
cloud-web-student/src/main/java/com/yizhi/application/protal/constant/BannerNameEnum.java
View file @
64b2208d
...
...
@@ -2,7 +2,7 @@ package com.yizhi.application.protal.constant;
public
enum
BannerNameEnum
{
MARKET
(
"营销"
),
TRAIN
(
"项目"
),
HOMEPAGE
(
"首页"
),
COURSE
(
"课程"
),
NEWS
(
"新闻资讯"
),
ALBUM
(
"专辑"
);
MARKET
(
"营销"
),
TRAIN
(
"项目"
),
HOMEPAGE
(
"首页"
),
COURSE
(
"课程"
),
NEWS
(
"新闻资讯"
),
ALBUM
(
"专辑"
)
,
TRAIN_EXAM
(
"培训测验"
)
;
private
String
key
;
...
...
cloud-web-student/src/main/java/com/yizhi/application/protal/controller/BannerApiController.java
View file @
64b2208d
package
com
.
yizhi
.
application
.
protal
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.yizhi.application.protal.constant.BannerNameEnum
;
...
...
@@ -9,12 +10,15 @@ import com.yizhi.core.application.context.RequestContext;
import
com.yizhi.site.application.feign.BannerManageFeignClients
;
import
com.yizhi.site.application.vo.site.AllHomeBannerImageVO
;
import
com.yizhi.site.application.vo.site.ImageListVO
;
import
com.yizhi.training.application.feign.TrainingProjectClient
;
import
com.yizhi.training.application.vo.domain.TrainingProjectVo
;
import
com.yizhi.util.application.constant.ReturnCode
;
import
com.yizhi.util.application.domain.Response
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -36,13 +40,16 @@ public class BannerApiController {
@Autowired
BannerManageFeignClients
bannerManageFeignClients
;
@Autowired
TrainingProjectClient
trainingProjectClient
;
/**
* 所有首页 轮播图
*/
@ApiOperation
(
value
=
"轮播学员端管理"
,
notes
=
"轮播学员端管理"
,
response
=
ImageListVO
.
class
)
@PostMapping
(
value
=
"/home/image/list"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bannerName"
,
value
=
"轮播图所属栏目, MARKET:营销, TRAIN:培训, HOMEPAGE:首页, COURSE:课程, NEWS:新闻资讯,ALBUM:专辑"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"bannerName"
,
value
=
"轮播图所属栏目, MARKET:营销, TRAIN:培训, HOMEPAGE:首页, COURSE:课程, NEWS:新闻资讯,ALBUM:专辑
;TRAIN_EXAM:培训测验
"
,
dataType
=
"Long"
),
@ApiImplicitParam
(
name
=
"terminalName"
,
value
=
"终端名称, PC端:PC; APP: MOBILE; 微信: WECHAT"
,
dataType
=
"Long"
)
})
public
Response
<
List
<
ImageListVO
>>
listAllHomeBannerImage
(
@RequestBody
AllHomeBannerImageVO
vo
){
...
...
@@ -68,7 +75,25 @@ public class BannerApiController {
vo
.
setTerminalName
(
terminalName
);
vo
.
setBannerName
(
bannerName
);
try
{
return
Response
.
ok
(
bannerManageFeignClients
.
listAllHomeBannerImage
(
vo
));
List
<
ImageListVO
>
result
=
null
;
if
(
vo
!=
null
&&
BannerNameEnum
.
TRAIN_EXAM
.
getKey
().
equals
(
vo
.
getBannerName
())){
List
<
TrainingProjectVo
>
list
=
trainingProjectClient
.
getTop
();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
result
=
new
ArrayList
<
ImageListVO
>(
1
);
for
(
TrainingProjectVo
item
:
list
){
ImageListVO
img
=
new
ImageListVO
();
img
.
setImgTitle
(
item
.
getName
());
img
.
setId
(
item
.
getId
());
img
.
setBannerPath
(
item
.
getLogoImg
());
img
.
setCreateByName
(
item
.
getCreateByName
());
img
.
setCreateTime
(
item
.
getCreateTime
());
result
.
add
(
img
);
}
}
}
else
{
result
=
bannerManageFeignClients
.
listAllHomeBannerImage
(
vo
);
}
return
Response
.
ok
(
result
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"所有首页 轮播图:"
+
e
);
return
Response
.
fail
(
ReturnCode
.
SERVICE_UNAVAILABLE
.
getCode
(),
ReturnCode
.
SERVICE_UNAVAILABLE
.
getMsg
());
...
...
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