|
@@ -14,6 +14,8 @@ import com.github.pagehelper.PageInfo;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
+import org.jeecg.modules.orderplatform.entity.PlatformScript;
|
|
|
|
+import org.jeecg.modules.orderplatform.service.IPlatformScriptService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
import org.jeecg.modules.wps.config.Context;
|
|
import org.jeecg.modules.wps.config.Context;
|
|
import org.jeecg.modules.wps.dto.*;
|
|
import org.jeecg.modules.wps.dto.*;
|
|
@@ -54,6 +56,8 @@ public class WpsFileServiceImpl extends ServiceImpl<WpsFileMapper, WpsFile> impl
|
|
private WpsUtil wpsUtil;
|
|
private WpsUtil wpsUtil;
|
|
@Autowired
|
|
@Autowired
|
|
private ISysUserService sysUserService;
|
|
private ISysUserService sysUserService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPlatformScriptService platformScriptService;
|
|
|
|
|
|
private static final String OSS_URL_PREFIX = "https://ctop-media.oss-cn-beijing.aliyuncs.com/script-lib/wps/";
|
|
private static final String OSS_URL_PREFIX = "https://ctop-media.oss-cn-beijing.aliyuncs.com/script-lib/wps/";
|
|
@Override
|
|
@Override
|
|
@@ -117,6 +121,36 @@ public class WpsFileServiceImpl extends ServiceImpl<WpsFileMapper, WpsFile> impl
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public Token getPlatformScriptViewUrl(String fileId, String userId, boolean checkToken) {
|
|
|
|
+ PlatformScript fileEntity = platformScriptService.getById(fileId);
|
|
|
|
+ if (fileEntity != null){
|
|
|
|
+ Token t = new Token();
|
|
|
|
+ String fileName = fileEntity.getName();
|
|
|
|
+ String fileType = FileUtil.getFileTypeByName(fileName);
|
|
|
|
+
|
|
|
|
+ UUID randomUuid = UUID.randomUUID();
|
|
|
|
+ String uuid = randomUuid.toString().replace("-","");
|
|
|
|
+
|
|
|
|
+ Map<String,String> values = new HashMap<>();
|
|
|
|
+ values.put("_w_appid", WpsUtil.appid);
|
|
|
|
+ if (checkToken){
|
|
|
|
+ values.put("_w_tokentype","1");
|
|
|
|
+ }
|
|
|
|
+ values.put("_w_filepath",fileName);
|
|
|
|
+ values.put("_w_userid", userId);
|
|
|
|
+ values.put("_w_filetype","db");
|
|
|
|
+
|
|
|
|
+ String wpsUrl = wpsUtil.getWpsUrl(values,fileType,fileEntity.getId());
|
|
|
|
+ t.setToken(uuid);
|
|
|
|
+ t.setExpires_in(600);
|
|
|
|
+ t.setWpsUrl(wpsUrl);
|
|
|
|
+
|
|
|
|
+ return t;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public Map<String,Object> getFileInfo(String userId, String filePath,String fileType,String fileId){
|
|
public Map<String,Object> getFileInfo(String userId, String filePath,String fileType,String fileId){
|
|
if ("web".equalsIgnoreCase(fileType)){
|
|
if ("web".equalsIgnoreCase(fileType)){
|
|
return getWebFileInfo(filePath);
|
|
return getWebFileInfo(filePath);
|