feat: 测试接入wps
parent
2b034872ad
commit
5f2b7be39b
|
|
@ -0,0 +1,52 @@
|
|||
package org.qinan.safetyeval.adapter.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 对外开放接口(免鉴权)。
|
||||
* <p>
|
||||
* 所有不需要登录验证的接口统一挂载在 /safetyEval/images 前缀下。
|
||||
* </p>
|
||||
*/
|
||||
@Api(tags = "对外开放接口")
|
||||
@RestController
|
||||
@RequestMapping("/safetyEval-h5/wsp")
|
||||
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>() {{
|
||||
put("create_time", 1670218748L);
|
||||
put("creator_id", "404");
|
||||
put("id", "9");
|
||||
put("modifier_id", "404");
|
||||
put("modify_time", 1670328304L);
|
||||
put("name", "统计月报.xlsx");
|
||||
put("size", 18961);
|
||||
put("version", 180);
|
||||
}});
|
||||
return wpsMap;
|
||||
}
|
||||
|
||||
@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>() {{
|
||||
put("url", "https://jjb-cloud.oss-cn-hangzhou.aliyuncs.com/2.docx");
|
||||
}});
|
||||
return wpsMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,26 +9,14 @@ import org.qinan.safetyeval.client.api.OrgInfoApi;
|
|||
import org.qinan.safetyeval.client.co.AccountCO;
|
||||
import org.qinan.safetyeval.client.co.FileInfoCO;
|
||||
import org.qinan.safetyeval.client.co.OrgInfoCO;
|
||||
import org.qinan.safetyeval.client.dto.AccountAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.AccountModifyCmd;
|
||||
import org.qinan.safetyeval.client.dto.AccountPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.OrgInfoAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SendMessageCmd;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.qinan.safetyeval.client.dto.*;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.base.Req;
|
||||
import org.qinan.safetyeval.infrastructure.remote.SmsRemote;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对外开放接口(免鉴权)。
|
||||
|
|
@ -134,4 +122,7 @@ public class ImagesOpenController {
|
|||
public SingleResponse<OrgInfoCO> getByAccount(@ApiParam("账号") @RequestBody Req<String> req) {
|
||||
return orgInfoApi.getByAccount(req.getData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue