From 9dd6f600dcae7bbd333b07ec097551178a432ab3 Mon Sep 17 00:00:00 2001 From: lijiazhuo <13787924+lijiazhuosky@user.noreply.gitee.com> Date: Mon, 19 Jan 2026 14:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 ++ .../sso/controller/ControllerTuiSongs.java | 87 +++++++++++++++++++ src/main/resources/logback-spring.xml | 39 +++++++++ 3 files changed, 131 insertions(+) create mode 100644 src/main/java/com/example/sso/controller/ControllerTuiSongs.java create mode 100644 src/main/resources/logback-spring.xml diff --git a/pom.xml b/pom.xml index f9445b9..b5dbdd1 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,11 @@ httpmime 4.5.13 + + org.projectlombok + lombok + true + diff --git a/src/main/java/com/example/sso/controller/ControllerTuiSongs.java b/src/main/java/com/example/sso/controller/ControllerTuiSongs.java new file mode 100644 index 0000000..bae28f4 --- /dev/null +++ b/src/main/java/com/example/sso/controller/ControllerTuiSongs.java @@ -0,0 +1,87 @@ +package com.example.sso.controller; + +import com.alibaba.fastjson.JSONObject; +import com.example.sso.dao.CarInfo; +import com.example.sso.util.TimeUtils; +import com.example.sso.util.V5utils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Slf4j +public class ControllerTuiSongs { + + @PostMapping("/infos") + public JSONObject createUser(@RequestBody JSONObject carInfo) { + log.info("我是新的infos数据 "+ carInfo.toJSONString() ); + String EntryExitDirection = carInfo.getString("EntryExitDirection"); + String CarNumber = carInfo.getString("CarNumber"); + String ParkingName = carInfo.getString("ParkingName"); + String Remarks = carInfo.getString("Remarks"); + String EventTime = carInfo.getString("EventTime"); + String VehicleType = carInfo.getString("VehicleType"); + String LaneName = carInfo.getString("LaneName"); + String model = carInfo.getString("model"); + String EventName = carInfo.getString("EventName"); + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("app_id", "67ab0e4982b769eeef25219b"); + jsonObject.put("entry_id", "694b46ac2b2ce8cf41ad5cb5"); + jsonObject.put("is_start_trigger", true); + JSONObject data = new JSONObject(); + + JSONObject parkingld = new JSONObject(); + parkingld.put("value", ParkingName); + data.put("parkingname", parkingld); + + JSONObject parkingnume = new JSONObject(); + parkingnume.put("value", CarNumber); + data.put("carnumber", parkingnume); + + JSONObject recordld = new JSONObject(); + recordld.put("value", LaneName); + data.put("lanename", recordld); + + + JSONObject releasetype = new JSONObject(); + releasetype.put("value", EventName); + data.put("eventname", releasetype); + + JSONObject cartypeld = new JSONObject(); + cartypeld.put("value", EntryExitDirection); + data.put("entryexitdirection", cartypeld); + + JSONObject carmodelld = new JSONObject(); + carmodelld.put("value", VehicleType); + data.put("vehicletype", carmodelld); + + JSONObject inlmg = new JSONObject(); + inlmg.put("value", model); + data.put("modeltype", inlmg); + + JSONObject outlmg = new JSONObject(); + outlmg.put("value", EventTime); + data.put("eventtime", outlmg); + + JSONObject entertype = new JSONObject(); + entertype.put("value", Remarks); + data.put("remarks", entertype); + + + + jsonObject.put("data", data); + String jsonString = jsonObject.toJSONString(); + V5utils.add(jsonString); + + + + + + JSONObject object = new JSONObject(); + object.put("status", "1"); + object.put("message", "成功"); + return object; + } +} diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..c57a06f --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,39 @@ + + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + ${LOG_PATH}/${LOG_FILE}.log + + + + + ${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd}.log + + ${MAX_HISTORY} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + true + + + + + + + \ No newline at end of file