Refactor code structure and remove redundant changes
This commit is contained in:
24
api/toolbox/index.ts
Normal file
24
api/toolbox/index.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { post, get } from '@/utils/axios'
|
||||
import { TcreateReq, TpageReq, TpageRes } from './types'
|
||||
|
||||
/**
|
||||
* 新建工具箱
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const create = (params: TcreateReq) => {
|
||||
return post<IResponse<number>>({
|
||||
url: '/prod-api/app-api/business/app/project-resource/create',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
/***
|
||||
* 获得内容信息分页
|
||||
*/
|
||||
export const page = (params: TpageReq) => {
|
||||
return get<IResponse<TpageRes>>({
|
||||
url: '/prod-api/app-api/business/app/project-resource/page',
|
||||
params,
|
||||
})
|
||||
}
|
||||
61
api/toolbox/types.ts
Normal file
61
api/toolbox/types.ts
Normal file
@ -0,0 +1,61 @@
|
||||
export interface TcreateReq {
|
||||
id?: number
|
||||
title: string
|
||||
description: string
|
||||
labels: string[]
|
||||
createAddress?: string
|
||||
createIp?: string
|
||||
projectType: number[]
|
||||
files: {
|
||||
id: number
|
||||
title: string
|
||||
fileId: number
|
||||
drawId: number
|
||||
type: number
|
||||
url: string
|
||||
sort: number
|
||||
}[]
|
||||
coverImages: {
|
||||
id: number
|
||||
title: string
|
||||
fileId: number
|
||||
drawId: number
|
||||
type: number
|
||||
url: string
|
||||
sort: number
|
||||
}[]
|
||||
points: number
|
||||
}
|
||||
|
||||
export interface TpageReq {
|
||||
pageNum: number
|
||||
pageSize: number
|
||||
title?: string
|
||||
ownedUserId?: string
|
||||
labels?: string[]
|
||||
status?: number
|
||||
recommend?: boolean
|
||||
}
|
||||
|
||||
export interface TpageRes {
|
||||
list: TpageItem[]
|
||||
total: number
|
||||
}
|
||||
|
||||
export interface TpageItem {
|
||||
id: number
|
||||
title: string
|
||||
createTime: string
|
||||
labels: string[]
|
||||
status: number
|
||||
recommend: boolean
|
||||
points: number
|
||||
iconUrl: string
|
||||
hotPoint: number
|
||||
description: string
|
||||
previewPoint: number
|
||||
previewUrl: string
|
||||
previewImageUrl: string
|
||||
commentsPoint: number
|
||||
ownedUserId: string
|
||||
}
|
||||
Reference in New Issue
Block a user