mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-17 14:43:47 +08:00
28 lines
685 B
Java
28 lines
685 B
Java
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;
|
|
/**
|
|
* @author : kl
|
|
* @authorboke : kailing.pub
|
|
* @create : 2018-03-25 上午11:58
|
|
* @description:
|
|
**/
|
|
@Service
|
|
public class MediaFilePreviewImpl implements FilePreview {
|
|
|
|
@Override
|
|
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
|
|
model.addAttribute("mediaUrl", url);
|
|
String suffix=fileAttribute.getSuffix();
|
|
if ("flv".equalsIgnoreCase(suffix)) {
|
|
return "flv";
|
|
}
|
|
return "media";
|
|
}
|
|
|
|
|
|
}
|