新增处理

This commit is contained in:
2024-12-24 13:44:52 +08:00
parent 78d1dfeeca
commit 6e4b37776b
6 changed files with 108 additions and 17 deletions

13
main.go
View File

@@ -21,7 +21,7 @@ func init() {
viper.InitViper()
logger.InitLogger()
gorm.InitGorm()
//gorm.AutoMigrate(global.Db)
gorm.AutoMigrate(global.Db)
}
func main() {
@@ -77,10 +77,15 @@ func main() {
// 客户端回复 {"Type":"ota","State":"1"}
// 开始实时上传数据
// 服务端发 {"Type":"start"}
// 客户端回复 {"Type":"start","Data":"{\"Type\":\"ota\",\"Ip\":\"192.168.31.1:80\",\"File\":\"/xxx/1.bin\"}"}
// 服务端发 {\"Type\":\"start\"}
// 客户端回复 {"Type":"start","Data":"{\"Type\":\"ota\",\"Ip\":\"192.168.31.1:80\",\"File\":\"/xxx/1.bin\"}"}
// 停止实时上传数据
// 服务端发 {"Type":"stop"}
// 服务端发 {\"Type\":\"stop\"}
// 客户端回复 {"Type":"stop","State":"1"}
// 修改IP端口
// 服务端发 {\"Type\":\"server\",\"Ip\":\"1222\",\"Port\":\"1222\"}
// 客户端回复 {"Type":"server","State":"1"}
//{\n\t"Type":"ping"}