feat(api): Telegram

This commit is contained in:
web@ppanel
2024-12-25 10:52:00 +07:00
parent bca0935063
commit 17ce96a423
27 changed files with 82 additions and 28 deletions
+5
View File
@@ -27,6 +27,11 @@ declare namespace API {
ios: Application[];
};
type BindTelegramResponse = {
url: string;
expired_at: number;
};
type CheckoutOrderRequest = {
orderNo: string;
};
+19
View File
@@ -24,6 +24,17 @@ export async function queryUserBalanceLog(options?: { [key: string]: any }) {
);
}
/** Bind Telegram GET /v1/public/user/bind_telegram */
export async function bindTelegram(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.BindTelegramResponse }>(
'/v1/public/user/bind_telegram',
{
method: 'GET',
...(options || {}),
},
);
}
/** Query User Info GET /v1/public/user/info */
export async function queryUserInfo(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.User }>('/v1/public/user/info', {
@@ -87,3 +98,11 @@ export async function queryUserSubscribe(options?: { [key: string]: any }) {
},
);
}
/** Unbind Telegram POST /v1/public/user/unbind_telegram */
export async function unbindTelegram(options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/unbind_telegram', {
method: 'POST',
...(options || {}),
});
}