From 528a7faa247573d8362c707222958db47dea5e15 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 08 八月 2024 20:18:39 +0800
Subject: [PATCH] python推送osd数据接口

---
 ycl-server/src/main/java/com/ycl/platform/controller/SynPY/SynPYController.java |   31 ++++++++++
 ycl-server/src/main/java/com/ycl/config/SecurityConfig.java                     |    2 
 ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java       |  144 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 177 insertions(+), 0 deletions(-)

diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java
new file mode 100644
index 0000000..549786a
--- /dev/null
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java
@@ -0,0 +1,144 @@
+package com.ycl.platform.domain.result.UY;
+
+import lombok.Data;
+import org.springframework.data.mongodb.core.annotation.Collation;
+
+/**
+ * python鑾峰彇osd鏁版嵁
+ *
+ * @author锛歺p
+ * @date锛�2024/8/8 19:35
+ */
+@Data
+@Collation("py_osd")
+public class PyOsdResult {
+
+    /**
+     * 鍥芥爣鐮�
+     */
+    private String deviceNo;
+
+    /**
+     * 鏉嗕綋缂栫爜
+     */
+    private String bodyNo;
+
+    /**
+     * 璁惧绫诲瀷
+     */
+    private String deviceType;
+
+    /**
+     * 鏃堕棿鏍煎紡
+     */
+    private String timeFormat;
+
+    private String ODS1;
+
+    private String ODS2;
+
+    /**
+     * ip
+     */
+    private String ip;
+
+    /**
+     * 鐪佸巺鑰冩牳
+     */
+    private String provinceCheck;
+
+    /**
+     * 鍏畨閮ㄨ�冩牳
+     */
+    private String policeCheck;
+
+    /**
+     * 鏂癐P
+     */
+    private String newIp;
+
+    /**
+     * ip鐘舵��
+     */
+    private String ipStatus;
+
+    /**
+     * 妫�娴嬫椂闂�
+     */
+    private String checkTime;
+
+    /**
+     * OSD妫�娴嬬姸鎬�
+     */
+    private String checkStatus;
+
+    /**
+     * 鏍囨敞鏃堕棿
+     */
+    private String setTime;
+
+    /**
+     * osd1鐪�
+     */
+    private String osd1Province;
+
+    /**
+     * osd1甯�
+     */
+    private String osd1City;
+
+    /**
+     * osd1鍖�
+     */
+    private String osd1Part;
+
+    /**
+     * osd1 宸︿笅瑙�
+     */
+    private String osd1LB;
+
+    /**
+     * osd1_osd
+     */
+    private String osd1OSD;
+
+    /**
+     * osd1_鏃堕棿鏍煎紡鏄惁姝g‘
+     */
+    private String osd1TimeFormat;
+
+    /**
+     * osd1_鐪佽缃�
+     */
+    private String osd1ProvinceSet;
+
+    /**
+     * osd1_甯傝缃�
+     */
+    private String osd1CitySet;
+
+    /**
+     * osd1_鍖鸿缃槸鍚�
+     */
+    private String osd1PartSet;
+
+    /**
+     * osd1_osd宸︿笅瑙掕缃槸鍚︽纭�
+     */
+    private String osd1OsdLbSet;
+
+    /**
+     * osd1_osd璁剧疆
+     */
+    private String osd1OsdSet;
+
+    /**
+     * osd1 鏃堕棿鏍煎紡
+     */
+    private String osd1TimeFormatSet;
+
+    /**
+     * ntp_server
+     */
+    private String ntpServer;
+}
diff --git a/ycl-server/src/main/java/com/ycl/config/SecurityConfig.java b/ycl-server/src/main/java/com/ycl/config/SecurityConfig.java
index 4afe5a2..b0cf630 100644
--- a/ycl-server/src/main/java/com/ycl/config/SecurityConfig.java
+++ b/ycl-server/src/main/java/com/ycl/config/SecurityConfig.java
@@ -98,6 +98,8 @@
                 .authorizeRequests()
                 // 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶
                 .requestMatchers("/login", "/register", "/captchaImage").permitAll()
+                // py鎺ㄩ�乸sd鏁版嵁鎺ュ彛
+                .requestMatchers("/py/syn/osd").permitAll()
                 // 闈欐�佽祫婧愶紝鍙尶鍚嶈闂�
                 .requestMatchers(HttpMethod.GET, "/", "/*.html", "/*/*.html", "/*/*.css", "/*/*.js",  "/profile/**").permitAll()
                 .requestMatchers("/swagger-ui.html", "/swagger-resources/*", "/webjars/*", "/*/api-docs", "/druid/*").permitAll()
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/SynPY/SynPYController.java b/ycl-server/src/main/java/com/ycl/platform/controller/SynPY/SynPYController.java
new file mode 100644
index 0000000..2270144
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/SynPY/SynPYController.java
@@ -0,0 +1,31 @@
+package com.ycl.platform.controller.SynPY;
+
+import com.ycl.platform.domain.result.UY.PyOsdResult;
+import com.ycl.system.Result;
+import lombok.RequiredArgsConstructor;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author锛歺p
+ * @date锛�2024/8/8 20:04
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/py/syn")
+public class SynPYController {
+
+    private final MongoTemplate mongoTemplate;
+
+    @PostMapping("/osd")
+    public Result pySynOSD(@RequestBody List<PyOsdResult> dataList) {
+        mongoTemplate.insertAll(dataList);
+        return Result.ok();
+    }
+
+}

--
Gitblit v1.8.0