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
730274bc
Commit
730274bc
authored
Mar 26, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
b916bbef
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
466 additions
and
128 deletions
+466
-128
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+6
-8
LearningProjectMapper.java
...senergy/chnmuseum/party/mapper/LearningProjectMapper.java
+16
-0
LearningContent.java
...a/cn/wisenergy/chnmuseum/party/model/LearningContent.java
+7
-4
LearningContentBoard.java
...wisenergy/chnmuseum/party/model/LearningContentBoard.java
+10
-7
LearningContentBoardCat.java
...energy/chnmuseum/party/model/LearningContentBoardCat.java
+2
-2
LearningContentCopyrightOwner.java
.../chnmuseum/party/model/LearningContentCopyrightOwner.java
+10
-7
LearningProject.java
...a/cn/wisenergy/chnmuseum/party/model/LearningProject.java
+11
-8
LearningProjectService.java
...nergy/chnmuseum/party/service/LearningProjectService.java
+16
-0
LearningProjectServiceImpl.java
...museum/party/service/impl/LearningProjectServiceImpl.java
+26
-0
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+1
-1
LearningContentBoardCatController.java
...rty/web/controller/LearningContentBoardCatController.java
+0
-22
LearningContentBoardController.java
.../party/web/controller/LearningContentBoardController.java
+0
-22
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+165
-8
LearningContentCopyrightOwnerController.java
...b/controller/LearningContentCopyrightOwnerController.java
+0
-22
LearningProjectController.java
...useum/party/web/controller/LearningProjectController.java
+178
-0
LearningContentBoardCatMapper.xml
src/main/resources/mapper/LearningContentBoardCatMapper.xml
+4
-4
LearningContentMapper.xml
src/main/resources/mapper/LearningContentMapper.xml
+14
-13
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
730274bc
...
@@ -3,15 +3,13 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
...
@@ -3,15 +3,13 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
private
static
final
String
[]
tableNames
=
new
String
[]{
"asset"
,
"learning_content"
,
"asset_type"
,
"learning_content_board"
,
"copyright_owner"
,
"learning_content_board_cat"
,
"copyright_owner_asset_type"
,
"learning_content_copyright_owner"
,
"copyright_owner_board_type"
,
"learning_project"
"exhibition_board"
,
"exhibition_board_cat"
};
};
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private
static
final
String
projectPath
=
"/opt/ss"
;
private
static
final
String
projectPath
=
"/opt/ss"
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/LearningProjectMapper.java
0 → 100644
View file @
730274bc
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.wisenergy.chnmuseum.party.model.LearningProject
;
/**
* <pre>
* Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-03-26
*/
public
interface
LearningProjectMapper
extends
BaseMapper
<
LearningProject
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContent.java
View file @
730274bc
...
@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
...
@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-2
3
* @since 2021-03-2
6
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -35,7 +35,7 @@ public class LearningContent implements Serializable {
...
@@ -35,7 +35,7 @@ public class LearningContent implements Serializable {
@ApiModelProperty
(
"学习内容ID"
)
@ApiModelProperty
(
"学习内容ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"学习内容ID
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"学习内容ID不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"学习内容名称"
)
@ApiModelProperty
(
"学习内容名称"
)
...
@@ -64,11 +64,14 @@ public class LearningContent implements Serializable {
...
@@ -64,11 +64,14 @@ public class LearningContent implements Serializable {
@ApiModelProperty
(
"是否上架"
)
@ApiModelProperty
(
"是否上架"
)
@TableField
(
"is_published"
)
@TableField
(
"is_published"
)
private
Boolean
published
;
private
Boolean
isPublished
;
@ApiModelProperty
(
"是否已删除"
)
@TableField
(
"is_deleted"
)
private
Boolean
isDeleted
;
@ApiModelProperty
(
"排序顺序"
)
@ApiModelProperty
(
"排序顺序"
)
@TableField
(
"sortorder"
)
@TableField
(
"sortorder"
)
@NotNull
(
message
=
"排序顺序不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
Integer
sortorder
;
private
Integer
sortorder
;
@ApiModelProperty
(
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContentBoard.java
View file @
730274bc
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-2
3
* @since 2021-03-2
6
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -36,7 +36,7 @@ public class LearningContentBoard implements Serializable {
...
@@ -36,7 +36,7 @@ public class LearningContentBoard implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"学习内容ID"
)
@ApiModelProperty
(
"学习内容ID"
)
...
@@ -49,4 +49,7 @@ public class LearningContentBoard implements Serializable {
...
@@ -49,4 +49,7 @@ public class LearningContentBoard implements Serializable {
@NotBlank
(
message
=
"展板ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"展板ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
exhibitionBoardId
;
private
String
exhibitionBoardId
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContentBoardCat.java
View file @
730274bc
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-2
3
* @since 2021-03-2
6
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -36,7 +36,7 @@ public class LearningContentBoardCat implements Serializable {
...
@@ -36,7 +36,7 @@ public class LearningContentBoardCat implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"学习内容ID"
)
@ApiModelProperty
(
"学习内容ID"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningContentCopyrightOwner.java
View file @
730274bc
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-2
3
* @since 2021-03-2
6
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -36,7 +36,7 @@ public class LearningContentCopyrightOwner implements Serializable {
...
@@ -36,7 +36,7 @@ public class LearningContentCopyrightOwner implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"学习内容ID"
)
@ApiModelProperty
(
"学习内容ID"
)
...
@@ -49,4 +49,7 @@ public class LearningContentCopyrightOwner implements Serializable {
...
@@ -49,4 +49,7 @@ public class LearningContentCopyrightOwner implements Serializable {
@NotBlank
(
message
=
"版权方ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"版权方ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
copyrightOwnerId
;
private
String
copyrightOwnerId
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/LearningProject.java
View file @
730274bc
...
@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
...
@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-2
3
* @since 2021-03-2
6
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -35,7 +35,7 @@ public class LearningProject implements Serializable {
...
@@ -35,7 +35,7 @@ public class LearningProject implements Serializable {
@ApiModelProperty
(
"学习项目ID"
)
@ApiModelProperty
(
"学习项目ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"学习项目ID
ID
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"学习项目ID不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"学习项目名称"
)
@ApiModelProperty
(
"学习项目名称"
)
...
@@ -55,4 +55,7 @@ public class LearningProject implements Serializable {
...
@@ -55,4 +55,7 @@ public class LearningProject implements Serializable {
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/LearningProjectService.java
0 → 100644
View file @
730274bc
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.LearningProject
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-03-26
*/
public
interface
LearningProjectService
extends
IService
<
LearningProject
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/LearningProjectServiceImpl.java
0 → 100644
View file @
730274bc
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.mapper.LearningProjectMapper
;
import
cn.wisenergy.chnmuseum.party.model.LearningProject
;
import
cn.wisenergy.chnmuseum.party.service.LearningProjectService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* <pre>
* 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-03-26
*/
@Slf4j
@Service
public
class
LearningProjectServiceImpl
extends
ServiceImpl
<
LearningProjectMapper
,
LearningProject
>
implements
LearningProjectService
{
@Autowired
private
LearningProjectMapper
learningProjectMapper
;
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
730274bc
...
@@ -210,7 +210,7 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -210,7 +210,7 @@ public class CopyrightOwnerController extends BaseController {
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
CopyrightOwner
copyrightOwner
=
copyrightOwnerService
.
getById
(
id
);
CopyrightOwner
copyrightOwner
=
copyrightOwnerService
.
getById
(
id
);
String
ownerType
=
copyrightOwner
.
getOwnerType
();
String
ownerType
=
copyrightOwner
.
getOwnerType
();
if
(
CopyrightOwnerTypeEnum
.
ASSET
.
name
.
equals
(
ownerType
))
{
if
(
CopyrightOwnerTypeEnum
.
ASSET
.
name
()
.
equals
(
ownerType
))
{
LambdaQueryWrapper
<
CopyrightOwnerAssetType
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
id
);
LambdaQueryWrapper
<
CopyrightOwnerAssetType
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
id
);
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetTypeService
.
list
(
lambdaQueryWrapper
);
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetTypeService
.
list
(
lambdaQueryWrapper
);
if
(!
copyrightOwnerAssetTypeList
.
isEmpty
())
{
if
(!
copyrightOwnerAssetTypeList
.
isEmpty
())
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentBoardCatController.java
deleted
100644 → 0
View file @
b916bbef
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
/**
* <p>
* 学习内容展板分类 前端控制器
* </p>
*
* @author Danny Lee
* @since 2021-03-16
*/
@RestController
@RequestMapping
(
"/party/learning-content-board-cat"
)
public
class
LearningContentBoardCatController
extends
BaseController
{
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentBoardController.java
deleted
100644 → 0
View file @
b916bbef
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
/**
* <p>
* 学习内容展板 前端控制器
* </p>
*
* @author Danny Lee
* @since 2021-03-16
*/
@RestController
@RequestMapping
(
"/party/learning-content-board"
)
public
class
LearningContentBoardController
extends
BaseController
{
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentController.java
View file @
730274bc
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.LearningContent
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentService
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
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
;
/**
/**
* <p>
* <p
re
>
* 学习内容 前端控制器
* 学习内容 前端控制器
* </p>
* </p
re
>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-
1
6
* @since 2021-03-
2
6
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/party/learning-content"
)
@RequestMapping
(
"/learningContent"
)
@Api
(
tags
=
{
"学习内容操作接口"
})
public
class
LearningContentController
extends
BaseController
{
public
class
LearningContentController
extends
BaseController
{
@Resource
private
LearningContentService
learningContentService
;
@PostMapping
(
"/batchSave"
)
@RequiresPermissions
(
"learning:content:batch:save"
)
@ApiOperation
(
value
=
"批量添加学习内容"
,
notes
=
"批量添加学习内容"
)
public
Map
<
String
,
Object
>
batchSaveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
List
<
LearningContent
>
learningContentList
)
{
// 保存业务节点信息
boolean
result
=
learningContentService
.
saveBatch
(
learningContentList
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PostMapping
(
"/save"
)
@RequiresPermissions
(
"learning:content:save"
)
@ApiOperation
(
value
=
"添加学习内容"
,
notes
=
"添加学习内容"
)
public
Map
<
String
,
Object
>
saveLearningContent
(
@Validated
(
value
=
{
Add
.
class
})
LearningContent
learningContent
)
{
// 保存业务节点信息
boolean
result
=
learningContentService
.
save
(
learningContent
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"learning:content:update"
)
@ApiOperation
(
value
=
"修改学习内容信息"
,
notes
=
"修改学习内容信息"
)
public
Map
<
String
,
Object
>
updateLearningContent
(
@Validated
(
value
=
{
Update
.
class
})
LearningContent
learningContent
)
{
boolean
flag
=
learningContentService
.
updateById
(
learningContent
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"learning:content: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
<
LearningContent
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
boolean
flag
=
learningContentService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"learning:content:delete"
)
@ApiOperation
(
value
=
"根据ID删除学习内容"
,
notes
=
"根据ID删除学习内容"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteLearningContent
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
learningContentService
.
removeById
(
id
);
if
(
result
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@GetMapping
(
"/getList"
)
@RequiresPermissions
(
"learning:content:list"
)
@ApiOperation
(
value
=
"获取学习内容全部列表(无分页)"
,
notes
=
"获取学习内容全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getLearningContentList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<
LearningContent
>
learningContentList
=
learningContentService
.
list
(
Wrappers
.<
LearningContent
>
lambdaQuery
().
eq
(
LearningContent:
:
getAuditStatus
,
auditStatus
.
name
()));
return
getResult
(
learningContentList
);
}
@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
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"learning:content:page"
)
@ApiOperation
(
value
=
"获取学习内容分页列表"
,
notes
=
"获取学习内容分页列表"
)
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
)
{
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
LearningContent:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
LearningContent:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
LearningContent:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
LearningContent:
:
getId
,
LearningContent:
:
getName
,
LearningContent:
:
getAuditStatus
,
LearningContent:
:
getCreateTime
,
LearningContent:
:
getUpdateTime
);
Page
<
LearningContent
>
page
=
this
.
learningContentService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningContent
learningContent
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取学习内容详情"
,
notes
=
"获取学习内容详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
)
})
@GetMapping
(
"/get/{id}"
)
@RequiresPermissions
(
"learning:content:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
LearningContent
learningContent
=
learningContentService
.
getById
(
id
);
return
getResult
(
learningContent
);
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentCopyrightOwnerController.java
deleted
100644 → 0
View file @
b916bbef
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
/**
* <p>
* 学习内容版权方 前端控制器
* </p>
*
* @author Danny Lee
* @since 2021-03-16
*/
@RestController
@RequestMapping
(
"/party/learning-content-copyright-owner"
)
public
class
LearningContentCopyrightOwnerController
extends
BaseController
{
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningProjectController.java
0 → 100644
View file @
730274bc
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.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.LearningProject
;
import
cn.wisenergy.chnmuseum.party.service.LearningProjectService
;
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.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-26
*/
@Slf4j
@RestController
@RequestMapping
(
"/learningProject"
)
@Api
(
tags
=
{
"学习项目操作接口"
})
public
class
LearningProjectController
extends
BaseController
{
@Resource
private
LearningProjectService
learningProjectService
;
@PostMapping
(
"/batchSave"
)
@RequiresPermissions
(
"learning:project:batch:save"
)
@ApiOperation
(
value
=
"批量添加"
,
notes
=
"批量添加"
)
public
Map
<
String
,
Object
>
batchSaveLearningProject
(
@Validated
(
value
=
{
Add
.
class
})
List
<
LearningProject
>
learningProjectList
)
{
// 保存业务节点信息
boolean
result
=
learningProjectService
.
saveBatch
(
learningProjectList
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PostMapping
(
"/save"
)
@RequiresPermissions
(
"learning:project:save"
)
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
public
Map
<
String
,
Object
>
saveLearningProject
(
@Validated
(
value
=
{
Add
.
class
})
LearningProject
learningProject
)
{
// 保存业务节点信息
boolean
result
=
learningProjectService
.
save
(
learningProject
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"learning:project:update"
)
@ApiOperation
(
value
=
"修改信息"
,
notes
=
"修改信息"
)
public
Map
<
String
,
Object
>
updateLearningProject
(
@Validated
(
value
=
{
Update
.
class
})
LearningProject
learningProject
)
{
boolean
flag
=
learningProjectService
.
updateById
(
learningProject
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PutMapping
(
"/updateAuditStatus/{id}"
)
@RequiresPermissions
(
"learning:project: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
<
LearningProject
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
boolean
flag
=
learningProjectService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"learning:project:delete"
)
@ApiOperation
(
value
=
"根据ID删除"
,
notes
=
"根据ID删除"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteLearningProject
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
learningProjectService
.
removeById
(
id
);
if
(
result
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@GetMapping
(
"/getList"
)
@RequiresPermissions
(
"learning:project:list"
)
@ApiOperation
(
value
=
"获取全部列表(无分页)"
,
notes
=
"获取全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getLearningProjectList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<
LearningProject
>
learningProjectList
=
learningProjectService
.
list
();
return
getResult
(
learningProjectList
);
}
@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
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"learning:project:page"
)
@ApiOperation
(
value
=
"获取分页列表"
,
notes
=
"获取分页列表"
)
public
Map
<
String
,
Object
>
getLearningProjectPageList
(
GenericPageParam
genericPageParam
)
{
LambdaQueryWrapper
<
LearningProject
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
LearningProject:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
LearningProject:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
LearningProject:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
LearningProject:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
LearningProject:
:
getId
,
LearningProject:
:
getName
,
LearningProject:
:
getRemarks
,
LearningProject:
:
getCreateTime
,
LearningProject:
:
getUpdateTime
);
Page
<
LearningProject
>
page
=
this
.
learningProjectService
.
page
(
getPage
(),
queryWrapper
);
for
(
LearningProject
learningProject
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取详情"
,
notes
=
"获取详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
)
})
@GetMapping
(
"/get/{id}"
)
@RequiresPermissions
(
"learning:project:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
LearningProject
learningProject
=
learningProjectService
.
getById
(
id
);
return
getResult
(
learningProject
);
}
}
src/main/resources/mapper/LearningContentBoardCatMapper.xml
View file @
730274bc
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.LearningContentBoardCat"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.LearningContentBoardCat"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"learning_content_id"
property=
"learningContentId"
/>
<result
column=
"learning_content_id"
property=
"learningContentId"
/>
<result
column=
"exhibition_board_cat_id"
property=
"exhibitionBoardCatId"
/>
<result
column=
"exhibition_board_cat_id"
property=
"exhibitionBoardCatId"
/>
</resultMap>
</resultMap>
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
...
...
src/main/resources/mapper/LearningContentMapper.xml
View file @
730274bc
...
@@ -4,22 +4,23 @@
...
@@ -4,22 +4,23 @@
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.LearningContent"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.LearningContent"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"cover"
property=
"cover"
/>
<result
column=
"cover"
property=
"cover"
/>
<result
column=
"applicable_scope"
property=
"applicableScope"
/>
<result
column=
"applicable_scope"
property=
"applicableScope"
/>
<result
column=
"learning_project_id"
property=
"learningProjectId"
/>
<result
column=
"learning_project_id"
property=
"learningProjectId"
/>
<result
column=
"audit_status_add"
property=
"auditStatusAdd"
/>
<result
column=
"audit_status"
property=
"auditStatus"
/>
<result
column=
"audit_status_edit"
property=
"auditStatusEdit"
/>
<result
column=
"is_published"
property=
"isPublished"
/>
<result
column=
"audit_status_delete"
property=
"auditStatusDelete"
/>
<result
column=
"is_deleted"
property=
"isDeleted"
/>
<result
column=
"sortorder"
property=
"sortorder"
/>
<result
column=
"sortorder"
property=
"sortorder"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
</resultMap>
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, name, cover, applicable_scope, learning_project_id, audit_status_add, audit_status_edit, audit_status_delete, sortorder, create_time, update_time
id, name, cover, applicable_scope, learning_project_id, audit_status, is_published, is_deleted, sortorder,
create_time, update_time
</sql>
</sql>
</mapper>
</mapper>
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