v1.0.3
This commit is contained in:
+5
-5
@@ -97,7 +97,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("delete mongo file error, id={}", attach.getId(), e);
|
||||
throw new TimiException(TimiCode.ERROR).msgKey("TODO delete mongo file error");
|
||||
throw new TimiException(TimiCode.ERROR, "TODO delete mongo file error");
|
||||
}
|
||||
};
|
||||
mapper.selectThumbsBySourceId(id).forEach(doDestroy::handler);
|
||||
@@ -145,7 +145,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
gridFsTemplate.delete(Query.query(Criteria.where("_id").is(mongoId)));
|
||||
}
|
||||
log.error("create error", e);
|
||||
throw new TimiException(TimiCode.ARG_BAD).msgKey("TODO read attachment input stream error");
|
||||
throw new TimiException(TimiCode.ARG_BAD, "TODO read attachment input stream error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
gridFsTemplate.delete(Query.query(Criteria.where("_id").is(newMongoId)));
|
||||
}
|
||||
log.error("update error", e);
|
||||
throw new TimiException(TimiCode.ERROR).msgKey("TODO update file error");
|
||||
throw new TimiException(TimiCode.ERROR, "TODO update file error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
return thumb;
|
||||
} catch (Exception e) {
|
||||
log.error("create thumbnail error", e);
|
||||
throw new TimiException(TimiCode.ERROR).msgKey("exception.attachment.create.error");
|
||||
throw new TimiException(TimiCode.ERROR, "exception.attachment.create.error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
if (isNew) {
|
||||
// 请求有、数据库无:将临时文件记录直接转存为永久附件
|
||||
if (TimiJava.isEmpty(tempFileId)) {
|
||||
throw new TimiException(TimiCode.ERROR).msgKey("exception.attachment.file.required");
|
||||
throw new TimiException(TimiCode.ERROR, "exception.attachment.file.required");
|
||||
}
|
||||
Attachment tempFile = mapper.selectRaw(tempFileId);
|
||||
tempFile.setBizType(bizType);
|
||||
|
||||
+3
-3
@@ -51,11 +51,11 @@ public class ClipboardServiceImplement implements ClipboardService {
|
||||
public void setContent(String id, String content) {
|
||||
validateId(id);
|
||||
if (content == null) {
|
||||
throw new TimiException(TimiCode.ARG_MISS).msgKey("剪切板内容不能为空");
|
||||
throw new TimiException(TimiCode.ARG_MISS, "剪切板内容不能为空");
|
||||
}
|
||||
byte[] contentBytes = content.getBytes(StandardCharsets.UTF_8);
|
||||
if (MAX_CONTENT_SIZE < contentBytes.length) {
|
||||
throw new TimiException(TimiCode.ARG_BAD).msgKey("剪切板内容不能超过 10MB");
|
||||
throw new TimiException(TimiCode.ARG_BAD, "剪切板内容不能超过 10MB");
|
||||
}
|
||||
redisClipboard.set(getKey(id), content, Time.D * 7);
|
||||
notifySubscribers(id, content);
|
||||
@@ -78,7 +78,7 @@ public class ClipboardServiceImplement implements ClipboardService {
|
||||
|
||||
private void validateId(String id) {
|
||||
if (TimiJava.isEmpty(id)) {
|
||||
throw new TimiException(TimiCode.ARG_MISS).msgKey("id 不能为空");
|
||||
throw new TimiException(TimiCode.ARG_MISS, "id 不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -39,7 +39,9 @@ public class MultilingualServiceImplement extends AbstractEntityService<Multilin
|
||||
Multilingual result = redisLanguage.get(getKey(id));
|
||||
if (result == null) {
|
||||
result = super.get(id);
|
||||
redisLanguage.set(getKey(id), result, Time.D * 7);
|
||||
if (result != null) {
|
||||
redisLanguage.set(getKey(id), result, Time.D * 7);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user