|
@@ -1,6 +1,8 @@
|
|
|
package api
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
+ bus "github.com/ammeter/Bus"
|
|
|
"net/http"
|
|
|
|
|
|
"github.com/ammeter/util"
|
|
@@ -28,8 +30,11 @@ func RestServerStart() {
|
|
|
router.GET("/Gateway4G/UpdateDevcie", UpdateDevcie) // hello函数处理"/hello"请求
|
|
|
router.GET("/Gateway4G/ListDevices", ListDevices)
|
|
|
// 指定地址和端口号
|
|
|
- go router.Run(":10001")
|
|
|
+ Port := bus.GetFtpServerConfig(nil)
|
|
|
+ log.Infof("gin start. port:%d", Port+1)
|
|
|
+ go router.Run(fmt.Sprintf(":%d", Port+1))
|
|
|
}
|
|
|
+
|
|
|
func UpdateDevcie(c *gin.Context) {
|
|
|
AppID := c.Query("AppID")
|
|
|
AppSecret := c.Query("AppSecret")
|