1 Star 0 Fork 185

左转右转/物联大师

forked from 杰神/物联大师 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
杰神 提交于 2024-04-14 23:33 . 更名为软网关
package master
import (
"github.com/spf13/viper"
"github.com/zgwit/iot-master/v4/api"
"github.com/zgwit/iot-master/v4/boot"
"github.com/zgwit/iot-master/v4/broker" //内置MQTT服务器
_ "github.com/zgwit/iot-master/v4/device" //设备
_ "github.com/zgwit/iot-master/v4/docs" //文档
_ "github.com/zgwit/iot-master/v4/gateway" //网关
_ "github.com/zgwit/iot-master/v4/modbus" //默认集成Modbus协议
_ "github.com/zgwit/iot-master/v4/product" //产品
_ "github.com/zgwit/iot-master/v4/project" //项目
_ "github.com/zgwit/iot-master/v4/protocol" //协议
_ "github.com/zgwit/iot-master/v4/space" //空间
_ "github.com/zgwit/iot-master/v4/user" //通道
"github.com/zgwit/iot-master/v4/web"
"path/filepath"
)
// @title 物联大师接口文档
// @version 4.0 版本
// @description API文档
// @BasePath /api/
// @InstanceName master
// @query.collection.format multi
func main() {}
func Startup() error {
err := boot.Startup()
if err != nil {
return err
}
//注册前端接口
api.RegisterRoutes(web.Engine.Group("/api"))
//注册接口文档
web.RegisterSwaggerDocs(&web.Engine.RouterGroup, "master")
//监听Websocket
web.Engine.GET("/mqtt", broker.GinBridge)
//附件
//web.Engine.Static("/static", "static")
web.Engine.Static("/attach", filepath.Join(viper.GetString("data"), "attach"))
//前端 移入子工程 github.com/iot-master-contrib/webui
//web.Static.Put("", http.FS(wwwFiles), "www", "index.html")
return nil
}
func Shutdown() error {
return boot.Shutdown()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/myzuozhuan/iot-master.git
git@gitee.com:myzuozhuan/iot-master.git
myzuozhuan
iot-master
物联大师
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385