Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
3f92ab88
Commit
3f92ab88
authored
Apr 06, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
8263f466
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
1 deletion
+122
-1
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+1
-1
AssetMapper.java
...java/cn/wisenergy/chnmuseum/party/mapper/AssetMapper.java
+11
-0
Asset.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
+8
-0
AssetService.java
...va/cn/wisenergy/chnmuseum/party/service/AssetService.java
+3
-0
AssetServiceImpl.java
...energy/chnmuseum/party/service/impl/AssetServiceImpl.java
+11
-0
AssetController.java
...nergy/chnmuseum/party/web/controller/AssetController.java
+88
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
3f92ab88
...
...
@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
"
copyright_owner_video_content_ca
t"
"
asse
t"
};
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private
static
final
String
projectPath
=
"/opt/ss"
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/AssetMapper.java
View file @
3f92ab88
...
...
@@ -2,6 +2,8 @@ package cn.wisenergy.chnmuseum.party.mapper;
import
cn.wisenergy.chnmuseum.party.model.Asset
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Select
;
/**
* <p>
...
...
@@ -13,4 +15,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
AssetMapper
extends
BaseMapper
<
Asset
>
{
@Select
(
"SELECT a.*, co.`name` AS video_content_copyright_owner_name, vcc.`name` AS video_content_cat_name "
+
"FROM asset a, video_content vc, copyright_owner co, video_content_cat vcc"
+
"where a.ref_item_id = vc.id "
+
"and vc.video_content_cat_id = vcc.id "
+
"and vc.video_content_copyright_owner_id = vcc.co "
+
"<if test='videoContentCatId != null'>and vcc.id = #{videoContentCatId} </if>"
+
"<if test='videoContentCopyrightOwnerId != null'>and co.id = #{videoContentCopyrightOwnerId} </if>"
)
Page
<
Asset
>
selectPageByConditions
(
Page
<
Object
>
page
,
String
videoContentCatId
,
String
videoContentCopyrightOwnerId
);
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
View file @
3f92ab88
...
...
@@ -97,4 +97,12 @@ public class Asset implements Serializable {
@TableField
(
exist
=
false
)
private
String
exhibitionBoardCover
;
@ApiModelProperty
(
"视频类别"
)
@TableField
(
exist
=
false
)
private
String
videoContentCatName
;
@ApiModelProperty
(
"视频版权方"
)
@TableField
(
exist
=
false
)
private
String
videoContentCopyrightOwnerName
;
}
src/main/java/cn/wisenergy/chnmuseum/party/service/AssetService.java
View file @
3f92ab88
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.Asset
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
AssetService
extends
IService
<
Asset
>
{
Page
<
Asset
>
pageByConditions
(
Page
<
Object
>
page
,
String
videoContentCatId
,
String
videoContentCopyrightOwnerId
);
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AssetServiceImpl.java
View file @
3f92ab88
...
...
@@ -3,9 +3,12 @@ package cn.wisenergy.chnmuseum.party.service.impl;
import
cn.wisenergy.chnmuseum.party.mapper.AssetMapper
;
import
cn.wisenergy.chnmuseum.party.model.Asset
;
import
cn.wisenergy.chnmuseum.party.service.AssetService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* <p>
* 视频 服务实现类
...
...
@@ -17,4 +20,12 @@ import org.springframework.stereotype.Service;
@Service
public
class
AssetServiceImpl
extends
ServiceImpl
<
AssetMapper
,
Asset
>
implements
AssetService
{
@Resource
private
AssetMapper
assetMapper
;
@Override
public
Page
<
Asset
>
pageByConditions
(
Page
<
Object
>
page
,
String
videoContentCatId
,
String
videoContentCopyrightOwnerId
)
{
return
assetMapper
.
selectPageByConditions
(
page
,
videoContentCatId
,
videoContentCopyrightOwnerId
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AssetController.java
0 → 100644
View file @
3f92ab88
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.Asset
;
import
cn.wisenergy.chnmuseum.party.service.AssetService
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.Map
;
/**
* <pre>
* 文件资产 前端控制器
* </pre>
*
* @author Danny Lee
* @since 2021-04-06
*/
@Slf4j
@RestController
@RequestMapping
(
"/asset"
)
@Api
(
tags
=
{
"文件资产操作接口"
})
public
class
AssetController
extends
BaseController
{
@Resource
private
AssetService
assetService
;
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"视频文件名"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"videoContentCatId"
,
value
=
"视频内容分类ID"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"videoContentCopyrightOwnerId"
,
value
=
"视频内容版权方ID"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"asset:page"
)
@ApiOperation
(
value
=
"获取文件资产分页列表"
,
notes
=
"获取文件资产分页列表"
)
public
Map
<
String
,
Object
>
getAssetPageList
(
GenericPageParam
genericPageParam
,
@RequestParam
(
value
=
"videoContentCatId"
,
required
=
false
)
String
videoContentCatId
,
@RequestParam
(
value
=
"videoContentCopyrightOwnerId"
,
required
=
false
)
String
videoContentCopyrightOwnerId
)
{
LambdaQueryWrapper
<
Asset
>
ew
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
ew
.
like
(
Asset:
:
getFileName
,
genericPageParam
.
getNameOrCode
());
}
// 设置排序规则
ew
.
orderByDesc
(
Asset:
:
getCreateTime
);
// 设置查询内容
ew
.
select
(
Asset:
:
getId
,
Asset:
:
getFileName
,
Asset:
:
getFileExtName
,
Asset:
:
getFileCat
,
Asset:
:
getFileSize
,
Asset:
:
getFileType
,
Asset:
:
getFileUrl
,
Asset:
:
getLanguage
,
Asset:
:
getVideoContentCopyrightOwnerName
,
Asset:
:
getVideoContentCatName
,
Asset:
:
getCreateTime
,
Asset:
:
getUpdateTime
);
Page
<
Asset
>
page
=
this
.
assetService
.
pageByConditions
(
getPage
(),
videoContentCatId
,
videoContentCopyrightOwnerId
);
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取文件资产详情"
,
notes
=
"获取文件资产详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
)
})
@GetMapping
(
"/get/{id}"
)
@RequiresPermissions
(
"asset:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
Asset
asset
=
assetService
.
getById
(
id
);
return
getResult
(
asset
);
}
}
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