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
9a615225
Commit
9a615225
authored
Mar 16, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
965e4300
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
258 additions
and
42 deletions
+258
-42
BasePageOrderParam.java
...senergy/chnmuseum/party/common/vo/BasePageOrderParam.java
+3
-0
Asset.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
+21
-12
ExhibitionBoard.java
...a/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
+29
-18
LearningContent.java
...a/cn/wisenergy/chnmuseum/party/model/LearningContent.java
+20
-10
AssetController.java
...nergy/chnmuseum/party/web/controller/AssetController.java
+183
-0
controller.java.vm
src/main/resources/templates/controller.java.vm
+2
-2
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/vo/BasePageOrderParam.java
View file @
9a615225
...
...
@@ -39,6 +39,9 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty
(
"创建人"
)
private
String
creatorName
;
@ApiModelProperty
(
"创建人"
)
private
String
copyrightOwnerId
;
public
void
defaultPageSort
(
OrderItem
orderItem
)
{
this
.
defaultPageSorts
(
Collections
.
singletonList
(
orderItem
));
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
View file @
9a615225
...
...
@@ -3,9 +3,10 @@ package cn.wisenergy.chnmuseum.party.model;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.
Data
;
import
lombok.
EqualsAndHashCode
;
import
lombok.
*
;
import
lombok.
experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
...
...
@@ -18,6 +19,10 @@ import java.time.LocalDateTime;
* @since 2021-03-16
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"asset"
)
@ApiModel
(
value
=
"Asset对象"
,
description
=
"视频"
)
...
...
@@ -25,39 +30,43 @@ public class Asset implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"视频ID"
)
@ApiModelProperty
(
"视频ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
@ApiModelProperty
(
value
=
"视频名称"
)
@ApiModelProperty
(
"视频名称"
)
@TableField
(
"name"
)
@NotBlank
(
message
=
"视频名称不能为空"
)
private
String
name
;
@ApiModelProperty
(
value
=
"视频版权方ID"
)
@ApiModelProperty
(
"视频版权方ID"
)
@TableField
(
"asset_copyright_owner_id"
)
@NotBlank
(
message
=
"视频版权方ID不能为空"
)
private
String
assetCopyrightOwnerId
;
@ApiModelProperty
(
value
=
"视频类别ID"
)
@ApiModelProperty
(
"视频类别ID"
)
@TableField
(
"asset_type_id"
)
@NotBlank
(
message
=
"视频类别ID不能为空"
)
private
String
assetTypeId
;
@ApiModelProperty
(
value
=
"视频缩略图"
)
@ApiModelProperty
(
"视频缩略图"
)
@TableField
(
"thumbnail"
)
@NotBlank
(
message
=
"视频缩略图不能为空"
)
private
String
thumbnail
;
@ApiModelProperty
(
value
=
"视频链接"
)
@ApiModelProperty
(
"视频链接"
)
@TableField
(
"video_url"
)
private
String
videoUrl
;
@ApiModelProperty
(
value
=
"审核状态"
)
@ApiModelProperty
(
"审核状态"
)
@TableField
(
"audit_status"
)
private
Integer
auditStatus
;
private
String
auditStatus
;
@ApiModelProperty
(
value
=
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"修改日期"
)
@ApiModelProperty
(
"修改日期"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
View file @
9a615225
...
...
@@ -3,9 +3,10 @@ package cn.wisenergy.chnmuseum.party.model;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.
Data
;
import
lombok.
EqualsAndHashCode
;
import
lombok.
*
;
import
lombok.
experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
...
...
@@ -18,6 +19,10 @@ import java.time.LocalDateTime;
* @since 2021-03-16
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"exhibition_board"
)
@ApiModel
(
value
=
"ExhibitionBoard对象"
,
description
=
"展板"
)
...
...
@@ -25,64 +30,70 @@ public class ExhibitionBoard implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"展板内容ID"
)
@ApiModelProperty
(
"展板内容ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
@ApiModelProperty
(
value
=
"展板分类名称"
)
@ApiModelProperty
(
"展板分类名称"
)
@TableField
(
"name"
)
@NotBlank
(
message
=
"展板分类名称不能为空"
)
private
String
name
;
@ApiModelProperty
(
value
=
"展板版权方ID"
)
@ApiModelProperty
(
"展板版权方ID"
)
@TableField
(
"board_copyright_owner_id"
)
@NotBlank
(
message
=
"展板版权方ID不能为空"
)
private
String
boardCopyrightOwnerId
;
@ApiModelProperty
(
value
=
"展板分类ID"
)
@ApiModelProperty
(
"展板分类ID"
)
@TableField
(
"exhibition_board_cat_id"
)
@NotBlank
(
message
=
"展板分类ID不能为空"
)
private
String
exhibitionBoardCatId
;
@ApiModelProperty
(
value
=
"展板图片URL"
)
@ApiModelProperty
(
"展板图片URL"
)
@TableField
(
"board_img_url"
)
@NotBlank
(
message
=
"展板图片URL不能为空"
)
private
String
boardImgUrl
;
@ApiModelProperty
(
value
=
"展板二维码URL"
)
@ApiModelProperty
(
"展板二维码URL"
)
@TableField
(
"board_qrcode_url"
)
@NotBlank
(
message
=
"展板二维码URL不能为空"
)
private
String
boardQrcodeUrl
;
@ApiModelProperty
(
value
=
"简介"
)
@ApiModelProperty
(
"简介"
)
@TableField
(
"introduction"
)
@NotBlank
(
message
=
"简介不能为空"
)
private
String
introduction
;
@ApiModelProperty
(
value
=
"视频版权方ID"
)
@ApiModelProperty
(
"视频版权方ID"
)
@TableField
(
"asset_copyright_owner_id"
)
private
String
assetCopyrightOwnerId
;
@ApiModelProperty
(
value
=
"视频类别ID"
)
@ApiModelProperty
(
"视频类别ID"
)
@TableField
(
"asset_type"
)
private
String
assetType
;
@ApiModelProperty
(
value
=
"视频ID"
)
@ApiModelProperty
(
"视频ID"
)
@TableField
(
"asset_id"
)
private
String
assetId
;
@ApiModelProperty
(
value
=
"导览音频URL"
)
@ApiModelProperty
(
"导览音频URL"
)
@TableField
(
"guide_audio_url"
)
private
String
guideAudioUrl
;
@ApiModelProperty
(
value
=
"参考资料"
)
@ApiModelProperty
(
"参考资料"
)
@TableField
(
"reference_material"
)
private
String
referenceMaterial
;
@ApiModelProperty
(
value
=
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"修改日期"
)
@ApiModelProperty
(
"修改日期"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"审核状态"
)
@ApiModelProperty
(
"审核状态"
)
@TableField
(
"audit_status"
)
private
Integer
auditStatus
;
private
String
auditStatus
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContent.java
View file @
9a615225
...
...
@@ -3,9 +3,11 @@ package cn.wisenergy.chnmuseum.party.model;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.
Data
;
import
lombok.
EqualsAndHashCode
;
import
lombok.
*
;
import
lombok.
experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
...
...
@@ -18,6 +20,10 @@ import java.time.LocalDateTime;
* @since 2021-03-16
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"learning_content"
)
@ApiModel
(
value
=
"LearningContent对象"
,
description
=
"学习内容"
)
...
...
@@ -25,31 +31,35 @@ public class LearningContent implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"学习内容ID"
)
@ApiModelProperty
(
"学习内容ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
@ApiModelProperty
(
value
=
"学习内容名称"
)
@ApiModelProperty
(
"学习内容名称"
)
@TableField
(
"name"
)
@NotBlank
(
message
=
"学习内容名称不能为空"
)
private
String
name
;
@ApiModelProperty
(
value
=
"学习内容宣传图"
)
@ApiModelProperty
(
"学习内容宣传图"
)
@TableField
(
"avartar"
)
@NotBlank
(
message
=
"学习内容宣传图不能为空"
)
private
String
avartar
;
@ApiModelProperty
(
value
=
"适用范围"
)
@ApiModelProperty
(
"适用范围"
)
@TableField
(
"applicable_scope"
)
@NotNull
(
message
=
"适用范围不能为空"
)
private
Integer
applicableScope
;
@ApiModelProperty
(
value
=
"审核状态"
)
@ApiModelProperty
(
"审核状态"
)
@TableField
(
"audit_status"
)
private
Integer
auditStatus
;
@NotBlank
(
message
=
"审核状态不能为空"
)
private
String
auditStatus
;
@ApiModelProperty
(
value
=
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新日期"
)
@ApiModelProperty
(
"更新日期"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AssetController.java
0 → 100644
View file @
9a615225
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
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.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
/**
* <pre>
* 视频 前端控制器
* </pre>
*
* @author Danny Lee
* @since 2021-03-16
*/
@Slf4j
@RestController
@RequestMapping
(
"/interface/asset"
)
@Api
(
tags
=
{
"视频操作接口"
})
public
class
AssetController
extends
BaseController
{
@Resource
private
AssetService
assetService
;
@PostMapping
(
"/batchSave"
)
@RequiresPermissions
(
"asset:batch:save"
)
@ApiOperation
(
value
=
"批量添加视频"
,
notes
=
"批量添加视频"
)
public
Map
<
String
,
Object
>
batchSaveAsset
(
@Validated
(
value
=
{
Add
.
class
})
List
<
Asset
>
assetList
)
{
// 保存业务节点信息
boolean
result
=
assetService
.
saveBatch
(
assetList
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PostMapping
(
"/save"
)
@RequiresPermissions
(
"asset:save"
)
@ApiOperation
(
value
=
"添加视频"
,
notes
=
"添加视频"
)
public
Map
<
String
,
Object
>
saveAsset
(
@Validated
(
value
=
{
Add
.
class
})
Asset
asset
)
{
// 保存业务节点信息
boolean
result
=
assetService
.
save
(
asset
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"asset:update"
)
@ApiOperation
(
value
=
"修改视频信息"
,
notes
=
"修改视频信息"
)
public
Map
<
String
,
Object
>
updateAsset
(
@Validated
Asset
asset
)
{
boolean
flag
=
assetService
.
updateById
(
asset
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"asset:update:audit:status"
)
@ApiOperation
(
value
=
"更新视频审核状态"
,
notes
=
"更新视频审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"视频ID不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
AuditStatusEnum
status
)
{
UpdateWrapper
<
Asset
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
boolean
flag
=
assetService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"asset:delete"
)
@ApiOperation
(
value
=
"根据ID删除视频"
,
notes
=
"根据ID删除视频"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteAsset
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
assetService
.
removeById
(
id
);
if
(
result
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@GetMapping
(
"/getList"
)
@RequiresPermissions
(
"asset:list"
)
@ApiOperation
(
value
=
"获取视频全部列表(无分页)"
,
notes
=
"获取视频全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getAssetList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<
Asset
>
assetList
=
assetService
.
list
(
Wrappers
.<
Asset
>
lambdaQuery
().
eq
(
Asset:
:
getAuditStatus
,
auditStatus
.
name
()));
return
getResult
(
assetList
);
}
@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
=
"copyrightOwner"
,
value
=
"版权方"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"asset:page"
)
@ApiOperation
(
value
=
"获取视频分页列表"
,
notes
=
"获取视频分页列表"
)
public
Map
<
String
,
Object
>
getAssetPageList
(
GenericPageParam
genericPageParam
)
{
LambdaQueryWrapper
<
Asset
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
Asset:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
// 对版权方模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getCopyrightOwnerId
()))
{
queryWrapper
.
like
(
Asset:
:
getAssetCopyrightOwnerId
,
genericPageParam
.
getCopyrightOwnerId
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
Asset:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
Asset:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
Asset:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
Asset:
:
getId
,
Asset:
:
getName
,
Asset:
:
getAuditStatus
,
Asset:
:
getCreateTime
,
Asset:
:
getUpdateTime
);
Page
<
Asset
>
page
=
this
.
assetService
.
page
(
getPage
(),
queryWrapper
);
for
(
Asset
asset
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取视频详情"
,
notes
=
"获取视频详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
)
})
@GetMapping
(
"/get/{id}"
)
@RequiresPermissions
(
"asset:getById"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
Asset
asset
=
assetService
.
getById
(
id
);
return
getResult
(
asset
);
}
}
src/main/resources/templates/controller.java.vm
View file @
9a615225
...
...
@@ -177,8 +177,8 @@ public class ${table.controllerName} {
queryWrapper
.
like
(${
entity
}::
getName
,
genericPageParam
.
getNameOrCode
());
}
//
对版权方模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getCopyrightOwner
()))
{
queryWrapper
.
like
(${
entity
}::
get
CopyrightOwner
,
genericPageParam
.
getCopyrightOwner
());
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getCopyrightOwner
Id
()))
{
queryWrapper
.
like
(${
entity
}::
get
AssetCopyrightOwnerId
,
genericPageParam
.
getCopyrightOwnerId
());
}
//
根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!= null && genericPageParam.getEndDate() != null) {
...
...
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