Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
rszt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
rszt
Commits
6a16f140
提交
6a16f140
authored
12月 14, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
06575c9b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
20 行增加
和
162 行删除
+20
-162
bootstrap.yml
com.zrqx.eureka/src/main/resources/bootstrap.yml
+2
-2
bootstrap.yml
com.zrqx.file/src/main/resources/bootstrap.yml
+3
-2
ImageLibraryController.java
...ce/bg/controller/imagelibrary/ImageLibraryController.java
+4
-149
bootstrap.yml
com.zrqx.resource/src/main/resources/bootstrap.yml
+3
-2
bootstrap.yml
com.zrqx.sysuser/src/main/resources/bootstrap.yml
+3
-2
bootstrap.yml
config-server/src/main/resources/bootstrap.yml
+2
-2
application-prod.yml
...server/src/main/resources/properties/application-prod.yml
+3
-3
没有找到文件。
com.zrqx.eureka/src/main/resources/bootstrap.yml
浏览文件 @
6a16f140
server
:
port
:
8761
\ No newline at end of file
port
:
8081
\ No newline at end of file
com.zrqx.file/src/main/resources/bootstrap.yml
浏览文件 @
6a16f140
server
:
port
:
8
701
port
:
8
082
spring
:
cloud
:
config
:
uri
:
http://localhost:8
786
#配置中心地址
uri
:
http://localhost:8
085
#配置中心地址
name
:
file
profile
:
prod
label
:
master
\ No newline at end of file
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/imagelibrary/ImageLibraryController.java
浏览文件 @
6a16f140
/*
package com.zrqx.resource.bg.controller.imagelibrary;
package
com
.
zrqx
.
resource
.
bg
.
controller
.
imagelibrary
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -48,12 +48,12 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
tk.mybatis.mapper.entity.Example
;
*/
/**
/**
* 图片库Controller
*/
/*
*/
@RestController
@RequestMapping
(
ResourceRequestPath
.
BG
+
ResourceRequestPath
.
IMAGE_LIBRARY
)
@Api(description = "资源管理-
图片库
")
@Api
(
description
=
"资源管理-
精彩瞬间
"
)
public
class
ImageLibraryController
{
@Autowired
...
...
@@ -62,10 +62,6 @@ public class ImageLibraryController {
private
ImageLibraryDiyTypeRelationService
idrService
;
@Autowired
private
ImageResourceService
resourceService
;
@Autowired
private ResourceRelationService resourceRelationService;
@Autowired
private ImageLibraryDiyTypeService imageLibraryDiyTypeService;
...
...
@@ -93,72 +89,14 @@ public class ImageLibraryController {
if
(!
service
.
saveOrUpdate
(
form
)){
throw
new
BusinessValidateException
(
"操作失败"
);
}
ImageLibrary entity = service.selectByPrimaryKey(form.getId());
return CallBack.success();
}
@ApiOperation(value = "批量修改价格" , notes ="批量修改价格")
@PostMapping(value = ResourceRequestPath.BATCH_UPDATE_PRICE)
public CallBack<Boolean> updatePrice(@RequestBody BatchUpdateImageLibraryForm form){
Example example = service.createExample();
example.createCriteria().andIn("id", form.getIds());
ImageLibrary entity = new ImageLibrary();
entity.setRealPrice(form.getRealPrice());
entity.setUpdateTime(new Date());
if(!service.UpdateByExampleSelective(entity,example)){
throw new BusinessValidateException("操作失败");
}
return CallBack.success();
}
@ApiOperation(value = "批量修改分类", notes = "批量修改分类")
@PostMapping(value = ResourceRequestPath.BATCH_UPDATE_DIYTIPE)
public CallBack<Boolean> updateDivType(@RequestBody BatchUpdateImageLibraryForm form) {
List<ImageLibraryDiyType> list = new ArrayList<ImageLibraryDiyType>();
form.getIds().forEach(alId -> {
//刪除原有的分类
ImageLibraryDiyType ob = new ImageLibraryDiyType();
ob.setIlId(alId);
imageLibraryDiyTypeService.delete(ob);
//添加
List<ImageLibraryDiyType> ls = form.getDiyType();
ls.forEach(l -> l.setIlId(alId));
list.addAll(ls);
});
if (!imageLibraryDiyTypeService.insertList(list)) {
throw new BusinessValidateException("操作失败");
}
return CallBack.success();
}
@ApiOperation(value = "批量审核", notes = "批量审核")
@PostMapping(value = ResourceRequestPath.BATCH_UPDATE_STATUS)
public CallBack<Boolean> updateArray(@RequestBody List<String> ids) {
Example example = service.createExample();
example.createCriteria().andIn("id", ids);
ImageLibrary entity = new ImageLibrary();
entity.setStatus(LibraryStatusEnum.STATUS_1.getCode());
entity.setUpdateTime(new Date());
if (!service.UpdateByExampleSelective(entity,example)) {
throw new BusinessValidateException("操作失败");
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量 上架/下架"
,
notes
=
"批量 上架/下架"
)
@PostMapping
(
value
=
ResourceRequestPath
.
BATCH_UPDATE_UPDOWN
)
public
CallBack
<
Boolean
>
updateShowState
(
@RequestBody
BatchUpdateImageLibraryForm
form
){
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
List
<
ImageLibrary
>
list
=
service
.
selectByExample
(
example
);
for (ImageLibrary entity : list) {
if(entity.getStatus() == LibraryStatusEnum.STATUS_0.getCode()){
throw new BusinessValidateException("待审核状态的文章不能直接操作上架状态需通过批量审核操作上架");
}
if(entity.getBookId() != null){
throw new BusinessValidateException("图书内拆分出来的文章不支持单独上、下架、删除操作");
}
}
ImageLibrary
entity
=
new
ImageLibrary
();
entity
.
setStatus
(
form
.
getStatus
());
entity
.
setUpdateTime
(
new
Date
());
...
...
@@ -205,23 +143,6 @@ public class ImageLibraryController {
ImageLibrary
entity
=
service
.
selectByPrimaryKey
(
oid
);
ImageLibraryOneVO
vo
=
new
ImageLibraryOneVO
();
BeanUtils
.
copyProperties
(
entity
,
vo
);
if(StringUtils.isNotBlank(entity.getAuthorId())){
vo.setAuthorNameAndId(entity.getAuthor() + "," + entity.getAuthorId());
}else{
vo.setAuthorNameAndId(entity.getAuthor());
}
if(entity.getRealPrice() != null){
vo.setRealPrice(entity.getRealPrice().toString());
}
if(entity.getPrice() != null){
vo.setPrice(entity.getPrice().toString());
}
Example example = idrService.createExample();
example.createCriteria().andEqualTo("ilId" , oid);
List<ImageLibraryDiyType> list = idrService.selectByExample(example);
//组装自定义分类
vo.setDiyType(list);
return
CallBack
.
success
(
vo
);
}
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"查询列表"
)
...
...
@@ -230,58 +151,6 @@ public class ImageLibraryController {
return
CallBack
.
success
(
service
.
page
(
form
,
pageParam
));
}
@ApiOperation("相关资源列表")
@GetMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.PAGE)
public CallBack<PageInfo<ResourceRelationVo>> reousrceRelationPage(QueryResourceRelationForm entity,
PageParam pageParam) {
if (entity == null || entity.getId() == null) {
throw new ParameterValidateException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "资源id不能为空!");
}
List<ResourceRelationVo> list = resourceService.queryByIdAndResourceType(entity, pageParam);
if (list == null || list.size() == 0) {
return CallBack.success(new PageInfo<ResourceRelationVo>(list));
}
return CallBack.success(new PageInfo<ResourceRelationVo>(resourceRelationService.queryRelationList(list)));
}
@ApiOperation(value = "选择弹窗中的列表" , notes ="查询选择弹窗中的列表")
@GetMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.POPPAGE)
public CallBack<PageInfo<ImageLibraryListVO>> page(QueryResourceForPoPForm form, PageParam pageParam){
return CallBack.success(service.pageByTitleAndDiyType(form, pageParam));
}
@ApiOperation(value = "保存相关资源" , notes ="保存相关资源")
@PostMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.SAVE)
public CallBack<Boolean> saveRelation(@RequestBody SaveResourceRelationForm entity){
if(entity.getId() == null || entity.getResourceIds() == null || entity.getResourceType() == null || entity.getResourceIds().length == 0){
throw new ParameterValidateException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "必须指定id、被关联的resourceId、资源类型");
}
List<ImageResource> recordList = new ArrayList<ImageResource>();
Arrays.asList(entity.getResourceIds()).forEach(resourceId -> {
ImageResource e = new ImageResource();
e.setImageId(entity.getId());
e.setResourceId(resourceId);
e.setCreateTime(new Date());
e.setResourceType(entity.getResourceType());
recordList.add(e);
});
return CallBack.success(resourceService.insertList(recordList));
}
@ApiOperation(value = "批量删除关联资源", notes = "批量删除")
@PostMapping(value = ResourceRequestPath.RES_BATCH_DELETE)
public CallBack<Boolean> deleteByResourceIds(@RequestBody List<Integer> ids) {
if (ids.size() == 0) {
throw new BaseException(-7,"没有选中任何数据,请重新选择");
}
Example example = resourceService.createExample();
example.createCriteria().andIn("id", ids);
List<ImageResource> list = resourceService.selectByExample(example);
for (ImageResource entity : list) {
resourceService.deleteByPrimaryKey(entity);
}
return CallBack.success();
}
@ApiOperation
(
value
=
"修改排序号"
,
notes
=
"修改排序号"
)
@PostMapping
(
value
=
ResourceRequestPath
.
UPDATE
+
ResourceRequestPath
.
SORT
)
public
CallBack
<
Boolean
>
updateSort
(
@RequestBody
UpdateEbookRelationForm
form
)
{
...
...
@@ -294,17 +163,4 @@ public class ImageLibraryController {
return
CallBack
.
success
();
}
@ApiOperation(value = "批量修改阅读权限", notes = "批量修改阅读权限")
@PostMapping(value = ResourceRequestPath.BATCH_UPDATE_READ)
public CallBack<Boolean> updateReadTextPower(@RequestBody BatchUpdateImageLibraryForm form) {
Example example = service.createExample();
example.createCriteria().andIn("id", form.getIds());
ImageLibrary entity = new ImageLibrary();
entity.setReadTextPower(form.getReadTextPower());
if (!service.UpdateByExampleSelective(entity,example)) {
throw new BusinessValidateException("操作失败");
}
return CallBack.success();
}
}
*/
\ No newline at end of file
com.zrqx.resource/src/main/resources/bootstrap.yml
浏览文件 @
6a16f140
server
:
port
:
8
705
port
:
8
083
spring
:
cloud
:
config
:
uri
:
http://localhost:8
786
#配置中心地址
uri
:
http://localhost:8
085
#配置中心地址
name
:
resource
profile
:
prod
label
:
master
\ No newline at end of file
com.zrqx.sysuser/src/main/resources/bootstrap.yml
浏览文件 @
6a16f140
server
:
port
:
8
706
port
:
8
084
spring
:
cloud
:
config
:
uri
:
http://localhost:8
786
#配置中心地址
uri
:
http://localhost:8
085
#配置中心地址
name
:
sysuser
profile
:
prod
label
:
master
\ No newline at end of file
config-server/src/main/resources/bootstrap.yml
浏览文件 @
6a16f140
server
:
port
:
8786
\ No newline at end of file
port
:
8085
\ No newline at end of file
config-server/src/main/resources/properties/application-prod.yml
浏览文件 @
6a16f140
...
...
@@ -2,11 +2,11 @@
#tx-manager 分布式事务服务端口号
tx-manager-prot
:
8700
#file服务端口号
file-port
:
8
701
file-port
:
8
082
#resource 服务端口号
resource-port
:
8
705
resource-port
:
8
083
#sysuser服务端口号
sysuser-port
:
8
706
sysuser-port
:
8
084
#默认
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论