沃文档-获取链接、回调接口:查询文件 及保存

This commit is contained in:
yss
2023-06-05 14:31:07 +08:00
parent 1f53c11bd4
commit 7dc44bb1df

View File

@ -10,6 +10,7 @@ import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.AttachmentEntity;
import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.UploadObject; import com.chinaunicom.ebtp.mall.cloud.attachment.sdk.model.UploadObject;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService; import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum; import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
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.common.log.service.OperationLogService; import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
@ -232,6 +233,7 @@ public class WpsServiceImpl implements WpsService {
* ContentJson 没有就传空字符串 * ContentJson 没有就传空字符串
* @return * @return
*/ */
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "沃文档-获取应用权限")
public String getWpsAppToken(){ public String getWpsAppToken(){
if(redisTemplate.opsForValue().get("wpsAppToken:"+app_id)!=null){ if(redisTemplate.opsForValue().get("wpsAppToken:"+app_id)!=null){
return String.valueOf(redisTemplate.opsForValue().get("wpsAppToken:"+app_id)); return String.valueOf(redisTemplate.opsForValue().get("wpsAppToken:"+app_id));
@ -255,6 +257,7 @@ public class WpsServiceImpl implements WpsService {
* @param bean * @param bean
* @return * @return
*/ */
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "沃文档-调用天擎接口")
public Map<String, Object> callUniWpsInterfaceJson(CrypBean bean) { public Map<String, Object> callUniWpsInterfaceJson(CrypBean bean) {
log.info("沃文档-天擎接口------callUniInterface---入参-----" + JSON.toJSONString(bean)); log.info("沃文档-天擎接口------callUniInterface---入参-----" + JSON.toJSONString(bean));
String url= ""; String url= "";
@ -354,6 +357,7 @@ public class WpsServiceImpl implements WpsService {
* @param data * @param data
* @return * @return
*/ */
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "沃文档-uniBssWpsHttpPost")
public String uniBssWpsHttpPost(String path, String data,String nlptDate,String nlptAuth,String nlptContentMd5,String contentType) { public String uniBssWpsHttpPost(String path, String data,String nlptDate,String nlptAuth,String nlptContentMd5,String contentType) {
String str = ""; String str = "";
@ -374,6 +378,7 @@ public class WpsServiceImpl implements WpsService {
conn.setDoOutput(true); conn.setDoOutput(true);
conn.setDoInput(true); conn.setDoInput(true);
conn.setRequestMethod("POST"); conn.setRequestMethod("POST");
out = new PrintWriter(conn.getOutputStream()); out = new PrintWriter(conn.getOutputStream());
out.print(data); out.print(data);
out.flush(); out.flush();
@ -388,6 +393,7 @@ public class WpsServiceImpl implements WpsService {
is.close(); is.close();
conn.disconnect(); conn.disconnect();
operationLogService.addOperationLog("沃文档天擎接口调用信息HttpURLConnection={}"+JSONObject.toJSONString(conn)+",参数{}"+data+",返回信息{}"+str,true, EbtpLogBusinessModule.OTHER, EbtpLogType.INSERT);
} catch (Exception var9) { } catch (Exception var9) {
var9.printStackTrace(); var9.printStackTrace();
} }