mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 19:49:19 +08:00
feat: 新增电商平台管理模块(ec_platform),店铺表platform改为外键
后端: - 新增 ec_platform 表 + 10条初始平台数据(淘宝/京东/拼多多/抖音等) - ec_shop 表 platform varchar → platform_id bigint 外键 - 新增 Platform 模块:PO/VO/DTO/Mapper/Service/Controller - 修复 ShopServiceImpl/CompanyOverviewServiceImpl/ExportServiceImpl 中 platform 字段引用 前端: - 新增平台管理页面(列表 + 表单弹窗) - 路由注册 /data/platform - 店铺管理:平台选择改为下拉,字段 platform 字符串 → platformId 外键 - 同步更新 ShopVO/ShopDTO 类型定义 数据库: - V20260422__add_ec_platform.sql 迁移文件
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import type { PlatformDTO, PlatformVO } from './types';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 平台管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取平台列表
|
||||
*/
|
||||
export async function getPlatformPageApi(
|
||||
params: PageQueryDTO<PlatformDTO.Filters>,
|
||||
) {
|
||||
return requestClient.post<PageResultVO<PlatformVO.Info>>(
|
||||
'/ec/platform/page',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建平台
|
||||
*/
|
||||
export async function createPlatformApi(data: PlatformDTO.Create) {
|
||||
return requestClient.post<PlatformVO.Info>('/ec/platform/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新平台
|
||||
*/
|
||||
export async function updatePlatformApi(id: number, data: PlatformDTO.Update) {
|
||||
return requestClient.put<PlatformVO.Info>(`/ec/platform/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台
|
||||
*/
|
||||
export async function deletePlatformApi(id: number) {
|
||||
return requestClient.delete(`/ec/platform/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有启用的平台列表
|
||||
*/
|
||||
export async function getActivePlatformsApi() {
|
||||
return requestClient.get<PlatformVO.Info[]>('/ec/platform/active');
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './types.dto';
|
||||
export * from './types.vo';
|
||||
@@ -0,0 +1,32 @@
|
||||
export namespace PlatformDTO {
|
||||
/**
|
||||
* 创建平台
|
||||
*/
|
||||
export interface Create {
|
||||
platformName: string;
|
||||
platformCode: string;
|
||||
logoUrl?: string;
|
||||
sortOrder?: number;
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新平台
|
||||
*/
|
||||
export interface Update {
|
||||
platformName: string;
|
||||
platformCode: string;
|
||||
logoUrl?: string;
|
||||
sortOrder: number;
|
||||
isActive: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤条件
|
||||
*/
|
||||
export interface Filters {
|
||||
platformName?: string;
|
||||
platformCode?: string;
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export namespace PlatformVO {
|
||||
/**
|
||||
* 平台信息
|
||||
*/
|
||||
export interface Info {
|
||||
id: number;
|
||||
platformName: string;
|
||||
platformCode: string;
|
||||
logoUrl?: string;
|
||||
sortOrder: number;
|
||||
isActive: number;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ export namespace ShopDTO {
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
/** 平台ID */
|
||||
platformId?: number;
|
||||
}
|
||||
|
||||
/** 更新店铺参数 */
|
||||
@@ -19,16 +19,16 @@ export namespace ShopDTO {
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
/** 平台ID */
|
||||
platformId?: number;
|
||||
}
|
||||
|
||||
/** 店铺过滤条件 */
|
||||
export interface Filters {
|
||||
/** 店铺名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 平台 */
|
||||
platform?: string;
|
||||
/** 平台ID */
|
||||
platformId?: number;
|
||||
}
|
||||
|
||||
/** 店铺统计查询参数 */
|
||||
|
||||
@@ -15,8 +15,10 @@ export namespace ShopVO {
|
||||
logo?: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
/** 平台ID */
|
||||
platformId?: number;
|
||||
/** 平台名称 */
|
||||
platformName?: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
|
||||
Reference in New Issue
Block a user