发布球局
This commit is contained in:
38
src/services/publishService.ts
Normal file
38
src/services/publishService.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import httpService from './httpService'
|
||||
import type { ApiResponse } from './httpService'
|
||||
|
||||
// 用户接口
|
||||
export interface PublishBallData {
|
||||
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,
|
||||
}
|
||||
|
||||
// 响应接口
|
||||
export interface Response {
|
||||
code: string
|
||||
message: string
|
||||
data: any
|
||||
}
|
||||
|
||||
// 发布球局类
|
||||
class PublishService {
|
||||
// 用户登录
|
||||
async createPersonal(data: PublishBallData): Promise<ApiResponse<Response>> {
|
||||
return httpService.post('/games/create', data, {
|
||||
showLoading: true,
|
||||
loadingText: '发布中...'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 导出认证服务实例
|
||||
export default new PublishService()
|
||||
Reference in New Issue
Block a user