feat: 测试接入wps
parent
5f2b7be39b
commit
fa06453072
|
|
@ -1,5 +1,6 @@
|
|||
package org.qinan.safetyeval.adapter.web;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -8,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 对外开放接口(免鉴权)。
|
||||
|
|
@ -23,10 +23,10 @@ public class H5OpenController {
|
|||
|
||||
@ApiOperation("wps回调预览")
|
||||
@GetMapping("/v3/3rd/files/{file_id}")
|
||||
public Map<String, Object> getWpsInfoByFileId(@PathVariable("file_id") String fileId) {
|
||||
Map<String, Object> wpsMap = new HashMap<>();
|
||||
wpsMap.put("code", 0);
|
||||
wpsMap.put("data", new HashMap<String, Object>() {{
|
||||
public JSONObject getWpsInfoByFileId(@PathVariable("file_id") String fileId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("data", new HashMap<String, Object>() {{
|
||||
put("create_time", 1670218748L);
|
||||
put("creator_id", "404");
|
||||
put("id", "9");
|
||||
|
|
@ -36,17 +36,17 @@ public class H5OpenController {
|
|||
put("size", 18961);
|
||||
put("version", 180);
|
||||
}});
|
||||
return wpsMap;
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@ApiOperation("wps回调下载")
|
||||
@GetMapping("/v3/3rd/files/{file_id}/download")
|
||||
public Map<String, Object> getWpsDownloadByFileId(@PathVariable("file_id") String fileId) {
|
||||
Map<String, Object> wpsMap = new HashMap<>();
|
||||
wpsMap.put("code", 0);
|
||||
wpsMap.put("data", new HashMap<String, Object>() {{
|
||||
public JSONObject getWpsDownloadByFileId(@PathVariable("file_id") String fileId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("data", new HashMap<String, Object>() {{
|
||||
put("url", "https://jjb-cloud.oss-cn-hangzhou.aliyuncs.com/2.docx");
|
||||
}});
|
||||
return wpsMap;
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue