| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import axios from "axios";
- import { AssetTransferType, ZichanTransLog } from "../../share/monitorTypes.ts";
- // 资产流转API接口定义
- export const ZichanTransferAPI = {
- // 获取资产流转记录列表
- getTransferList: async (params?: { page?: number, limit?: number, asset_id?: number, asset_transfer?: AssetTransferType }) => {
- try {
- const response = await axios.get(`/zichan-transfer`, { params });
- return response.data;
- } catch (error) {
- throw error;
- }
- },
-
- // 获取资产流转记录详情
- getTransfer: async (id: number) => {
- try {
- const response = await axios.get(`/zichan-transfer/${id}`);
- return response.data;
- } catch (error) {
- throw error;
- }
- },
-
- // 创建资产流转记录
- createTransfer: async (data: Partial<ZichanTransLog>) => {
- try {
- const response = await axios.post(`/zichan-transfer`, data);
- return response.data;
- } catch (error) {
- throw error;
- }
- },
-
- // 更新资产流转记录
- updateTransfer: async (id: number, data: Partial<ZichanTransLog>) => {
- try {
- const response = await axios.put(`/zichan-transfer/${id}`, data);
- return response.data;
- } catch (error) {
- throw error;
- }
- },
-
- // 删除资产流转记录
- deleteTransfer: async (id: number) => {
- try {
- const response = await axios.delete(`/zichan-transfer/${id}`);
- return response.data;
- } catch (error) {
- throw error;
- }
- }
- };
|