using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2026 WenJY 保留所有权利。
* CLR版本:4.0.30319.42000
* 机器名称:T14-GEN3-7895
* 命名空间:Sln.Wcs.Api.Sdk.Config
* 唯一标识:f241e008-1718-4e55-824f-703286c352d6
*
* 创建者:WenJY
* 电子邮箱:
* 创建时间:2026-02-25 13:59:37
* 版本:V1.0.0
* 描述:
*
*--------------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本:V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace Sln.Wcs.Api.Sdk.Config
{
public class HikRoBotConfig
{
public readonly string api = "";
public readonly string partnerId;
public readonly string accesskey;
public readonly string secretkey;
public readonly string version;
public readonly string test;
///
/// 注入海康 SDK 配置参数
///
///
/// IConfiguration configuration
public HikRoBotConfig(IConfiguration configuration)
{
if (string.IsNullOrEmpty(configuration["sdk_api"]))
{
throw new Exception("sdk_api 配置不正确,请检查Apollo配置.");
}
if (string.IsNullOrEmpty(configuration["sdk_partner_id"]))
{
throw new Exception("sdk_partner_id 配置不正确,请检查Apollo配置.");
}
if (string.IsNullOrEmpty(configuration["sdk_accesskey"]))
{
throw new Exception("sdk_accesskey 配置不正确,请检查Apollo配置.");
}
if (string.IsNullOrEmpty(configuration["sdk_secretkey"]))
{
throw new Exception("sdk_secretkey 配置不正确,请检查Apollo配置.");
}
if (string.IsNullOrEmpty(configuration["sdk_partner_id"]))
{
throw new Exception("sdk_partner_id 配置不正确,请检查Apollo配置.");
}
if (string.IsNullOrEmpty(configuration["sdk_version"]))
{
throw new Exception("sdk_version 配置不正确,请检查Apollo配置.");
}
api = configuration["sdk_api"];
accesskey = configuration["sdk_accesskey"];
secretkey = configuration["sdk_secretkey"];
version = configuration["sdk_version"];
test = configuration["sdk_test"];
// api = "http://www.fangcang.com/tmc-hub/queryProductDetail";
// partnerId = "P10000408";
// accesskey = "";
// secretkey = "lwdmmuVfbKLRhgihMycWTz6T";
// version = "1.0.0";
}
}
}