feat: move

This commit is contained in:
ah--desktop
2025-12-17 01:12:10 +08:00
parent ca15b80d86
commit cb35521713
14 changed files with 1347 additions and 551 deletions
@@ -1,6 +1,7 @@
import type { ShopDTO, ShopVO } from './types';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import type { ProductVO } from '#/api/ecommerce/product/types';
import { requestClient } from '#/api/request';
@@ -50,36 +51,20 @@ export async function uploadShopLogoApi(file: File) {
}
/**
* 获取店铺当月统计信息
* 获取店铺总览
*/
export async function getShopCurrentMonthStatisticsApi(id: number) {
return requestClient.get<ShopVO.Statistics>(
`/ec/shop/statistics/current-month/${id}`,
);
export async function getShopOverviewApi(params: ShopDTO.StatisticsQuery) {
return requestClient.post<ShopVO.Overview>('/ec/shop/overview', params);
}
/**
* 获取店铺统计信息
*/
export async function getShopStatisticsApi(params: ShopDTO.StatisticsQuery) {
return requestClient.post<ShopVO.Statistics>('/ec/shop/statistics', params);
}
/**
* 分页获取店铺商品详细信息
* 分页获取店铺商品信息
*/
export async function getShopProductPageApi(
params: PageQueryDTO<ShopDTO.ProductFilters>,
params: PageQueryDTO<ShopDTO.ProductPageFilters>,
) {
return requestClient.post<PageResultVO<ShopVO.ProductDetail>>(
return requestClient.post<PageResultVO<ProductVO.Info>>(
'/ec/shop/products/page',
params,
);
}
/**
* 获取店铺详情
*/
export async function getShopDetailApi(params: ShopDTO.DetailQuery) {
return requestClient.post<ShopVO.Detail>('/ec/shop/detail', params);
}
@@ -41,25 +41,9 @@ export namespace ShopDTO {
endDate: string;
}
/** 店铺商品过滤条件 */
export interface ProductFilters {
/** 店铺商品分页查询过滤条件 */
export interface ProductPageFilters {
/** 店铺ID */
shopId: number;
/** 商品名称(模糊查询) */
productName?: string;
/** 商品编码(模糊查询) */
productCode?: string;
/** 统计日期(不传默认为当日) */
statDate?: string;
}
/** 店铺详情查询参数 */
export interface DetailQuery {
/** 店铺ID */
shopId: number;
/** 开始日期(不传默认为当月1号) */
startDate?: string;
/** 结束日期(不传默认为今天) */
endDate?: string;
}
}
@@ -45,7 +45,23 @@ export namespace ShopVO {
feeRatio: number;
}
/** 店铺商品详细信息 */
/** 每日数据项 */
export interface DailyData {
/** 日期 */
date: string;
/** 对应的值 */
value: number;
}
/** 每日统计数据 */
export interface DailyStatistics {
/** 时间范围的总值 */
total: number;
/** 每日数据列表 */
dailyDataList: DailyData[];
}
/** 店铺商品详细信息(已废弃,后端接口已删除) */
export interface ProductDetail {
/** 商品ID */
productId: number;
@@ -71,11 +87,21 @@ export namespace ShopVO {
averageOrderValue: number;
}
/** 店铺详情 */
export interface Detail {
/** 店铺统计信息 */
statistics: Statistics;
/** 商品列表 */
products: ProductDetail[];
/** 店铺总览 */
export interface Overview {
/** 销售额统计 */
salesAmount: DailyStatistics;
/** 订单数统计 */
orderCount: DailyStatistics;
/** 客单价统计 */
averageOrderValue: DailyStatistics;
/** 成本统计 */
costAmount: DailyStatistics;
/** 退款金额统计 */
refundAmount: DailyStatistics;
/** 推广费统计 */
promotionFee: DailyStatistics;
/** 费比统计 */
feeRatio: DailyStatistics;
}
}