mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 14:29:19 +08:00
refactor: 重构内部推广费模块
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { AdFeeDTO, AdFeeVO, AdFeeFieldVO } from './types';
|
||||
|
||||
/**
|
||||
* 广告费管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取广告费记录列表
|
||||
*/
|
||||
export async function getAdFeePageApi(params: PageQueryDTO<AdFeeDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<AdFeeVO.Info>>('/ec/ad-fee/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建广告费记录
|
||||
*/
|
||||
export async function createAdFeeApi(data: AdFeeDTO.Create) {
|
||||
return requestClient.post<number>('/ec/ad-fee', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新广告费记录
|
||||
*/
|
||||
export async function updateAdFeeApi(data: AdFeeDTO.Update) {
|
||||
return requestClient.put<void>('/ec/ad-fee', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告费记录
|
||||
*/
|
||||
export async function deleteAdFeeApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/ad-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告费记录详情
|
||||
*/
|
||||
export async function getAdFeeByIdApi(id: number) {
|
||||
return requestClient.get<AdFeeVO.Info>(`/ec/ad-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告费导入字段定义
|
||||
*/
|
||||
export async function getAdFeeFieldsApi() {
|
||||
return requestClient.get<AdFeeFieldVO.Info[]>('/ec/ad-fee/fields');
|
||||
}
|
||||
+12
-24
@@ -1,61 +1,49 @@
|
||||
/**
|
||||
* 推广费管理相关DTO类型定义
|
||||
* 广告费管理相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeDTO {
|
||||
/** 推广费查询过滤条件 */
|
||||
export namespace AdFeeDTO {
|
||||
/** 广告费查询过滤条件 */
|
||||
export interface Filters {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 推广费类型ID */
|
||||
feeTypeId?: number;
|
||||
/** 类目ID(可选) */
|
||||
categoryId?: number;
|
||||
/** 商品ID(可选) */
|
||||
productId?: number;
|
||||
/** 推广费发生日期开始 */
|
||||
/** 广告费发生日期开始 */
|
||||
feeDateStart?: string;
|
||||
/** 推广费发生日期结束 */
|
||||
/** 广告费发生日期结束 */
|
||||
feeDateEnd?: string;
|
||||
}
|
||||
|
||||
/** 创建推广费记录 */
|
||||
/** 创建广告费记录 */
|
||||
export interface Create {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 推广费类型ID */
|
||||
feeTypeId: number;
|
||||
/** 类目ID(可选,类目级推广费) */
|
||||
categoryId?: number;
|
||||
/** 商品ID(可选,关联到具体商品) */
|
||||
productId?: number;
|
||||
/** 推广活动名称 */
|
||||
campaignName?: string;
|
||||
/** 推广费金额 */
|
||||
/** 广告费金额 */
|
||||
feeAmount: number;
|
||||
/** 推广费发生日期 */
|
||||
/** 广告费发生日期 */
|
||||
feeDate: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 更新推广费记录 */
|
||||
/** 更新广告费记录 */
|
||||
export interface Update {
|
||||
/** 推广费记录ID */
|
||||
/** 广告费记录ID */
|
||||
id: number;
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 推广费类型ID */
|
||||
feeTypeId: number;
|
||||
/** 类目ID(可选,类目级推广费) */
|
||||
categoryId?: number;
|
||||
/** 商品ID(可选,关联到具体商品) */
|
||||
productId?: number;
|
||||
/** 推广活动名称 */
|
||||
campaignName?: string;
|
||||
/** 推广费金额 */
|
||||
/** 广告费金额 */
|
||||
feeAmount: number;
|
||||
/** 推广费发生日期 */
|
||||
/** 广告费发生日期 */
|
||||
feeDate: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
+8
-16
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* 推广费管理相关VO类型定义
|
||||
* 广告费管理相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeVO {
|
||||
/** 推广费记录信息 */
|
||||
export namespace AdFeeVO {
|
||||
/** 广告费记录信息 */
|
||||
export interface Info {
|
||||
/** 推广费记录ID */
|
||||
/** 广告费记录ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
@@ -13,14 +13,6 @@ export namespace PromotionFeeVO {
|
||||
shopId: number;
|
||||
/** 店铺名称 */
|
||||
shopName?: string;
|
||||
/** 推广费类型ID */
|
||||
feeTypeId: number;
|
||||
/** 推广费类型名称 */
|
||||
feeTypeName?: string;
|
||||
/** 类目ID(可选) */
|
||||
categoryId?: number;
|
||||
/** 类目名称 */
|
||||
categoryName?: string;
|
||||
/** 商品ID(可选) */
|
||||
productId?: number;
|
||||
/** 商品名称 */
|
||||
@@ -29,9 +21,9 @@ export namespace PromotionFeeVO {
|
||||
productCode?: string;
|
||||
/** 推广活动名称 */
|
||||
campaignName?: string;
|
||||
/** 推广费金额 */
|
||||
/** 广告费金额 */
|
||||
feeAmount: number;
|
||||
/** 推广费发生日期 */
|
||||
/** 广告费发生日期 */
|
||||
feeDate: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
@@ -46,8 +38,8 @@ export namespace PromotionFeeVO {
|
||||
}
|
||||
}
|
||||
|
||||
export namespace PromotionFeeFieldVO {
|
||||
/** 推广费导入字段信息 */
|
||||
export namespace AdFeeFieldVO {
|
||||
/** 广告费导入字段信息 */
|
||||
export interface Info {
|
||||
fieldName: string;
|
||||
fieldLabel: string;
|
||||
@@ -1,50 +0,0 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { PromotionFeeDTO, PromotionFeeVO, PromotionFeeFieldVO } from './types';
|
||||
|
||||
/**
|
||||
* 推广费管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取推广费记录列表
|
||||
*/
|
||||
export async function getPromotionFeePageApi(params: PageQueryDTO<PromotionFeeDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<PromotionFeeVO.Info>>('/ec/promotion-fee/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建推广费记录
|
||||
*/
|
||||
export async function createPromotionFeeApi(data: PromotionFeeDTO.Create) {
|
||||
return requestClient.post<number>('/ec/promotion-fee', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推广费记录
|
||||
*/
|
||||
export async function updatePromotionFeeApi(data: PromotionFeeDTO.Update) {
|
||||
return requestClient.put<void>('/ec/promotion-fee', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除推广费记录
|
||||
*/
|
||||
export async function deletePromotionFeeApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/promotion-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推广费记录详情
|
||||
*/
|
||||
export async function getPromotionFeeByIdApi(id: number) {
|
||||
return requestClient.get<PromotionFeeVO.Info>(`/ec/promotion-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推广费导入字段定义
|
||||
*/
|
||||
export async function getPromotionFeeFieldsApi() {
|
||||
return requestClient.get<PromotionFeeFieldVO.Info[]>('/ec/promotion-fee/fields');
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
import type { PromotionFeeTypeDTO, PromotionFeeTypeVO } from './types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 推广费类型管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建推广费类型
|
||||
*/
|
||||
export async function createPromotionFeeTypeApi(
|
||||
data: PromotionFeeTypeDTO.Create,
|
||||
) {
|
||||
return requestClient.post<number>('/ec/promotion-fee-type', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推广费类型
|
||||
*/
|
||||
export async function updatePromotionFeeTypeApi(
|
||||
data: PromotionFeeTypeDTO.Update,
|
||||
) {
|
||||
return requestClient.put('/ec/promotion-fee-type', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除推广费类型
|
||||
*/
|
||||
export async function deletePromotionFeeTypeApi(id: number) {
|
||||
return requestClient.delete(`/ec/promotion-fee-type/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推广费类型详情
|
||||
*/
|
||||
export async function getPromotionFeeTypeByIdApi(id: number) {
|
||||
return requestClient.get<PromotionFeeTypeVO.Info>(
|
||||
`/ec/promotion-fee-type/${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取启用的推广费类型列表
|
||||
*/
|
||||
export async function getActivePromotionFeeTypeListApi() {
|
||||
return requestClient.get<PromotionFeeTypeVO.Info[]>(
|
||||
'/ec/promotion-fee-type/active',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有推广费类型列表
|
||||
*/
|
||||
export async function getAllPromotionFeeTypeListApi() {
|
||||
return requestClient.get<PromotionFeeTypeVO.Info[]>(
|
||||
'/ec/promotion-fee-type/all',
|
||||
);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* 推广费类型管理模块API导出
|
||||
*/
|
||||
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* 推广费类型管理模块类型定义导出
|
||||
*/
|
||||
|
||||
export * from './types.dto';
|
||||
export * from './types.vo';
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 推广费类型相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeTypeDTO {
|
||||
/** 创建推广费类型参数 */
|
||||
export interface Create {
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/** 更新推广费类型参数 */
|
||||
export interface Update {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 推广费类型相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeTypeVO {
|
||||
/** 推广费类型信息 */
|
||||
export interface Info {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 类型编码 */
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 计算方式描述 */
|
||||
calculationMethodDesc?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user