feat: 评论接口对接

This commit is contained in:
landaiqing
2024-07-19 18:58:47 +08:00
parent 359ef60128
commit 6e8b2ae643
38 changed files with 5184 additions and 2096 deletions

View File

@@ -167,3 +167,191 @@ export const getUserRecentPreviewFile = (userId: any) => {
},
});
};
/**
* 获取存储桶
* @param userId
* @param bucket
* @param type
*/
export const deleteBucket = (userId: any, bucket: any, type: any) => {
return web.request({
url: `/oss/oss/` + type + `/deleteBucket`,
method: "post",
params: {
userId: userId,
bucket: bucket,
},
});
};
/**
* 获取存储桶大小
* @param userId
* @param bucket
* @param type
*/
export const getBucketSize = (userId: any, bucket: any, type: any) => {
return web.request({
url: `/oss/oss/` + type + `/getBucketSize`,
method: "post",
params: {
userId: userId,
bucket: bucket,
},
});
};
/**
* 创建存储桶
* @param userId
* @param bucket
* @param type
*/
export const creatBucket = (userId: any, bucket: any, type: any) => {
return web.request({
url: `/oss/oss/` + type + `/createBucket`,
method: "post",
params: {
userId: userId,
bucket: bucket,
},
});
};
/**
* 删除文件
* @param userId
* @param bucket
* @param type
* @param filePath
*/
export const deleteFile = (userId: any, bucket: any, type: any, filePath: any) => {
return web.request({
url: `/oss/oss/` + type + `/deleteFile`,
method: "post",
params: {
userId: userId,
bucket: bucket,
filePath: filePath,
},
});
};
/**
* 下载文件
* @param userId
* @param bucket
* @param type
* @param listObjectsArgs
*/
export const downloadFiles = (userId: any, bucket: any, type: any, listObjectsArgs: any) => {
return web.request({
url: `/oss/oss/` + type + `/downloadFile`,
method: "get",
responseType: "blob",
params: {
userId: userId,
bucket: bucket,
listObjectsArgs: listObjectsArgs,
},
});
};
/**
* 预览文件
* @param userId
* @param bucket
* @param type
* @param filePath
*/
export const previewFile = (userId: any, bucket: any, type: any, filePath: any) => {
return web.request({
url: `/oss/oss/` + type + `/previewFile`,
method: "post",
params: {
userId: userId,
bucket: bucket,
filePath: filePath,
},
});
};
/**
* 重命名文件
* @param userId
* @param bucket
* @param type
* @param oldFileName
* @param newFileName
*/
export const renameFile = (
userId: any,
bucket: any,
type: any,
oldFileName: any,
newFileName: any,
) => {
return web.request({
url: `/oss/oss/` + type + `/renameFile`,
method: "post",
params: {
userId: userId,
bucket: bucket,
oldFileName: oldFileName,
newFileName: newFileName,
},
});
};
/**
* 拷贝文件
* @param userId
* @param bucket
* @param type
* @param oldFilePath
* @param newFilePath
*/
export const copyFile = (
userId: any,
bucket: any,
type: any,
oldFilePath: any,
newFilePath: any,
) => {
return web.request({
url: `/oss/oss/` + type + `/copyFile`,
method: "post",
params: {
userId: userId,
bucket: bucket,
oldFilePath: oldFilePath,
newFilePath: newFilePath,
},
});
};
/**
* 创建存储桶
* @param userId
* @param bucket
* @param type
*/
export const createBucket = (userId: any, bucket: any, type: any) => {
return web.request({
url: `/oss/oss/` + type + `/createBucket`,
method: "post",
params: {
userId: userId,
bucket: bucket,
},
});
};
/**
* 上传文件
* @param type
* @param data
* @param peram
*/
export const uploadFiles = (type: any, data: any, peram: any) => {
return web.request({
url: `/oss/oss/` + type + `/uploadFile`,
method: "post",
headers: {
"Content-Type": "multipart/form-data",
},
data: data,
params: peram,
});
};