2020-12-25 20:41:34 +08:00
|
|
|
package cn.keking.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.keking.model.FileAttribute;
|
|
|
|
|
import cn.keking.service.FilePreview;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
|
2020-12-26 19:13:50 +08:00
|
|
|
import static com.sun.glass.ui.Clipboard.TEXT_TYPE;
|
|
|
|
|
|
2020-12-25 20:41:34 +08:00
|
|
|
/**
|
|
|
|
|
* @author kl (http://kailing.pub)
|
|
|
|
|
* @since 2020/12/25
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
public class XmlFilePreviewImpl implements FilePreview {
|
|
|
|
|
|
|
|
|
|
private final SimTextFilePreviewImpl simTextFilePreview;
|
|
|
|
|
|
|
|
|
|
public XmlFilePreviewImpl(SimTextFilePreviewImpl simTextFilePreview) {
|
|
|
|
|
this.simTextFilePreview = simTextFilePreview;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
|
2020-12-25 22:47:30 +08:00
|
|
|
model.addAttribute(TEXT_TYPE,"xml");
|
2020-12-25 20:41:34 +08:00
|
|
|
return simTextFilePreview.filePreviewHandle(url, model, fileAttribute);
|
|
|
|
|
}
|
|
|
|
|
}
|