Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 1a661c0

Browse files
committed
refactor(github): 重构议题创建功能
- 将 send_an_issue 方法重命名为 create_issue,更符合语义 - 新增 CreateIssueResponseType 类型,用于表示创建议题的响应数据 - 移除 SendIssueResponseType 类型,统一命名
1 parent f121c71 commit 1a661c0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/models/platform/github/issue.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
import { Base } from '@/models/platform/github/base'
99
import type {
1010
ApiResponseType,
11+
CreateIssueResponseType,
1112
IssueInfoParamType,
1213
IssueInfoResponseType,
1314
issueListParamType,
1415
IssueListResponseType,
15-
SendIssueParamType,
16-
SendIssueResponseType
16+
SendIssueParamType
1717
} from '@/types'
1818

1919
/**
@@ -152,13 +152,13 @@ export class Issue extends Base {
152152
* @example
153153
* ```ts
154154
* const issue = get_issuc() // 获取issue实例
155-
* const res = await issue.send_an_issue({ owner: 'owner', repo:'repo', title:'title', body:'body' })
156-
* console.log(res) // { data: SendIssueResponseType }
155+
* const res = await issue.create_issue({ owner: 'owner', repo:'repo', title:'title', body:'body' })
156+
* console.log(res) // { data: CreateIssueResponseType }
157157
* ```
158158
*/
159-
public async send_an_issue (
159+
public async create_issue (
160160
options: SendIssueParamType
161-
): Promise<ApiResponseType<SendIssueResponseType>> {
161+
): Promise<ApiResponseType<CreateIssueResponseType>> {
162162
try {
163163
if (!options.owner || !options.repo) {
164164
throw new Error(NotParamMsg)

src/types/platform/github/issue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ export type SendIssueParamType = RepoBaseParamType & {
184184
}
185185

186186
/** 发送议题响应类型 */
187-
export type SendIssueResponseType = IssueListResponseType
187+
export type CreateIssueResponseType = IssueListResponseType

0 commit comments

Comments
 (0)