Skip to content

Commit

Permalink
图片审核
Browse files Browse the repository at this point in the history
  • Loading branch information
adlered committed Nov 4, 2024
1 parent 5934d7d commit 8b005c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,13 @@ public void markPic(final RequestContext context) {
return;
}

// 抹除MD5
status = new JSONObject();
status.put("md5", "deleted");
transaction = uploadRepository.beginTransaction();
uploadRepository.update(oId, status);
transaction.commit();

// 删除图片
if (QN_ENABLED) {
Auth auth = Auth.create(Symphonys.UPLOAD_QINIU_AK, Symphonys.UPLOAD_QINIU_SK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,7 @@ public synchronized void uploadFile(final RequestContext context) {
for (int i = 0; i < files.size(); i++) {
// 检查该文件是否已经上传过
String md5 = MD5Calculator.calculateMd5(fileBytes.get(i));
final List<Filter> filters = new ArrayList<>();
filters.add(new PropertyFilter("md5", FilterOperator.EQUAL, md5));
filters.add(new PropertyFilter("public", FilterOperator.EQUAL, true));
final Query query = new Query().setFilter(new CompositeFilter(CompositeFilterOperator.AND, filters));
final Query query = new Query().setFilter(new PropertyFilter("md5", FilterOperator.EQUAL, md5));
try {
final List<JSONObject> md5s = uploadRepository.getList(query);
if (!md5s.isEmpty()) {
Expand Down

0 comments on commit 8b005c2

Please sign in to comment.