add StoreDiary

This commit is contained in:
Timi
2026-08-31 17:32:01 +08:00
parent 95a400cd93
commit 1e83fdf883
9 changed files with 1288 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
import { axios, type Page, type PageResult } from "timi-web-api";
import type { StoreDiary } from "@/types/StoreDiary";
const BASE_URI = "/gao/store/diary";
export interface StoreDiaryListOptions {
storeId?: string;
beginCreatedAt: number;
endCreatedAt: number;
}
/**
* 门店日记接口。
*
* @param page 分页参数
* @param options 门店和月份筛选条件
*/
async function list(page: Page<StoreDiary>, options: StoreDiaryListOptions): Promise<PageResult<StoreDiary>> {
return await axios.post(`${BASE_URI}/list`, {
index: page.index,
size: page.size,
beginCreatedAt: options.beginCreatedAt,
endCreatedAt: options.endCreatedAt,
...(options.storeId ? { storeId: options.storeId } : {})
});
}
async function detail(id: string): Promise<StoreDiary> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function create(article: StoreDiary): Promise<string> {
return await axios.post(`${BASE_URI}/create`, article);
}
async function update(article: StoreDiary): Promise<void> {
await axios.post(`${BASE_URI}/update`, article);
}
async function remove(id: string): Promise<void> {
await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
export default {
list,
detail,
create,
update,
remove
};