mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-12 20:26:36 +08:00
34 lines
914 B
TypeScript
34 lines
914 B
TypeScript
|
|
import { get, post } from '@/utils/request';
|
||
|
|
import type {
|
||
|
|
CardFlipStatusOutput,
|
||
|
|
FlipCardInput,
|
||
|
|
FlipCardOutput,
|
||
|
|
UseInviteCodeInput,
|
||
|
|
InviteCodeOutput
|
||
|
|
} from './types';
|
||
|
|
|
||
|
|
// 获取本周翻牌任务状态
|
||
|
|
export function getWeeklyTaskStatus() {
|
||
|
|
return get<CardFlipStatusOutput>('/card-flip/weekly-task-status').json();
|
||
|
|
}
|
||
|
|
|
||
|
|
// 翻牌
|
||
|
|
export function flipCard(data: FlipCardInput) {
|
||
|
|
return post<FlipCardOutput>('/card-flip/flip-card', data).json();
|
||
|
|
}
|
||
|
|
|
||
|
|
// 使用邀请码解锁翻牌次数
|
||
|
|
export function useInviteCode(data: UseInviteCodeInput) {
|
||
|
|
return post<void>('/card-flip/use-invite-code', data).json();
|
||
|
|
}
|
||
|
|
|
||
|
|
// 获取我的邀请码信息
|
||
|
|
export function getMyInviteCode() {
|
||
|
|
return get<InviteCodeOutput>('/card-flip/my-invite-code').json();
|
||
|
|
}
|
||
|
|
|
||
|
|
// 生成我的邀请码(如果没有)
|
||
|
|
export function generateMyInviteCode() {
|
||
|
|
return post<string>('/card-flip/generate-my-invite-code').json();
|
||
|
|
}
|