Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1b25b560
authored
Aug 05, 2022
by
邓敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增查询全部Label + 视频
1 parent
b559abba
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
5 deletions
src/main/java/com/subsidy/controller/VodLabelDictController.java
src/main/java/com/subsidy/mapper/VodLabelDictMapper.java
src/main/java/com/subsidy/service/VodLableDictService.java → src/main/java/com/subsidy/service/VodLabelDictService.java
src/main/java/com/subsidy/service/impl/VodLabelDictServiceImpl.java
src/main/java/com/subsidy/vo/vodLabel/VodLabelTreeVO.java
src/main/resources/mapper/VodLabelDictMapper.xml
src/main/java/com/subsidy/controller/VodLabelDictController.java
View file @
1b25b56
...
...
@@ -5,7 +5,7 @@ import com.subsidy.common.ResponseVO;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.dto.label.VodLabelPageDTO
;
import
com.subsidy.model.VodLabelDictDO
;
import
com.subsidy.service.VodLab
le
DictService
;
import
com.subsidy.service.VodLab
el
DictService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -28,7 +28,7 @@ import io.swagger.annotations.Api;
public
class
VodLabelDictController
{
@Autowired
private
VodLab
le
DictService
vodLableDictService
;
private
VodLab
el
DictService
vodLableDictService
;
@PostMapping
(
value
=
"addVodLabel"
)
@ApiOperation
(
"添加视频类目: labelName/类目名称"
)
...
...
@@ -67,4 +67,11 @@ public class VodLabelDictController {
public
ResponseVO
queryVodLabel
()
{
return
ResponseData
.
generateCreatedResponse
(
0
,
vodLableDictService
.
list
());
}
@PostMapping
(
value
=
"queryVodLabelTree"
)
@ApiOperation
(
"获取目录和视频"
)
@LoginRequired
public
ResponseVO
getContentVodTree
()
{
return
ResponseData
.
generateCreatedResponse
(
0
,
vodLableDictService
.
queryVodLabelTree
());
}
}
src/main/java/com/subsidy/mapper/VodLabelDictMapper.java
View file @
1b25b56
...
...
@@ -2,8 +2,11 @@ package com.subsidy.mapper;
import
com.subsidy.model.VodLabelDictDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.subsidy.vo.vodLabel.VodLabelTreeVO
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>
* 视频库类目表 Mapper 接口
...
...
@@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
VodLabelDictMapper
extends
BaseMapper
<
VodLabelDictDO
>
{
List
<
VodLabelTreeVO
>
queryVodLabel
();
}
src/main/java/com/subsidy/service/VodLab
le
DictService.java
→
src/main/java/com/subsidy/service/VodLab
el
DictService.java
View file @
1b25b56
...
...
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.subsidy.dto.label.VodLabelPageDTO
;
import
com.subsidy.model.VodLabelDictDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.subsidy.vo.vodLabel.VodLabelTreeVO
;
import
java.util.List
;
/**
* <p>
...
...
@@ -13,7 +16,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author DengMin
* @since 2022-07-19
*/
public
interface
VodLab
le
DictService
extends
IService
<
VodLabelDictDO
>
{
public
interface
VodLab
el
DictService
extends
IService
<
VodLabelDictDO
>
{
IPage
<
VodLabelDictDO
>
queryVodLabelPage
(
VodLabelPageDTO
vodLabelPageDTO
);
List
<
VodLabelTreeVO
>
queryVodLabelTree
();
}
src/main/java/com/subsidy/service/impl/VodLabelDictServiceImpl.java
View file @
1b25b56
...
...
@@ -4,13 +4,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.subsidy.dto.label.VodLabelPageDTO
;
import
com.subsidy.mapper.VodDictMapper
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.model.VodLabelDictDO
;
import
com.subsidy.mapper.VodLabelDictMapper
;
import
com.subsidy.service.VodLab
le
DictService
;
import
com.subsidy.service.VodLab
el
DictService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.vo.vodLabel.VodLabelTreeVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>
* 视频库类目表 服务实现类
...
...
@@ -20,7 +26,10 @@ import org.springframework.stereotype.Service;
* @since 2022-07-19
*/
@Service
public
class
VodLabelDictServiceImpl
extends
ServiceImpl
<
VodLabelDictMapper
,
VodLabelDictDO
>
implements
VodLableDictService
{
public
class
VodLabelDictServiceImpl
extends
ServiceImpl
<
VodLabelDictMapper
,
VodLabelDictDO
>
implements
VodLabelDictService
{
@Autowired
private
VodDictMapper
vodDictMapper
;
@Override
public
IPage
<
VodLabelDictDO
>
queryVodLabelPage
(
VodLabelPageDTO
vodLabelPageDTO
)
{
...
...
@@ -29,4 +38,17 @@ public class VodLabelDictServiceImpl extends ServiceImpl<VodLabelDictMapper, Vod
.
lambda
().
like
(
StringUtils
.
isNotBlank
(
vodLabelPageDTO
.
getLabelName
()),
VodLabelDictDO:
:
getLabelName
,
vodLabelPageDTO
.
getLabelName
()));
}
@Override
public
List
<
VodLabelTreeVO
>
queryVodLabelTree
()
{
List
<
VodLabelTreeVO
>
list
=
this
.
baseMapper
.
queryVodLabel
();
for
(
VodLabelTreeVO
vodLabelTreeVO
:
list
)
{
List
<
VodDictDO
>
vodDictDOList
=
vodDictMapper
.
selectList
(
new
QueryWrapper
<
VodDictDO
>()
.
lambda
()
.
eq
(
VodDictDO:
:
getLabelId
,
vodLabelTreeVO
.
getId
())
.
orderByDesc
(
VodDictDO:
:
getOrderNo
));
vodLabelTreeVO
.
setVods
(
vodDictDOList
);
}
return
list
;
}
}
src/main/java/com/subsidy/vo/vodLabel/VodLabelTreeVO.java
0 → 100644
View file @
1b25b56
package
com
.
subsidy
.
vo
.
vodLabel
;
import
com.subsidy.model.VodDictDO
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
VodLabelTreeVO
{
private
Long
id
;
private
String
labelName
;
private
List
<
VodDictDO
>
vods
;
}
src/main/resources/mapper/VodLabelDictMapper.xml
View file @
1b25b56
...
...
@@ -19,4 +19,8 @@
id, label_name
</sql>
<select
id=
"queryVodLabel"
resultType=
"com.subsidy.vo.vodLabel.VodLabelTreeVO"
>
SELECT * FROM vod_label_dict WHERE delete_date IS NULL
</select>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment