| | |
| | | package controller |
| | | |
| | | import ( |
| | | "gat1400Exchange/service" |
| | | "gat1400Exchange/nvcs" |
| | | "github.com/gin-gonic/gin" |
| | | "net/http" |
| | | ) |
| | |
| | | } |
| | | |
| | | func (n NVCSController) RunStatus(c *gin.Context) { |
| | | var runStatus = make(map[string]string, 0) |
| | | runStatus["floor"] = service.ElevatorRunFloor |
| | | var runState = nvcs.CurrentRunState() |
| | | |
| | | switch service.ElevatorRunState { |
| | | case 0: |
| | | runStatus["status"] = "停" |
| | | case 1: |
| | | runStatus["status"] = "上" |
| | | case 2: |
| | | runStatus["status"] = "下" |
| | | } |
| | | |
| | | c.JSON(http.StatusOK, gin.H{"success": true, "data": runStatus, "msg": "ok"}) |
| | | c.JSON(http.StatusOK, gin.H{"success": true, "data": runState, "msg": "ok"}) |
| | | } |