mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-04-05 17:37:49 +08:00
Merge pull request #463 from asiaWu3/master
perf: 优化FilePreviewFactory#get方法获取service bean的方式
This commit is contained in:
commit
3b1ae77aab
@ -4,8 +4,6 @@ import cn.keking.model.FileAttribute;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by kl on 2018/1/17.
|
||||
* Content :
|
||||
@ -20,7 +18,6 @@ public class FilePreviewFactory {
|
||||
}
|
||||
|
||||
public FilePreview get(FileAttribute fileAttribute) {
|
||||
Map<String, FilePreview> filePreviewMap = context.getBeansOfType(FilePreview.class);
|
||||
return filePreviewMap.get(fileAttribute.getType().getInstanceName());
|
||||
return context.getBean(fileAttribute.getType().getInstanceName(), FilePreview.class);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user