From 5a7b37100578df7a766f6c92aaed6efe76fa55e9 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Tue, 16 Apr 2024 18:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6pc=E4=BB=BF=E7=9C=9F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/simulation.go | 4 ++-- third_party/train_pc_sim/example/main.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/simulation.go b/api/simulation.go index aea6025..f5887af 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -34,7 +34,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle authed.POST("/train/update", updateTrain) authed.POST("/train/control", controlTrain) authed.POST("/train/conn", trainConnThird) - authed.POST("/train/unconn/:trainId/:id", trainUnConnThird) + authed.DELETE("/train/unconn/:trainId/:id", trainUnConnThird) authed.GET("/train/conn/type/:id", trainConnTypeList) @@ -328,7 +328,7 @@ func trainConnThird(c *gin.Context) { // @Param id path string true "仿真id" // @Success 200 {object} dto.AddTrainRspDto // @Failure 500 {object} dto.ErrorDto -// @Router /api/v1/simulation/train/conn [post] +// @Router /api/v1/simulation/train/conn [delete] func trainUnConnThird(c *gin.Context) { trainId := c.Param("trainId") simId := c.Param("id") diff --git a/third_party/train_pc_sim/example/main.go b/third_party/train_pc_sim/example/main.go index e2e9222..b68228f 100644 --- a/third_party/train_pc_sim/example/main.go +++ b/third_party/train_pc_sim/example/main.go @@ -106,6 +106,8 @@ func main() { fmt.Println("接收驾驶端未激活") } else if msg.Type == train_pc_sim.SENDER_TRAIN_OUTR_INFO { fmt.Println("接受列车输出数字量", msg.Data[0], msg.Data[1]) + } else if msg.Type == train_pc_sim.RECIVE_TRAIN_CREATE_REMOVE { + fmt.Println("创建或删除列车") } })