Commit ac9a3783 by 胡懿

修复iotdb session连接错误的问题

parent 8d027b10
...@@ -12,6 +12,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate; ...@@ -12,6 +12,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.security.PermitAll;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -23,6 +24,7 @@ public class DeviceLogInfoController { ...@@ -23,6 +24,7 @@ public class DeviceLogInfoController {
@Autowired @Autowired
private IotDbConfig iotDbConfig; private IotDbConfig iotDbConfig;
@PermitAll
@PostMapping("/saveDeviceLogInfo") @PostMapping("/saveDeviceLogInfo")
@Operation(summary = "外部性请求保存日志") @Operation(summary = "外部性请求保存日志")
public CommonResult<String> saveDeviceLogInfo(@RequestBody DeviceLogInfo deviceLogInfo) { public CommonResult<String> saveDeviceLogInfo(@RequestBody DeviceLogInfo deviceLogInfo) {
...@@ -33,6 +35,8 @@ public class DeviceLogInfoController { ...@@ -33,6 +35,8 @@ public class DeviceLogInfoController {
rabbitTemplate.convertAndSend("my_boot_topic_exchange", "devicelog.save", deviceLogInfoStr); rabbitTemplate.convertAndSend("my_boot_topic_exchange", "devicelog.save", deviceLogInfoStr);
return CommonResult.success("保存成功"); return CommonResult.success("保存成功");
} }
@PermitAll
@PostMapping("/saveDeviceLogInfoList") @PostMapping("/saveDeviceLogInfoList")
@Operation(summary = "外部性请求保存日志") @Operation(summary = "外部性请求保存日志")
public CommonResult<String> saveDeviceLogInfoList(@RequestBody List<DeviceLogInfo> deviceLogInfoList) { public CommonResult<String> saveDeviceLogInfoList(@RequestBody List<DeviceLogInfo> deviceLogInfoList) {
......
...@@ -12,6 +12,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate; ...@@ -12,6 +12,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.security.PermitAll;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -28,6 +29,11 @@ public class WebLogInfoController { ...@@ -28,6 +29,11 @@ public class WebLogInfoController {
@Operation(summary = "初始化数据库") @Operation(summary = "初始化数据库")
public CommonResult<String> initIotDBDatabase() { public CommonResult<String> initIotDBDatabase() {
MyIotDbUtils.createDatabase(iotDbConfig); MyIotDbUtils.createDatabase(iotDbConfig);
MyIotDbUtils.createWebLogInfoTimeseries(iotDbConfig);
MyIotDbUtils.createIllegalLogTimeseries(iotDbConfig);
FileIotDbUtil.createFileLogInfoTimeseries(iotDbConfig);
SpecialPeopleIotDbUtils.createSpeLogInfoTimeseries(iotDbConfig);
JarDecLogIotDbUtil.createJarDecLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功"); return CommonResult.success("初始化成功");
} }
...@@ -65,6 +71,7 @@ public class WebLogInfoController { ...@@ -65,6 +71,7 @@ public class WebLogInfoController {
return CommonResult.success("初始化成功"); return CommonResult.success("初始化成功");
} }
@PermitAll
@PostMapping("/saveWebLogInfo") @PostMapping("/saveWebLogInfo")
@Operation(summary = "外部性请求保存日志") @Operation(summary = "外部性请求保存日志")
public CommonResult<String> saveWebLogInfo(@RequestBody WebLogInfo webLogInfo) { public CommonResult<String> saveWebLogInfo(@RequestBody WebLogInfo webLogInfo) {
......
...@@ -22,13 +22,12 @@ import java.util.List; ...@@ -22,13 +22,12 @@ import java.util.List;
* 重要文件访问日志 * 重要文件访问日志
*/ */
public class FileIotDbUtil { public class FileIotDbUtil {
private static SessionPool sessionPool;
public static void createFileLogInfoTimeseries(IotDbConfig iotDbConfig) { public static void createFileLogInfoTimeseries(IotDbConfig iotDbConfig) {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -61,7 +60,7 @@ public class FileIotDbUtil { ...@@ -61,7 +60,7 @@ public class FileIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -119,7 +118,7 @@ public class FileIotDbUtil { ...@@ -119,7 +118,7 @@ public class FileIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -175,7 +174,7 @@ public class FileIotDbUtil { ...@@ -175,7 +174,7 @@ public class FileIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -183,7 +182,7 @@ public class FileIotDbUtil { ...@@ -183,7 +182,7 @@ public class FileIotDbUtil {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (fileDecLogInfo.getPageNum() - 1) * fileDecLogInfo.getPageSize() + 1; int offsetNum = (fileDecLogInfo.getPageNum() - 1) * fileDecLogInfo.getPageSize();
int limitNum = fileDecLogInfo.getPageSize(); int limitNum = fileDecLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select userId, username, sysAbbre, content, privateKey, clientIp, fileName, fileId from root.myDecFileLogInfo.decFileLog"); sb.append("select userId, username, sysAbbre, content, privateKey, clientIp, fileName, fileId from root.myDecFileLogInfo.decFileLog");
......
...@@ -18,7 +18,6 @@ import java.util.Random; ...@@ -18,7 +18,6 @@ import java.util.Random;
public class IotDBUtil { public class IotDBUtil {
private static SessionPool sessionPool;
public static void main(String[] args) { public static void main(String[] args) {
select(); select();
...@@ -30,7 +29,7 @@ public class IotDBUtil { ...@@ -30,7 +29,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -53,7 +52,7 @@ public class IotDBUtil { ...@@ -53,7 +52,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -99,7 +98,7 @@ public class IotDBUtil { ...@@ -99,7 +98,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -124,7 +123,7 @@ public class IotDBUtil { ...@@ -124,7 +123,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -158,7 +157,7 @@ public class IotDBUtil { ...@@ -158,7 +157,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -211,7 +210,7 @@ public class IotDBUtil { ...@@ -211,7 +210,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
...@@ -263,7 +262,7 @@ public class IotDBUtil { ...@@ -263,7 +262,7 @@ public class IotDBUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add("192.168.19.128:6667"); nodeUrls.add("192.168.19.128:6667");
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user("root") .user("root")
......
...@@ -18,13 +18,11 @@ import java.util.List; ...@@ -18,13 +18,11 @@ import java.util.List;
public class JarDecLogIotDbUtil { public class JarDecLogIotDbUtil {
private static SessionPool sessionPool;
public static void createJarDecLogInfoTimeseries(IotDbConfig iotDbConfig) { public static void createJarDecLogInfoTimeseries(IotDbConfig iotDbConfig) {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -57,7 +55,7 @@ public class JarDecLogIotDbUtil { ...@@ -57,7 +55,7 @@ public class JarDecLogIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -111,7 +109,7 @@ public class JarDecLogIotDbUtil { ...@@ -111,7 +109,7 @@ public class JarDecLogIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -167,7 +165,7 @@ public class JarDecLogIotDbUtil { ...@@ -167,7 +165,7 @@ public class JarDecLogIotDbUtil {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -175,7 +173,7 @@ public class JarDecLogIotDbUtil { ...@@ -175,7 +173,7 @@ public class JarDecLogIotDbUtil {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (jarDecLogInfo.getPageNum() - 1) * jarDecLogInfo.getPageSize() + 1; int offsetNum = (jarDecLogInfo.getPageNum() - 1) * jarDecLogInfo.getPageSize();
int limitNum = jarDecLogInfo.getPageSize(); int limitNum = jarDecLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select userId, username, sysAbbre, content, privateKey, clientIp, type from root.myDecFileLogInfo.jarDecLog"); sb.append("select userId, username, sysAbbre, content, privateKey, clientIp, type from root.myDecFileLogInfo.jarDecLog");
......
...@@ -18,7 +18,6 @@ import java.util.ArrayList; ...@@ -18,7 +18,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class MyIotDbUtils { public class MyIotDbUtils {
private static SessionPool sessionPool;
// 创建数据库 // 创建数据库
public static void createDatabase(IotDbConfig iotDbConfig) { public static void createDatabase(IotDbConfig iotDbConfig) {
...@@ -26,7 +25,7 @@ public class MyIotDbUtils { ...@@ -26,7 +25,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -47,7 +46,7 @@ public class MyIotDbUtils { ...@@ -47,7 +46,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -77,7 +76,7 @@ public class MyIotDbUtils { ...@@ -77,7 +76,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -112,7 +111,7 @@ public class MyIotDbUtils { ...@@ -112,7 +111,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -167,7 +166,7 @@ public class MyIotDbUtils { ...@@ -167,7 +166,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -223,7 +222,7 @@ public class MyIotDbUtils { ...@@ -223,7 +222,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -296,7 +295,7 @@ public class MyIotDbUtils { ...@@ -296,7 +295,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -304,7 +303,7 @@ public class MyIotDbUtils { ...@@ -304,7 +303,7 @@ public class MyIotDbUtils {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (webLogInfoVo.getPageNum() - 1) * webLogInfoVo.getPageSize() + 1; int offsetNum = (webLogInfoVo.getPageNum() - 1) * webLogInfoVo.getPageSize();
int limitNum = webLogInfoVo.getPageSize(); int limitNum = webLogInfoVo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select userId, username, sysAbbre, url, accessed, type, clientIp, remark from root.myWebLogInfo.tableTwo"); sb.append("select userId, username, sysAbbre, url, accessed, type, clientIp, remark from root.myWebLogInfo.tableTwo");
...@@ -399,7 +398,7 @@ public class MyIotDbUtils { ...@@ -399,7 +398,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -478,7 +477,7 @@ public class MyIotDbUtils { ...@@ -478,7 +477,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -486,7 +485,7 @@ public class MyIotDbUtils { ...@@ -486,7 +485,7 @@ public class MyIotDbUtils {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (webLogInfoVo.getPageNum() - 1) * webLogInfoVo.getPageSize() + 1; int offsetNum = (webLogInfoVo.getPageNum() - 1) * webLogInfoVo.getPageSize();
int limitNum = webLogInfoVo.getPageSize(); int limitNum = webLogInfoVo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select userId, username, sysAbbre, url, accessed, type, clientIp, remark, illType from root.myWebLogInfo.tableThree"); sb.append("select userId, username, sysAbbre, url, accessed, type, clientIp, remark, illType from root.myWebLogInfo.tableThree");
...@@ -591,7 +590,7 @@ public class MyIotDbUtils { ...@@ -591,7 +590,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -624,7 +623,7 @@ public class MyIotDbUtils { ...@@ -624,7 +623,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -662,7 +661,7 @@ public class MyIotDbUtils { ...@@ -662,7 +661,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -745,7 +744,7 @@ public class MyIotDbUtils { ...@@ -745,7 +744,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -826,7 +825,7 @@ public class MyIotDbUtils { ...@@ -826,7 +825,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -891,7 +890,7 @@ public class MyIotDbUtils { ...@@ -891,7 +890,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -899,7 +898,7 @@ public class MyIotDbUtils { ...@@ -899,7 +898,7 @@ public class MyIotDbUtils {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (deviceLogInfo.getPageNum() - 1) * deviceLogInfo.getPageSize() + 1; int offsetNum = (deviceLogInfo.getPageNum() - 1) * deviceLogInfo.getPageSize();
int limitNum = deviceLogInfo.getPageSize(); int limitNum = deviceLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, type, clientIp, remark from root.myDeviceLogInfo.tableOne"); sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, type, clientIp, remark from root.myDeviceLogInfo.tableOne");
...@@ -998,7 +997,7 @@ public class MyIotDbUtils { ...@@ -998,7 +997,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -1063,7 +1062,7 @@ public class MyIotDbUtils { ...@@ -1063,7 +1062,7 @@ public class MyIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -1071,7 +1070,7 @@ public class MyIotDbUtils { ...@@ -1071,7 +1070,7 @@ public class MyIotDbUtils {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (deviceIllLogInfo.getPageNum() - 1) * deviceIllLogInfo.getPageSize() + 1; int offsetNum = (deviceIllLogInfo.getPageNum() - 1) * deviceIllLogInfo.getPageSize();
int limitNum = deviceIllLogInfo.getPageSize(); int limitNum = deviceIllLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, illType, clientIp, remark from root.myDeviceLogInfo.tableTwo"); sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, illType, clientIp, remark from root.myDeviceLogInfo.tableTwo");
......
...@@ -20,13 +20,12 @@ import java.util.List; ...@@ -20,13 +20,12 @@ import java.util.List;
* 重点、特殊人群解密日志揭露 * 重点、特殊人群解密日志揭露
*/ */
public class SpecialPeopleIotDbUtils { public class SpecialPeopleIotDbUtils {
private static SessionPool sessionPool;
public static void createSpeLogInfoTimeseries(IotDbConfig iotDbConfig) { public static void createSpeLogInfoTimeseries(IotDbConfig iotDbConfig) {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -58,7 +57,7 @@ public class SpecialPeopleIotDbUtils { ...@@ -58,7 +57,7 @@ public class SpecialPeopleIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -109,7 +108,7 @@ public class SpecialPeopleIotDbUtils { ...@@ -109,7 +108,7 @@ public class SpecialPeopleIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -165,7 +164,7 @@ public class SpecialPeopleIotDbUtils { ...@@ -165,7 +164,7 @@ public class SpecialPeopleIotDbUtils {
try { try {
List<String> nodeUrls = new ArrayList<>(); List<String> nodeUrls = new ArrayList<>();
nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort()); nodeUrls.add(iotDbConfig.getIp() + ":" + iotDbConfig.getPort());
sessionPool = SessionPool sessionPool =
new SessionPool.Builder() new SessionPool.Builder()
.nodeUrls(nodeUrls) .nodeUrls(nodeUrls)
.user(iotDbConfig.getUsername()) .user(iotDbConfig.getUsername())
...@@ -173,7 +172,7 @@ public class SpecialPeopleIotDbUtils { ...@@ -173,7 +172,7 @@ public class SpecialPeopleIotDbUtils {
.maxSize(3) .maxSize(3)
.build(); .build();
int offsetNum = (spePeoLogInfo.getPageNum() - 1) * spePeoLogInfo.getPageSize() + 1; int offsetNum = (spePeoLogInfo.getPageNum() - 1) * spePeoLogInfo.getPageSize();
int limitNum = spePeoLogInfo.getPageSize(); int limitNum = spePeoLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select userId, username, sysAbbre, content, privateKey, clientIp from root.myDecFileLogInfo.speLog"); sb.append("select userId, username, sysAbbre, content, privateKey, clientIp from root.myDecFileLogInfo.speLog");
......
...@@ -4512,7 +4512,7 @@ COMMENT ON TABLE yudao_demo01_contact IS '示例联系人表'; ...@@ -4512,7 +4512,7 @@ COMMENT ON TABLE yudao_demo01_contact IS '示例联系人表';
-- ---------------------------- -- ----------------------------
-- @formatter:off -- @formatter:off
BEGIN; BEGIN;
INSERT INTO yudao_demo01_contact (id, name, sex, birthday, description, avatar, creator, create_time, updater, update_time, deleted, tenant_id) VALUES (1, '土豆', 2, '2023-11-07 00:00:00', '<p>天蚕土豆!呀</p>', 'http://127.0.0.1:48080/admin-api/infra/file/4/get/46f8fa1a37db3f3960d8910ff2fe3962ab3b2db87cf2f8ccb4dc8145b8bdf237.jpeg', '1', '2023-11-15 23:34:30', '1', '2023-11-15 23:47:39', '0', 1); INSERT INTO yudao_demo01_contact (id, name, sex, birthday, description, avatar, creator, create_time, updater, update_time, deleted, tenant_id) VALUES (1, 'aaa', 2, '2023-11-07 00:00:00', '<p>aaa</p>', 'http://127.0.0.1:48080/admin-api/infra/file/4/get/46f8fa1a37db3f3960d8910ff2fe3962ab3b2db87cf2f8ccb4dc8145b8bdf237.jpeg', '1', '2023-11-15 23:34:30', '1', '2023-11-15 23:47:39', '0', 1);
COMMIT; COMMIT;
-- @formatter:on -- @formatter:on
......
...@@ -189,6 +189,18 @@ public class AuthController { ...@@ -189,6 +189,18 @@ public class AuthController {
return success(authService.socialLogin(reqVO)); return success(authService.socialLogin(reqVO));
} }
// =======================================对接平台====================================================
@PostMapping("/ptLogin") @PostMapping("/ptLogin")
@PermitAll @PermitAll
@Operation(summary = "使用账号密码登录平台") @Operation(summary = "使用账号密码登录平台")
......
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