feat(shop): 添加品牌管理和物流公司管理功能
- 新增品牌管理相关接口和页面组件 - 新增物流公司管理相关接口和页面组件 - 优化运费模板和运费模板详情页面的请求路径
This commit is contained in:
105
src/api/shop/shopBrand2/index.ts
Normal file
105
src/api/shop/shopBrand2/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopBrand2, ShopBrand2Param } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询品牌
|
||||
*/
|
||||
export async function pageShopBrand2(params: ShopBrand2Param) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopBrand2>>>(
|
||||
'/shop/shop-brand2/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询品牌列表
|
||||
*/
|
||||
export async function listShopBrand2(params?: ShopBrand2Param) {
|
||||
const res = await request.get<ApiResult<ShopBrand2[]>>(
|
||||
'/shop/shop-brand2',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加品牌
|
||||
*/
|
||||
export async function addShopBrand2(data: ShopBrand2) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-brand2',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改品牌
|
||||
*/
|
||||
export async function updateShopBrand2(data: ShopBrand2) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-brand2',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除品牌
|
||||
*/
|
||||
export async function removeShopBrand2(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-brand2/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除品牌
|
||||
*/
|
||||
export async function removeBatchShopBrand2(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-brand2/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询品牌
|
||||
*/
|
||||
export async function getShopBrand2(id: number) {
|
||||
const res = await request.get<ApiResult<ShopBrand2>>(
|
||||
'/shop/shop-brand2/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/shopBrand2/model/index.ts
Normal file
31
src/api/shop/shopBrand2/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
export interface ShopBrand2 {
|
||||
// ID
|
||||
brandId?: number;
|
||||
// 品牌名称
|
||||
brandName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌搜索条件
|
||||
*/
|
||||
export interface ShopBrand2Param extends PageParam {
|
||||
brandId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpress, ShopExpressParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询物流公司
|
||||
*/
|
||||
export async function pageShopExpress(params: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpress>>>(
|
||||
MODULES_API_URL + '/shop/shop-express/page',
|
||||
'/shop/shop-express/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +23,7 @@ export async function pageShopExpress(params: ShopExpressParam) {
|
||||
*/
|
||||
export async function listShopExpress(params?: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<ShopExpress[]>>(
|
||||
MODULES_API_URL + '/shop/shop-express',
|
||||
'/shop/shop-express',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +39,7 @@ export async function listShopExpress(params?: ShopExpressParam) {
|
||||
*/
|
||||
export async function addShopExpress(data: ShopExpress) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express',
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +53,7 @@ export async function addShopExpress(data: ShopExpress) {
|
||||
*/
|
||||
export async function updateShopExpress(data: ShopExpress) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express',
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +67,7 @@ export async function updateShopExpress(data: ShopExpress) {
|
||||
*/
|
||||
export async function removeShopExpress(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express/' + id
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +80,7 @@ export async function removeShopExpress(id?: number) {
|
||||
*/
|
||||
export async function removeBatchShopExpress(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express/batch',
|
||||
'/shop/shop-express/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +96,7 @@ export async function removeBatchShopExpress(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getShopExpress(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpress>>(
|
||||
MODULES_API_URL + '/shop/shop-express/' + id
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
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',
|
||||
'/shop/shop-express-template/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +23,7 @@ export async function pageShopExpressTemplate(params: ShopExpressTemplateParam)
|
||||
*/
|
||||
export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate[]>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template',
|
||||
'/shop/shop-express-template',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +39,7 @@ export async function listShopExpressTemplate(params?: ShopExpressTemplateParam)
|
||||
*/
|
||||
export async function addShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template',
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +53,7 @@ export async function addShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
*/
|
||||
export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template',
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +67,7 @@ export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
*/
|
||||
export async function removeShopExpressTemplate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template/' + id
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +80,7 @@ export async function removeShopExpressTemplate(id?: number) {
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template/batch',
|
||||
'/shop/shop-express-template/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +96,7 @@ export async function removeBatchShopExpressTemplate(data: (number | undefined)[
|
||||
*/
|
||||
export async function getShopExpressTemplate(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template/' + id
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplateDetail>>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail/page',
|
||||
'/shop/shop-express-template-detail/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +23,7 @@ export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateD
|
||||
*/
|
||||
export async function listShopExpressTemplateDetail(params?: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail[]>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail',
|
||||
'/shop/shop-express-template-detail',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +39,7 @@ export async function listShopExpressTemplateDetail(params?: ShopExpressTemplate
|
||||
*/
|
||||
export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail',
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +53,7 @@ export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDeta
|
||||
*/
|
||||
export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail',
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +67,7 @@ export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateD
|
||||
*/
|
||||
export async function removeShopExpressTemplateDetail(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail/' + id
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +80,7 @@ export async function removeShopExpressTemplateDetail(id?: number) {
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplateDetail(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail/batch',
|
||||
'/shop/shop-express-template-detail/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +96,7 @@ export async function removeBatchShopExpressTemplateDetail(data: (number | undef
|
||||
*/
|
||||
export async function getShopExpressTemplateDetail(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail>>(
|
||||
MODULES_API_URL + '/shop/shop-express-template-detail/' + id
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
Reference in New Issue
Block a user