You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
import type { WorkType } from "../globalCmd/cmdTypes";
|
|
import httpRequest, { type BaseResponse } from "../httpRequest";
|
|
import type { CraftItem } from "@/services/matrix/type";
|
|
|
|
export function getList(params: { pageSize: number; pageNum: number }) {
|
|
return httpRequest<BaseResponse>({
|
|
url: "/api/matrixCraft/list",
|
|
params: { ...params },
|
|
method: "GET",
|
|
});
|
|
}
|
|
|
|
export function getListByMatrixId(params: { matrixId: number }) {
|
|
return httpRequest<BaseResponse<CraftItem[]>>({
|
|
url: `/api/matrixCraft/getListByMatrixId/${params.matrixId}`,
|
|
params: { ...params },
|
|
method: "GET",
|
|
});
|
|
}
|
|
|
|
export function createCraft(params: CraftItem) {
|
|
return httpRequest<BaseResponse<CraftItem[]>>({
|
|
url: "/api/matrixCraft/add",
|
|
params,
|
|
method: "POST",
|
|
});
|
|
}
|
|
|
|
export function updateCraft(params: CraftItem) {
|
|
return httpRequest<BaseResponse<CraftItem[]>>({
|
|
url: "/api/matrixCraft",
|
|
params,
|
|
method: "PUT",
|
|
});
|
|
}
|
|
|
|
export function delCraft(params:CraftItem){
|
|
return httpRequest<BaseResponse<CraftItem[]>>({
|
|
url: `/api/matrixCraft/${params.id}`,
|
|
params: { ...params },
|
|
method: "PUT",
|
|
});
|
|
}
|