|
@@ -41,9 +41,9 @@ public class ExchangeController {
|
|
public R<?> getRemoteSecretKey() {
|
|
public R<?> getRemoteSecretKey() {
|
|
R<?> result = remoteAuthBaseService.getRemoteSecretKey();
|
|
R<?> result = remoteAuthBaseService.getRemoteSecretKey();
|
|
if (result.getCode() == 200) {
|
|
if (result.getCode() == 200) {
|
|
- return R.ok(result.getData().toString());
|
|
|
|
|
|
+ return R.ok(result.getData().toString(),"操作成功");
|
|
} else {
|
|
} else {
|
|
- return R.fail();
|
|
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -56,28 +56,26 @@ public class ExchangeController {
|
|
R<?> result = remoteAuthBaseService.loginRemote(form);
|
|
R<?> result = remoteAuthBaseService.loginRemote(form);
|
|
if (result.getCode() == 200) {
|
|
if (result.getCode() == 200) {
|
|
Map<String, Object> json = (Map<String, Object>) result.getData();
|
|
Map<String, Object> json = (Map<String, Object>) result.getData();
|
|
- return R.ok(json.get("access_token").toString());
|
|
|
|
|
|
+ return R.ok(json.get("access_token").toString(),"操作成功");
|
|
} else {
|
|
} else {
|
|
- return R.fail();
|
|
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// TODO: 2024/1/6 0006 数据业务校验
|
|
// TODO: 2024/1/6 0006 数据业务校验
|
|
- @PostMapping("/dataCheck")
|
|
|
|
|
|
+ @PostMapping("/straightPushData")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public R<?> dataCheck(@RequestBody List<DataExchangeEntity> list) {
|
|
public R<?> dataCheck(@RequestBody List<DataExchangeEntity> list) {
|
|
- boolean flag = list.stream()
|
|
|
|
- .allMatch(item -> item.getId() != null && StringUtils.isNotEmpty(item.getName()));
|
|
|
|
- if (flag) {
|
|
|
|
|
|
+ if (!redisService.hasKey("login_tokens")) {
|
|
// TODO: 2024/1/6 0006 推送数据 调用event保存
|
|
// TODO: 2024/1/6 0006 推送数据 调用event保存
|
|
R<?> result = remoteEventBaseService.saveDataExchangeEntity(list);
|
|
R<?> result = remoteEventBaseService.saveDataExchangeEntity(list);
|
|
- if (result.getCode() == 200) {
|
|
|
|
- return R.ok();
|
|
|
|
- } else {
|
|
|
|
- return R.fail("事件存储失败");
|
|
|
|
- }
|
|
|
|
|
|
+// if (result.getCode() == 200) {
|
|
|
|
+ return R.ok("操作成功");
|
|
|
|
+// } else {
|
|
|
|
+// return R.fail("操作失败");
|
|
|
|
+// }
|
|
} else {
|
|
} else {
|
|
- return R.fail("验证失败");
|
|
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,9 +87,9 @@ public class ExchangeController {
|
|
R<?> result = remoteEventBaseService.subscribeTo();
|
|
R<?> result = remoteEventBaseService.subscribeTo();
|
|
if (result.getCode() == 200) {
|
|
if (result.getCode() == 200) {
|
|
redisService.deleteObject("eventKey");
|
|
redisService.deleteObject("eventKey");
|
|
- return R.ok();
|
|
|
|
|
|
+ return R.ok("操作成功");
|
|
} else {
|
|
} else {
|
|
- return R.fail();
|
|
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -110,7 +108,7 @@ public class ExchangeController {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.info("远程调用119报错");
|
|
log.info("远程调用119报错");
|
|
}
|
|
}
|
|
- return R.ok();
|
|
|
|
|
|
+ return R.ok("操作成功");
|
|
} else {
|
|
} else {
|
|
R<?> result = remoteEventBaseService.getDataSubscribeTo();
|
|
R<?> result = remoteEventBaseService.getDataSubscribeTo();
|
|
List<String> urlList = (List<String>) result.getData();
|
|
List<String> urlList = (List<String>) result.getData();
|
|
@@ -123,9 +121,9 @@ public class ExchangeController {
|
|
log.info("远程调用119报错");
|
|
log.info("远程调用119报错");
|
|
}
|
|
}
|
|
redisService.setCacheList("eventKey", urlList);
|
|
redisService.setCacheList("eventKey", urlList);
|
|
- return R.ok();
|
|
|
|
|
|
+ return R.ok("操作成功");
|
|
} else {
|
|
} else {
|
|
- return R.fail("查询订阅失败");
|
|
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|