2.6.9 • Published 5 days ago

@dhicn/domain-paas-sdk-ts v2.6.9

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

Version License

这是一个DHI 中国 业务中台 的 Client SDK 开发辅助包,帮您快速通过我们的业务中台构建应用。

🔆 功能清单

  • identity-service 用户认证管理服务
  • scenario-service 方案管理管理服务
  • message-service 消息服务
  • document-service 文档服务
  • scenario-compute-service 方案计算服务
  • model-driver-service 模型计算服务
  • result-analysis-service 结果分析服务
  • model-information-service 模型分析服务
  • model-configuration-service 模型计算服务
  • text-search-service 全文搜索服务
  • device-management-service 资产设备服务
  • accident-management-service 事故管理服务
  • digital-twin-service 模型映射服务
  • iot-service IoT 服务
  • wwtp-domain-main-bus-service 污水业务中台基础服务
  • wwtp-domain-infrastructure-service 污水业务中台邻域服务
  • wd-domain-service 供水业务中台邻域服务
  • log-service 日志服务
  • data-center-service 数据中台服务
  • plugin-service 插件服务
  • file-service 文件服务

🌏 第三方依赖

axios axios qs axios

📦 安装

$ npm install @dhicn/domain-paas-sdk-ts

🔨 使用

需要先联系我们获取的 DHI 中国 业务中台 使用许可和认证信息。

基础使用

import { Helper, IdentityServiceApi } from '@dhicn/domain-paas-sdk-ts'

export class ApiHelperExtend extends Helper.ApiHelper {
  userApi: IdentityServiceApi.UsersMnangerApi
  scenarioGroup: ScenarioServiceApi.ScenarioGroupApi
  // ...自定义需要使用API
  constructor() {
    super()
    // 在构造函数中实例化对应API,需要传入API访问前缀和axios实例
    this.userApi = new IdentityServiceApi.UsersMnangerApi(
      DomainServiceUrlMap.identity,
      this.axiosInstance,
    )
    this.scenarioGroup = new ScenarioServiceApi.ScenarioGroupApi(
      DomainServiceUrlMap.scenario,
      this.axiosInstance,
    )
    // ...这里可以对 AxiosInstance 进行自行修改
  }
}
const apiHelper = new ApiHelperExtend()
// 根据业务中台使用许可
const { tenantId, client_id, grant_type, client_secret, username, password } = tokenParas
// 登录,登录成功后自动设置Token和TenantId
await apiHelper.logIn(tenantId, client_id, grant_type, client_secret, username, password)
// 登录成功后可以,使用其他API,例如通过Token获取登录用户-权限信息
await apiHelper.userApi.apiAppUsersMnangerUserPersGet()

分文件引用

import { ApiHelper, DomainServiceUrlMap } from '@dhicn/domain-paas-sdk-ts/sdk-helper'
import { UsersMnangerApi } from '@dhicn/domain-paas-sdk-ts/identity-service'
import { ScenarioGroupApi } from '@dhicn/domain-paas-sdk-ts/scenario-service'

export class ApiHelperExtend extends Helper.ApiHelper {
  userApi: IdentityServiceApi.UsersMnangerApi
  scenarioGroup: ScenarioServiceApi.ScenarioGroupApi
  // ...自定义需要使用API
  constructor() {
    super()
    // 在构造函数中实例化对应API,需要传入API访问前缀和axios实例
    this.userApi = new IdentityServiceApi.UsersMnangerApi(
      DomainServiceUrlMap.identity,
      this.axiosInstance,
    )
    this.scenarioGroup = new ScenarioServiceApi.ScenarioGroupApi(
      DomainServiceUrlMap.scenario,
      this.axiosInstance,
    )
    // ...这里可以对 AxiosInstance 进行自行修改
  }
}
2.6.9

5 days ago

2.6.8

10 days ago

2.6.7

1 month ago

2.6.6

1 month ago

2.6.3

1 month ago

2.6.2

1 month ago

2.6.5

1 month ago

2.6.4

1 month ago

2.6.1

1 month ago

2.6.0

1 month ago

2.5.8

2 months ago

2.5.9

2 months ago

2.5.6

3 months ago

2.5.7

3 months ago

2.5.5

3 months ago

2.5.4

4 months ago

2.5.3

4 months ago

2.5.2

4 months ago

2.5.1

4 months ago

2.5.0

4 months ago

2.4.9

5 months ago

2.4.8

5 months ago

2.4.7

5 months ago

2.4.5

6 months ago

2.4.4

6 months ago

2.4.6

6 months ago

2.2.1

8 months ago

2.0.3

9 months ago

2.2.0

8 months ago

2.0.2

10 months ago

2.4.1

6 months ago

2.2.3

8 months ago

2.0.5

9 months ago

2.4.0

6 months ago

2.2.2

8 months ago

2.0.4

9 months ago

2.4.3

6 months ago

2.2.5

7 months ago

2.0.7

8 months ago

2.4.2

6 months ago

2.2.4

8 months ago

2.0.6

8 months ago

2.2.7

7 months ago

2.0.9

8 months ago

2.2.6

7 months ago

2.0.8

8 months ago

2.0.1

10 months ago

2.0.0

11 months ago

2.3.8

7 months ago

2.3.7

7 months ago

2.1.9

8 months ago

2.3.9

7 months ago

2.3.0

7 months ago

2.1.2

8 months ago

2.1.1

8 months ago

2.3.2

7 months ago

2.1.4

8 months ago

2.3.1

7 months ago

2.1.3

8 months ago

2.3.4

7 months ago

2.1.6

8 months ago

2.3.3

7 months ago

2.1.5

8 months ago

2.3.6

7 months ago

2.1.8

8 months ago

2.3.5

7 months ago

2.1.7

8 months ago

2.1.0

8 months ago

2.2.9

7 months ago

2.2.8

7 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago