---
name: "updateAstronomicalStatus"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "updateAstronomicalStatus - 是否启用天文定时"
---

## updateAstronomicalStatus

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

### 描述

修改天文定时使能状态

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `IUpdateAstronomicalStatus` | 是 | 请求参数 |

### 返回值

类型: `Promise<boolean>`

是否成功修改状态

### 引用对象

##### `interface` IUpdateAstronomicalStatus

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `id` | `string` | 定时任务 ID |
| `status` | `number` | 0：关闭。1：开启 |


### 示例代码

#### 基础用法

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

updateAstronomicalStatus({
  id: '8642566',
  status: 0,
}).then((response) => {
  console.log('修改状态结果:', response);
}).catch((err) => {
  console.error(err);
});
```
