// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package route import ( "net/http" "property-device-gateway/controller/v1" "github.com/gin-gonic/gin" _ "property-device-gateway/docs" ) func SetupRoute(engine *gin.Engine) { // 404页面 engine.NoRoute(func(c *gin.Context) { c.String(http.StatusNotFound, "Not Found") }) c := v1.NewController() // version api := engine.Group("/api") { api.POST("/CheckCode", c.CodeGateCheckCode) api.POST("/IsConnect", c.CodeGateIsConnect) api.POST("/QueryCmd", c.CodeGateQueryCmd) api.POST("/QueryCmdPostData", c.CodeGateQueryCmdPostData) yufan := engine.Group("/yufan") yufan.POST("/heartbeat", c.YuFanHeartBeat) yufan.POST("/task", c.YuFanTaskGet) yufan.POST("/task_result", c.YuFanTaskResult) yufan.POST("/result", c.YuFanResultCallback) yufan.POST("/qcode", c.YufanQcodeCallback) } }