feat: 测试接入wps

v0.0.1-final^2
zhanglei 2026-07-17 11:38:33 +08:00
parent 5f2b7be39b
commit fa06453072
1 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,6 @@
package org.qinan.safetyeval.adapter.web; package org.qinan.safetyeval.adapter.web;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; 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 org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* *
@ -23,10 +23,10 @@ public class H5OpenController {
@ApiOperation("wps回调预览") @ApiOperation("wps回调预览")
@GetMapping("/v3/3rd/files/{file_id}") @GetMapping("/v3/3rd/files/{file_id}")
public Map<String, Object> getWpsInfoByFileId(@PathVariable("file_id") String fileId) { public JSONObject getWpsInfoByFileId(@PathVariable("file_id") String fileId) {
Map<String, Object> wpsMap = new HashMap<>(); JSONObject jsonObject = new JSONObject();
wpsMap.put("code", 0); jsonObject.put("code", 0);
wpsMap.put("data", new HashMap<String, Object>() {{ jsonObject.put("data", new HashMap<String, Object>() {{
put("create_time", 1670218748L); put("create_time", 1670218748L);
put("creator_id", "404"); put("creator_id", "404");
put("id", "9"); put("id", "9");
@ -36,17 +36,17 @@ public class H5OpenController {
put("size", 18961); put("size", 18961);
put("version", 180); put("version", 180);
}}); }});
return wpsMap; return jsonObject;
} }
@ApiOperation("wps回调下载") @ApiOperation("wps回调下载")
@GetMapping("/v3/3rd/files/{file_id}/download") @GetMapping("/v3/3rd/files/{file_id}/download")
public Map<String, Object> getWpsDownloadByFileId(@PathVariable("file_id") String fileId) { public JSONObject getWpsDownloadByFileId(@PathVariable("file_id") String fileId) {
Map<String, Object> wpsMap = new HashMap<>(); JSONObject jsonObject = new JSONObject();
wpsMap.put("code", 0); jsonObject.put("code", 0);
wpsMap.put("data", new HashMap<String, Object>() {{ jsonObject.put("data", new HashMap<String, Object>() {{
put("url", "https://jjb-cloud.oss-cn-hangzhou.aliyuncs.com/2.docx"); put("url", "https://jjb-cloud.oss-cn-hangzhou.aliyuncs.com/2.docx");
}}); }});
return wpsMap; return jsonObject;
} }
} }