This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user