Story排版修改
This commit is contained in:
95
src/pages/story/service.ts
Normal file
95
src/pages/story/service.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { StoryItem, StoryType } from './data.d';
|
||||
import {CommonResponse} from "@/types/common";
|
||||
|
||||
type ParamsType = {
|
||||
count?: number;
|
||||
instanceId?: string;
|
||||
storyName?: string;
|
||||
} & Partial<StoryType>;
|
||||
|
||||
export async function queryTimelineList(
|
||||
params: ParamsType,
|
||||
): Promise<{ data: StoryType[] }> {
|
||||
return await request('/story/owner/test11', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteStory(params: ParamsType): Promise<{ data: { list: StoryType[] } }> {
|
||||
return request(`/story/${params.instanceId}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
export async function addStory(params: ParamsType): Promise<{ data: { list: StoryType[] } }> {
|
||||
return request('/story/add', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
method: 'post',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateStory(params: ParamsType): Promise<{ data: { list: StoryType[] } }> {
|
||||
return await request(`/story/${params.instanceId}`, {
|
||||
method: 'PUT',
|
||||
data: {
|
||||
...params,
|
||||
method: 'put',
|
||||
},
|
||||
});
|
||||
}
|
||||
export async function queryStoryDetail(itemId: string): Promise<{ data: StoryType }> {
|
||||
return request(`/story/${itemId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
export async function addStoryItem(params: FormData): Promise<any> {
|
||||
return request(`/story/item`, {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
requestType: 'form',
|
||||
getResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
export async function queryStoryItem(storyInstanceId: string): Promise<{ data: StoryItem[] }> {
|
||||
return request(`/story/item/list`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
storyInstanceId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function queryStoryItemDetail(itemId: string): Promise<{ data: StoryItem }> {
|
||||
return request(`/story/item/${itemId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
export async function countStoryItem(storyInstanceId: string): Promise<{ data: StoryItem }> {
|
||||
return request(`/story/item/count/${storyInstanceId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
export async function queryStoryItemImages(itemId: string): Promise<{ data: string[] }> {
|
||||
return request(`/story/item/images/${itemId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
export async function removeStoryItem(itemId: string): Promise<CommonResponse<string>> {
|
||||
return request(`/story/item/${itemId}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
export async function fetchImage(imageInstanceId: string): Promise<any> {
|
||||
return request(`/file/image/${imageInstanceId}`, {
|
||||
method: 'GET',
|
||||
responseType: 'blob',
|
||||
getResponse: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user