|
|
|
@ -0,0 +1,77 @@
|
|
|
|
|
package com.weaver.seconddev.interfaces.workflow.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.common.distribution.lock.DistributionLockInterface;
|
|
|
|
|
import com.weaver.common.i18n.tool.util.I18nContextUtil;
|
|
|
|
|
import com.weaver.custom.configcenter.htsysjcmtConfig;
|
|
|
|
|
import com.weaver.ecode.api.rpc.EcodeService;
|
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
|
import com.weaver.framework.rpc.context.impl.TenantRpcContext;
|
|
|
|
|
import com.weaver.openapi.pojo.ApiResult;
|
|
|
|
|
import com.weaver.openapi.pojo.auth.params.AccessTokenParam;
|
|
|
|
|
import com.weaver.openapi.pojo.auth.params.CodeParam;
|
|
|
|
|
import com.weaver.openapi.pojo.auth.res.AccessToken;
|
|
|
|
|
import com.weaver.openapi.pojo.auth.res.Code;
|
|
|
|
|
import com.weaver.openapi.pojo.message.params.MessageVo;
|
|
|
|
|
import com.weaver.openapi.pojo.message.params.vo.MessageEntity;
|
|
|
|
|
import com.weaver.openapi.pojo.message.params.vo.MessageReciver;
|
|
|
|
|
import com.weaver.openapi.pojo.message.params.vo.MessageSender;
|
|
|
|
|
import com.weaver.openapi.service.AuthService;
|
|
|
|
|
import com.weaver.openapi.service.MessageService;
|
|
|
|
|
import com.weaver.seconddev.interfaces.prop.ConfigProp;
|
|
|
|
|
import com.weaver.verupgrade.conn.RecordSet;
|
|
|
|
|
import com.weaver.workflow.list.api.rest.publicapi.WflRequestListRest;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping({"/papi/secondev/message" })
|
|
|
|
|
//@WeaPermission
|
|
|
|
|
public class MessageSubscriptionController {
|
|
|
|
|
|
|
|
|
|
// api 需要用户会话,e10入口地址访问
|
|
|
|
|
// papi 任何人都可以直接访问 public api,e10入口地址访问
|
|
|
|
|
// sapi 服务内部通信的接口路由前缀 /sapi/secondev,e10入口地址访问不了
|
|
|
|
|
// 二开服务新接口:/api/secondev,/papi/secondev
|
|
|
|
|
|
|
|
|
|
@RpcReference(timeout = 10000)
|
|
|
|
|
EcodeService ecodeService;
|
|
|
|
|
@RpcReference(timeout = 2000, group = "workflow")
|
|
|
|
|
WflRequestListRest wflRequestListRest;
|
|
|
|
|
@Autowired
|
|
|
|
|
private DistributionLockInterface distributionLock;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ConfigProp configProp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(MessageSubscriptionController.class);
|
|
|
|
|
@PostMapping("/subscription")
|
|
|
|
|
public WeaResult<String> subscription(@RequestParam Map<String,Object> params) {
|
|
|
|
|
logger.error("MessageSubscriptionController Start " );
|
|
|
|
|
String jtzhkey = "t6kj9c07jr";
|
|
|
|
|
// String jtzhadmin = configProp.getJtzhadmin();
|
|
|
|
|
// log.error("jtzhkey:"+jtzhkey+" jtzhadmin:"+itzhadmin);
|
|
|
|
|
|
|
|
|
|
TenantRpcContext.setTargetTenantKey(jtzhkey);
|
|
|
|
|
// TenantRpcContext.setTargetEmployeeId(jtzhadmin);
|
|
|
|
|
Map<String ,String > map = new HashMap<>();
|
|
|
|
|
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
|
|
|
|
|
|
|
|
|
|
logger.error("subscription 推送成功");
|
|
|
|
|
map.put("msg","推送成功");
|
|
|
|
|
return WeaResult.success(map.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|