remove deprecated api
This commit is contained in:
+10
-10
@@ -1,5 +1,5 @@
|
||||
import {Attachment, BizUpdateReq, TempFileResp} from "../types";
|
||||
import {axios} from "./BaseAPI";
|
||||
import { Attachment, BizIdUpdate, TempFile } from "../types";
|
||||
import { axios } from "./BaseAPI";
|
||||
import CommonAPI from "./CommonAPI";
|
||||
|
||||
const BASE_URI = "/attach";
|
||||
@@ -11,7 +11,7 @@ const BASE_URI = "/attach";
|
||||
* @param ttl 有效期
|
||||
* @returns 临时附件列表
|
||||
*/
|
||||
async function uploadTemp(file: File | File[], ttl?: string): Promise<TempFileResp[]> {
|
||||
async function upload(file: File | File[], ttl?: string): Promise<TempFile[]> {
|
||||
const formData = new FormData();
|
||||
const fileList = Array.isArray(file) ? file : [file];
|
||||
for (const item of fileList) {
|
||||
@@ -28,8 +28,8 @@ async function uploadTemp(file: File | File[], ttl?: string): Promise<TempFileRe
|
||||
*
|
||||
* @param req 更新请求
|
||||
*/
|
||||
async function updateByBiz(req: BizUpdateReq): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update/biz`, req);
|
||||
async function updateByBizId(req: BizIdUpdate): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update/biz/id`, req);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,8 +39,8 @@ async function updateByBiz(req: BizUpdateReq): Promise<void> {
|
||||
* @param bizId 业务 ID
|
||||
* @param attachTypeList 附件类型列表
|
||||
*/
|
||||
async function listByBiz(bizType: string, bizId: string, attachTypeList?: string[]): Promise<Attachment[]> {
|
||||
return await axios.get(`${BASE_URI}/list/biz`, {
|
||||
async function listByBizId(bizType: string, bizId: string, attachTypeList?: string[]): Promise<Attachment[]> {
|
||||
return await axios.get(`${BASE_URI}/list/biz/id`, {
|
||||
params: {
|
||||
bizType,
|
||||
bizId,
|
||||
@@ -50,9 +50,9 @@ async function listByBiz(bizType: string, bizId: string, attachTypeList?: string
|
||||
}
|
||||
|
||||
export default {
|
||||
uploadTemp,
|
||||
updateByBiz,
|
||||
listByBiz,
|
||||
upload,
|
||||
updateByBizId,
|
||||
listByBizId,
|
||||
getReadURL: CommonAPI.getAttachmentReadAPI,
|
||||
getTempReadURL: CommonAPI.getAttachmentTempReadAPI
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user