|
|
@@ -76,8 +76,10 @@ public class ConsoleServiceImpl implements ConsoleService {
|
|
|
@Override
|
|
|
public void registerAndBind(UploadResult uploadResult) {
|
|
|
String contentType = uploadResult.getContentType();
|
|
|
- int fileType = ObjectType.Any.getValue();
|
|
|
- if (contentType.startsWith("video")) {
|
|
|
+ int fileType = ObjectType.Other.getValue();
|
|
|
+ if (contentType.startsWith("image")) {
|
|
|
+ fileType = ObjectType.Image.getValue();
|
|
|
+ } else if (contentType.startsWith("video")) {
|
|
|
fileType = ObjectType.Video.getValue();
|
|
|
} else if (contentType.startsWith("audio")) {
|
|
|
fileType = ObjectType.Audio.getValue();
|
|
|
@@ -91,8 +93,6 @@ public class ConsoleServiceImpl implements ConsoleService {
|
|
|
fileType = ObjectType.DocExcel.getValue();
|
|
|
} else if (contentType.equals("application/vnd.openxmlformats-officedocument.presentationml.presentation")) {
|
|
|
fileType = ObjectType.DocPpt.getValue();
|
|
|
- } else if (contentType.startsWith("application/")) {
|
|
|
- fileType = ObjectType.Other.getValue();
|
|
|
}
|
|
|
|
|
|
long uploadBy = uploadResult.getUploadBy();
|
|
|
@@ -127,6 +127,11 @@ public class ConsoleServiceImpl implements ConsoleService {
|
|
|
@Override
|
|
|
public ObjectMeta getObjectMeta(String httpHost, String objectName) {
|
|
|
UserNode userNode = userNodeService.getUserNodeByDomain(httpHost);
|
|
|
+ if (userNode == null) {
|
|
|
+ log.error("userNodenot found with {} and {}", httpHost, objectName);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
long uploadBy = userNode.getCreateBy();
|
|
|
return objectRepository.getObjectMetaByName(objectName, uploadBy);
|
|
|
}
|