Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
343ce346
Commit
343ce346
authored
May 18, 2019
by
zhengjie
Browse files
v1.9 发布,详情查看发行版说明
parent
31e4a08a
Changes
28
Hide whitespace changes
Inline
Side-by-side
eladmin-tools/src/main/java/me/zhengjie/rest/PictureController.java
View file @
343ce346
...
...
@@ -67,4 +67,17 @@ public class PictureController {
pictureService
.
delete
(
pictureService
.
findById
(
id
));
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
/**
* 删除多张图片
* @param ids
* @return
*/
@Log
(
"删除图片"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','PICTURE_ALL','PICTURE_DELETE')"
)
@DeleteMapping
(
value
=
"/pictures"
)
public
ResponseEntity
deleteAll
(
@RequestBody
Long
[]
ids
)
{
pictureService
.
deleteAll
(
ids
);
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
}
eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
View file @
343ce346
...
...
@@ -8,15 +8,11 @@ import me.zhengjie.service.QiNiuService;
import
me.zhengjie.service.query.QiNiuQueryService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.nio.charset.Charset
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -108,4 +104,16 @@ public class QiniuController {
qiNiuService
.
delete
(
qiNiuService
.
findByContentId
(
id
),
qiNiuService
.
find
());
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
/**
* 删除多张图片
* @param ids
* @return
*/
@Log
(
"删除图片"
)
@DeleteMapping
(
value
=
"/qiNiuContent"
)
public
ResponseEntity
deleteAll
(
@RequestBody
Long
[]
ids
)
{
qiNiuService
.
deleteAll
(
ids
,
qiNiuService
.
find
());
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
}
eladmin-tools/src/main/java/me/zhengjie/service/PictureService.java
View file @
343ce346
...
...
@@ -36,4 +36,11 @@ public interface PictureService {
*/
@CacheEvict
(
allEntries
=
true
)
void
delete
(
Picture
picture
);
/**
* 删除图片
* @param ids
*/
@CacheEvict
(
allEntries
=
true
)
void
deleteAll
(
Long
[]
ids
);
}
eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
View file @
343ce346
...
...
@@ -69,4 +69,12 @@ public interface QiNiuService {
*/
@CacheEvict
(
allEntries
=
true
)
void
synchronize
(
QiniuConfig
config
);
/**
* 删除文件
* @param ids
* @return
*/
@CacheEvict
(
allEntries
=
true
)
void
deleteAll
(
Long
[]
ids
,
QiniuConfig
config
);
}
eladmin-tools/src/main/java/me/zhengjie/service/impl/PictureServiceImpl.java
View file @
343ce346
...
...
@@ -84,4 +84,11 @@ public class PictureServiceImpl implements PictureService {
}
}
@Override
public
void
deleteAll
(
Long
[]
ids
)
{
for
(
Long
id
:
ids
)
{
delete
(
findById
(
id
));
}
}
}
eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
View file @
343ce346
...
...
@@ -179,4 +179,11 @@ public class QiNiuServiceImpl implements QiNiuService {
}
}
@Override
public
void
deleteAll
(
Long
[]
ids
,
QiniuConfig
config
)
{
for
(
Long
id
:
ids
)
{
delete
(
findByContentId
(
id
),
config
);
}
}
}
eladmin-tools/src/main/java/me/zhengjie/service/query/PictureQueryService.java
View file @
343ce346
...
...
@@ -59,6 +59,13 @@ public class PictureQueryService {
list
.
add
(
cb
.
like
(
root
.
get
(
"filename"
).
as
(
String
.
class
),
"%"
+
picture
.
getFilename
()+
"%"
));
}
if
(!
ObjectUtils
.
isEmpty
(
picture
.
getUsername
())){
/**
* 模糊
*/
list
.
add
(
cb
.
like
(
root
.
get
(
"username"
).
as
(
String
.
class
),
"%"
+
picture
.
getUsername
()+
"%"
));
}
Predicate
[]
p
=
new
Predicate
[
list
.
size
()];
return
cb
.
and
(
list
.
toArray
(
p
));
}
...
...
pom.xml
View file @
343ce346
...
...
@@ -7,7 +7,7 @@
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin
</artifactId>
<packaging>
pom
</packaging>
<version>
1.
8
</version>
<version>
1.
9
</version>
<modules>
<module>
eladmin-common
</module>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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