feat(user): sync entitlement snapshot
This commit is contained in:
@@ -15,6 +15,7 @@ import type {
|
||||
CreditsHistoryData,
|
||||
UpdateProfileRequest,
|
||||
User,
|
||||
UserEntitlements,
|
||||
UserStatsResponse,
|
||||
} from "@/data/dto/user";
|
||||
|
||||
@@ -36,4 +37,7 @@ export interface IUserRepository {
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
): Promise<Result<CreditsHistoryData>>;
|
||||
|
||||
/** 获取当前用户权益快照。 */
|
||||
getEntitlements(): Promise<Result<UserEntitlements>>;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
CreditsHistoryData,
|
||||
UpdateProfileRequest,
|
||||
User,
|
||||
UserEntitlements,
|
||||
UserStatsResponse,
|
||||
} from "@/data/dto/user";
|
||||
import { Result } from "@/utils";
|
||||
@@ -49,6 +50,11 @@ export class UserRepository implements IUserRepository {
|
||||
): Promise<Result<CreditsHistoryData>> {
|
||||
return Result.wrap(() => this.api.getCreditsHistory(limit, offset));
|
||||
}
|
||||
|
||||
/** 获取当前用户权益快照。 */
|
||||
async getEntitlements(): Promise<Result<UserEntitlements>> {
|
||||
return Result.wrap(() => this.api.getEntitlements());
|
||||
}
|
||||
}
|
||||
|
||||
/** 全局单例。 */
|
||||
|
||||
Reference in New Issue
Block a user