chore: register device types explicitly

This commit is contained in:
Eli Yip 2025-05-29 09:39:12 +08:00
parent 5a6649e99c
commit 1280a1a3f3
No known key found for this signature in database
GPG Key ID: C98B69D4CF7D7EC5
2 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,7 @@ package models
import "hands/device"
func init() {
func RegisterDeviceTypes() {
// 注册 L10 设备类型
device.RegisterDeviceType("L10", NewL10Hand)
}

View File

@ -93,6 +93,8 @@ func main() {
MaxAge: 12 * time.Hour,
}))
models.RegisterDeviceTypes()
// 设置 API 路由
api2.NewServer(device.NewDeviceManager()).SetupRoutes(r)