| | |
| | | package com.ard.device.component.sdk.factory; |
| | | |
| | | import com.ard.device.component.sdk.common.FactoryType; |
| | | import com.ard.device.component.sdk.dh.service.impl.DaHuaSDK; |
| | | import com.ard.device.component.sdk.hik.service.impl.HikVisionSDK; |
| | | import com.ard.device.component.sdk.service.CameraSDK; |
| | |
| | | * @throws IllegalArgumentException 如果传入的工厂参数不支持 |
| | | */ |
| | | public CameraSDK createCameraSDK(String factory) { |
| | | if (factory.equals("1")) { |
| | | return hikvisionSDK; |
| | | } else if (factory.equals("2")) { |
| | | return dahuaSDK; |
| | | } else { |
| | | throw new IllegalArgumentException("Unsupported device: " + factory); |
| | | FactoryType factoryType = FactoryType.fromCode(factory); |
| | | switch (factoryType) { |
| | | case HIKVISION: |
| | | return hikvisionSDK; |
| | | case DAHUA: |
| | | return dahuaSDK; |
| | | default: |
| | | throw new IllegalArgumentException("Unsupported device: " + factory); |
| | | } |
| | | } |
| | | } |