金山WPS在线编辑

This commit is contained in:
zhangqinbin
2023-10-25 09:19:45 +08:00
parent cf27a37b26
commit 3ccbf4bd61
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package com.chinaunicom.mall.ebtp.extend.feign.client;
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 认证中心数据服务客户端
*
* @author Ajaxfan
*/
@FeignClient(value = "${user.auth.resource.serviceId:mall-auth}")
public interface UnicomOAuthClient {
@GetMapping("oauth/check_token")
SecurityEntity get(@RequestParam("token") String token);
}

View File

@ -1,10 +1,12 @@
package com.chinaunicom.mall.ebtp.extend.wps.controller; package com.chinaunicom.mall.ebtp.extend.wps.controller;
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail; import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule; import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType; import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient;
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo; import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo;
import com.chinaunicom.mall.ebtp.extend.wps.service.WpsService; import com.chinaunicom.mall.ebtp.extend.wps.service.WpsService;
import com.chinaunicom.mall.ebtp.extend.wps.vo.WpsClientInVo; import com.chinaunicom.mall.ebtp.extend.wps.vo.WpsClientInVo;
@ -34,6 +36,9 @@ public class WpsController {
@Resource @Resource
private WpsService wpsService; private WpsService wpsService;
@Resource
private UnicomOAuthClient unicomOAuthClient;
/** /**
* 获得编辑或查看链接 * 获得编辑或查看链接
* *
@ -122,4 +127,19 @@ public class WpsController {
public Object saveKSFile(@RequestBody KingSoftFileSaveVo vo) { public Object saveKSFile(@RequestBody KingSoftFileSaveVo vo) {
return this.wpsService.saveKSFile(vo); return this.wpsService.saveKSFile(vo);
} }
/**
* token
* 编辑 permission=write
* 预览 permission=read
* @param
* @return
*/
@ApiOperation("token")
@GetMapping("/kingSoft/getToken")
public BaseResponse getToken(@RequestParam("token") String token) {
SecurityEntity s = unicomOAuthClient.get(token);
log.info("SecurityEntity:"+s);
return BaseResponse.success(s);
}
} }