新增设备类型选项接口
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-09-22 12:35:26 +08:00
parent 22c3e7cc1a
commit 4330b8a40c
28 changed files with 671 additions and 8 deletions

View File

@@ -324,6 +324,18 @@ func (s *Service) List(ctx context.Context, req *dto.ListDeviceRequest) (*dto.Li
}, nil
}
// ListDeviceTypes 查询平台管理端可用的设备类型选项。
func (s *Service) ListDeviceTypes(ctx context.Context) ([]string, error) {
types, err := s.deviceStore.ListDeviceTypes(ctx)
if err != nil {
return nil, errors.Wrap(errors.CodeDatabaseError, err, "查询设备类型选项失败")
}
if types == nil {
types = make([]string, 0)
}
return types, nil
}
func normalizeShopIDs(ids []uint) ([]uint, bool) {
if len(ids) == 0 {
return nil, false