重新整理仓库

This commit is contained in:
2025-07-25 13:03:01 +08:00
commit 469af7f7f9
979 changed files with 171962 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询运费模板
*/
export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) {
const res = await request.get<ApiResult<PageResult<ShopExpressTemplate>>>(
MODULES_API_URL + '/shop/shop-express-template/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询运费模板列表
*/
export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) {
const res = await request.get<ApiResult<ShopExpressTemplate[]>>(
MODULES_API_URL + '/shop/shop-express-template',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加运费模板
*/
export async function addShopExpressTemplate(data: ShopExpressTemplate) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-express-template',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改运费模板
*/
export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-express-template',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除运费模板
*/
export async function removeShopExpressTemplate(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-express-template/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除运费模板
*/
export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-express-template/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询运费模板
*/
export async function getShopExpressTemplate(id: number) {
const res = await request.get<ApiResult<ShopExpressTemplate>>(
MODULES_API_URL + '/shop/shop-express-template/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,41 @@
import type { PageParam } from '@/api';
/**
* 运费模板
*/
export interface ShopExpressTemplate {
//
id?: number;
//
type?: string;
//
title?: string;
// 收件价格
firstAmount?: string;
// 续件价格
extraAmount?: string;
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
//
sortNumber?: number;
// 首件数量/重量
firstNum?: string;
// 续件数量/重量
extraNum?: string;
}
/**
* 运费模板搜索条件
*/
export interface ShopExpressTemplateParam extends PageParam {
id?: number;
keywords?: string;
}