first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { request } from "@/utils/service"
|
||||
import type * as Table from "./types/table"
|
||||
|
||||
/** 增 */
|
||||
export function createTableDataApi(data: Table.CreateTableRequestData) {
|
||||
return request({
|
||||
url: "table",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/** 删 */
|
||||
export function deleteTableDataApi(id: string) {
|
||||
return request({
|
||||
url: `table/${id}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
/** 改 */
|
||||
export function updateTableDataApi(data: Table.UpdateTableRequestData) {
|
||||
return request({
|
||||
url: "table",
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/** 查 */
|
||||
export function getTableDataApi(params: Table.GetTableRequestData) {
|
||||
return request<Table.GetTableResponseData>({
|
||||
url: "table",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
export interface CreateTableRequestData {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export interface UpdateTableRequestData {
|
||||
id: string
|
||||
username: string
|
||||
password?: string
|
||||
}
|
||||
|
||||
export interface GetTableRequestData {
|
||||
/** 当前页码 */
|
||||
currentPage: number
|
||||
/** 查询条数 */
|
||||
size: number
|
||||
/** 查询参数:用户名 */
|
||||
username?: string
|
||||
/** 查询参数:手机号 */
|
||||
phone?: string
|
||||
}
|
||||
|
||||
export interface GetTableData {
|
||||
createTime: string
|
||||
email: string
|
||||
id: string
|
||||
phone: string
|
||||
roles: string
|
||||
status: boolean
|
||||
username: string
|
||||
}
|
||||
|
||||
export type GetTableResponseData = ApiResponseData<{
|
||||
list: GetTableData[]
|
||||
total: number
|
||||
}>
|
||||
Reference in New Issue
Block a user