41 lines
850 B
TypeScript
41 lines
850 B
TypeScript
import httpService from './httpService'
|
|
import type { ApiResponse } from './httpService'
|
|
|
|
// 用户接口
|
|
export interface GameDetail {
|
|
id: number,
|
|
title: string,
|
|
venue_id: number,
|
|
creator_id: number,
|
|
game_date: string,
|
|
start_time: string,
|
|
end_time: string,
|
|
max_participants: number,
|
|
current_participants: number,
|
|
ntrp_level: string,
|
|
play_style: string,
|
|
description: string,
|
|
status: string,
|
|
created_at: string,
|
|
updated_at: string,
|
|
}
|
|
|
|
// 响应接口
|
|
export interface Response {
|
|
code: string
|
|
message: string
|
|
data: GameDetail
|
|
}
|
|
|
|
// 发布球局类
|
|
class GameDetailService {
|
|
// 用户登录
|
|
async getDetail(id: number): Promise<ApiResponse<Response>> {
|
|
return httpService.post('/games/detail', { id }, {
|
|
showLoading: true,
|
|
})
|
|
}
|
|
}
|
|
|
|
// 导出认证服务实例
|
|
export default new GameDetailService() |