Commit c4209073 by 胡懿

对接平台数据

parent 413a08e7
package cn.gintone.controller;
import cn.gintone.dal.SysAbbreMapper;
import cn.gintone.dtoPt.PtData;
import cn.gintone.dtoPt.PtMenuInfo;
import cn.gintone.entity.SysAbbreDO;
import cn.gintone.entity.WebReqConfDO;
import cn.gintone.myconf.BasicUrlConf;
import cn.gintone.utils.BasicInfoHttpUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
......@@ -35,6 +44,11 @@ public class WebReqConfController {
@Resource
private WebReqConfService webReqConfService;
@Resource
private BasicUrlConf basicUrlConf;
@Autowired
private SysAbbreMapper sysAbbreMapper;
@PostMapping("/create")
@Operation(summary = "创建web请求配置")
@PreAuthorize("@ss.hasPermission('sec:web-req-conf:create')")
......@@ -88,4 +102,41 @@ public class WebReqConfController {
BeanUtils.toBean(list, WebReqConfRespVO.class));
}
/*
同步平台api数据
*/
@GetMapping("/synchronizeApi")
public CommonResult<String> synchronizeApi() {
SysAbbreDO secure = sysAbbreMapper.selectOne(new QueryWrapper<SysAbbreDO>()
.lambda()
.eq(SysAbbreDO::getAbbreEn, "SLPT")
);
PtResult<PtData<PtMenuInfo>> ptMenuList = BasicInfoHttpUtils.getPtMenu(basicUrlConf.getMenuInfoUrl(), "", "");
PtData<PtMenuInfo> data = ptMenuList.getData();
if (data != null) {
List<PtMenuInfo> rowDataList = data.getRowData();
if (rowDataList != null && rowDataList.size() > 0) {
for (PtMenuInfo rowData : rowDataList) {
String pValue = rowData.getP_VALUE();
if (pValue != null && pValue.length() > 1) {
WebReqConfSaveReqVO webReqConfSaveReqVO = new WebReqConfSaveReqVO();
webReqConfSaveReqVO.setApiUrl(pValue);
webReqConfSaveReqVO.setApiId(rowData.getP_ID() + "");
if (null != rowData.getPARENT_P_ID()) {
webReqConfSaveReqVO.setApiParentId(rowData.getPARENT_P_ID() + "");
}
webReqConfSaveReqVO.setApiName(rowData.getP_NAME());
webReqConfSaveReqVO.setAbbreId(secure.getId());
webReqConfSaveReqVO.setAbbreCn(secure.getAbbreCn());
webReqConfService.myCreateWebReqConf(webReqConfSaveReqVO);
}
}
}
}
return success("同步成功");
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ public class PtTimeTaskService {
@Scheduled(fixedDelay = 10000)
public void executeEvery5Minutes() {
SysAbbreDO secure = sysAbbreMapper.selectOne(new QueryWrapper<SysAbbreDO>()
/*SysAbbreDO secure = sysAbbreMapper.selectOne(new QueryWrapper<SysAbbreDO>()
.lambda()
.eq(SysAbbreDO::getAbbreEn, "SLPT")
);
......@@ -55,6 +55,6 @@ public class PtTimeTaskService {
}
}
}
System.out.println(123);
System.out.println(123);*/
}
}
......@@ -78,12 +78,14 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
CommonResult<?> result1 = new CommonResult<>();
result1.setCode(403);
result1.setMsg("未登录");
ServletUtils.writeJSON(response, result);
ServletUtils.writeJSON(response, result1);
return ;
} else if (null == result || result.getCode() == 5001) {
CommonResult<?> result1 = new CommonResult<>();
result1.setCode(402);
result1.setMsg("Token无效");
ServletUtils.writeJSON(response, result);
ServletUtils.writeJSON(response, result1);
return ;
} else {
LoginUserInfo data = result.getData();
......
......@@ -123,7 +123,7 @@ rocketmq:
spring:
# RabbitMQ 配置项,对应 RabbitProperties 配置类
rabbitmq:
# rabbitmq:
# host: 192.168.19.205
# host: 127.0.0.1
# port: 5672
......@@ -287,7 +287,7 @@ pf4j:
pluginsDir: ../plugins
iotdb:
# ip: 192.168.19.191
# ip: 59.195.13.208
ip: 127.0.0.1
port: 6667
username: root
......
......@@ -123,7 +123,7 @@ rocketmq:
spring:
# RabbitMQ 配置项,对应 RabbitProperties 配置类
rabbitmq:
# rabbitmq:
# host: 192.168.19.205
# host: 127.0.0.1
# port: 5672
......
......@@ -3,8 +3,8 @@ spring:
name: yudao-server
profiles:
# active: local
active: dev
active: local
# active: dev
main:
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
......@@ -253,9 +253,9 @@ yudao:
sender-rocketmq:
topic: ${spring.application.name}-websocket # 消息发送的 RocketMQ Topic
consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 RocketMQ Consumer Group
sender-rabbitmq:
exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchange
queue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queue
# sender-rabbitmq:
# exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchange
# queue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queue
sender-kafka:
topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic
consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
......@@ -378,6 +378,7 @@ ptauth:
logOffTokenAndJump: http://59.195.13.243:8000/oauth/oauth/logout?redirect_uri=
appkey: 2ae50f22f14946c1b6d288a848c6a8fd
redirect_uri: https://59.195.13.208
# redirect_uri: http://192.168.110.102
basicinfo:
userInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/user-info-list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment