---
name: "getGroupDpsInfos"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getGroupDpsInfos - 获取群组设备所有 DP 信息"
---

## getGroupDpsInfos

> [VERSION] @ray-js/ray >= 1.5.2

### 描述

获取群组设备所有 DP 信息，通常用于获取群组设备 DP 名称，配合 updateGroupDpName 使用

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `groupId` | `string` | 是 | 群组 ID |

### 返回值

类型: `Promise<IGetGroupDpsInfosResponse>`

DP 信息对象，包含 code、dpId、value、name、time、type

##### IGetGroupDpsInfosResponse

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `code` | `string` | DP Code |
| `dpId` | `number` | DP ID |
| `value` | `string` | DP 值 |
| `name` | `string` | DP 名称 |
| `time` | `number` | DP 最近上报时间 |
| `type` | `string` | DP 类型 |

### 示例代码

#### 基础用法

```ts
import { getGroupDpsInfos } from '@ray-js/ray';

getGroupDpsInfos('1').then((response) => {
  console.log('群组 DP 信息:', response);
}).catch((err) => {
  console.error(err);
});
```
