feat: upload cover not over yet
This commit is contained in:
@@ -16,6 +16,12 @@ export interface PublishBallData {
|
||||
description: string,
|
||||
}
|
||||
|
||||
export interface createGameData extends PublishBallData {
|
||||
status: string,
|
||||
created_at: string,
|
||||
updated_at: string,
|
||||
}
|
||||
|
||||
// 响应接口
|
||||
export interface Response {
|
||||
code: string
|
||||
@@ -23,16 +29,74 @@ export interface Response {
|
||||
data: any
|
||||
}
|
||||
|
||||
// export type SourceType = 'history' | 'preset'
|
||||
|
||||
export interface getPicturesReq {
|
||||
pageOption: {
|
||||
page: number,
|
||||
pageSize: number,
|
||||
},
|
||||
seachOption: {
|
||||
tag: string,
|
||||
resource_type: string,
|
||||
dateRange: string[],
|
||||
},
|
||||
}
|
||||
|
||||
export interface getPicturesRes {
|
||||
code: number,
|
||||
message: string,
|
||||
data: {
|
||||
rows: [
|
||||
{
|
||||
user_id: string,
|
||||
resource_type: string,
|
||||
file_name: string,
|
||||
original_name: string,
|
||||
file_path: string,
|
||||
file_url: string,
|
||||
file_size: number,
|
||||
mime_type: string,
|
||||
width: number,
|
||||
height: number,
|
||||
duration: number,
|
||||
thumbnail_url: string,
|
||||
is_public: string,
|
||||
tags: string[],
|
||||
description: string,
|
||||
view_count: number,
|
||||
download_count: number,
|
||||
status: string,
|
||||
last_modify_time: string,
|
||||
}
|
||||
],
|
||||
count: number,
|
||||
page: number,
|
||||
pageSize: number,
|
||||
totalPages: number,
|
||||
}
|
||||
}
|
||||
|
||||
function delay(ms: number) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms))
|
||||
}
|
||||
// 发布球局类
|
||||
class PublishService {
|
||||
// 用户登录
|
||||
async createPersonal(data: PublishBallData): Promise<ApiResponse<Response>> {
|
||||
async createPersonal(data: PublishBallData): Promise<ApiResponse<createGameData>> {
|
||||
return httpService.post('/games/create', data, {
|
||||
showLoading: true,
|
||||
loadingText: '发布中...'
|
||||
})
|
||||
}
|
||||
|
||||
async getPictures(req: getPicturesReq): Promise<ApiResponse<getPicturesRes>> {
|
||||
return httpService.post('/gallery/sys_img_list', req, {
|
||||
showLoading: true,
|
||||
showToast: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 导出认证服务实例
|
||||
export default new PublishService()
|
||||
export default new PublishService()
|
||||
Reference in New Issue
Block a user