压缩历史至 95081aff

This commit is contained in:
ryan
2026-06-08 20:34:27 +08:00
commit 8a782525de
435 changed files with 71146 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
/**
* 用户服务模块
*
* @description
* 提供用户个人设置相关的功能,包括:
* - 更新支付密钥
*
* @example
* ```typescript
* import { UserService } from '@/lib/services';
*
* // 更新支付密钥
* await UserService.updatePayKey('123456');
* ```
*/
export { UserService } from './user.service';
export type { UpdatePayKeyRequest } from './types';
+8
View File
@@ -0,0 +1,8 @@
/**
* 更新支付密钥请求
*/
export interface UpdatePayKeyRequest {
/** 新的支付密钥(6位数字) */
pay_key: string;
}
@@ -0,0 +1,30 @@
import { BaseService } from '../core/base.service';
/**
* 用户服务
* 处理用户个人设置相关的 API 请求
*/
export class UserService extends BaseService {
protected static readonly basePath = '/api/v1/user';
/**
* 更新用户支付密钥
* @param payKey - 新的支付密钥
* @returns void
* @throws {UnauthorizedError} 当用户未登录时
* @throws {ValidationError} 当支付密钥格式无效时
*
* @example
* ```typescript
* await UserService.updatePayKey('123456');
* ```
*
* @remarks
* - 支付密钥必须为6位数字
* - 只能更新当前登录用户的支付密钥
*/
static async updatePayKey(payKey: string): Promise<void> {
return this.put<void>('/pay-key', { pay_key: payKey });
}
}