SimTsai / ics-dotnet-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

跨境无忧ICS dotnet SDK

Nuget

How to use

Non DI

  • app.config or web.config
<configuration>
  <configSections>
    <section name="ics" type="Ics.OpenApi.ConfigurationSection.IcsConfigurationSection, Ics.OpenApi"/>
  </configSections>
  <ics environment="Test" tokenStorageIn="Redis">
    <account
      user=""
      password="" />
    <redisOptions connectionString="192.168.1.223:6379" />
  </ics>
</configuration>
  • 使用
using var icsService =  IcsServiceFactory.CreateIcsService();

With DI (IServiceCollection)

  • in startup ConfigureServices
service.AddIcs()
  • appsettings.{?}.json
{
  "Ics": {
    "Environment": "Test",  // 连接ICS的环境 Test OR Production
    "Account": { // ICS提供的账号信息
        "User": "",
        "Password": ""
    },
    "TokenStorageIn": "Redis", // Token存储位置 Redis OR InMemory
    "InMemoryOptions": { // see also Microsoft.Extensions.Caching.Memory.MemoryCacheOptions
        "ExpirationScanFrequency": "",
        "SizeLimit": "",
        "CompactionPercentage": 
    },
    "RedisOptions": { // see also Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions
      "Configuration": "192.168.1.223:6379",
      "InstanceName": ""
    }
  }
}

已实现方法

接口文档 DI NonDI 实现版本
1.2 api获取令牌(token) - - 1.10.28-dev.1
2.1 获取报关单及制单明细 IIcsDeclareService
.GetDelegateAsync
IIcsService
.IcsDeclareService
.GetDelegateAsync
1.10.28-dev.1
2.2 发送报关单及申报明细 IIcsDeclareService
.TransferDelegateAsync
IIcsService
.IcsDeclareService
.TransferDelegateAsync
1.10.28-dev.2
2.4 发送审核状态 IIcsDeclareService
.TransferStatusAsync
IIcsService
.IcsDeclareService
.TransferStatusAsync
1.10.28-dev.2
2.5 获取报关单集装箱明细 IIcsDeclareService
.GetDelegateBoxAsync
IIcsService
.IcsDeclareService
.GetDelegateBoxAsync
1.10.28-dev.2
2.6 发送报关单集装箱明细 IIcsDeclareService
.TransferDelegateBoxAsync
IIcsService
.IcsDeclareService
.TransferDelegateBoxAsync
1.10.28-dev.2
2.7 获取随附单证 IIcsDeclareService
.GetBFSCicAsync
IIcsService
.IcsDeclareService
.GetBFSCicAsync
1.10.28-dev.2
2.8 发送随附单证 IIcsDeclareService
.TransferBFSCicAsync
IIcsService
.IcsDeclareService
.TransferBFSCicAsync
1.10.28-dev.2

About

License:MIT License


Languages

Language:C# 100.0%