feat: 优化店铺相关

This commit is contained in:
2026-08-14 11:44:22 +08:00
parent 3322b0542b
commit 8921c6b122
37 changed files with 558 additions and 241 deletions
@@ -0,0 +1,10 @@
import type { PddShopInfo } from '#/api/ecommerce/shop/types';
import { requestClient } from '#/api/request';
/**
* 拼多多渠道店铺详情(含授权信息,不含 token)
*/
export async function getPddShopDetailApi(id: number) {
return requestClient.get<PddShopInfo>(`/channel/pdd/shop/detail/${id}`);
}
@@ -0,0 +1 @@
export * from './apis';
@@ -37,6 +37,13 @@ export async function deleteShopApi(id: number) {
return requestClient.delete(`/ec/shop/delete/${id}`);
}
/**
* 店铺详情(含平台店铺及授权信息)
*/
export async function getShopDetailApi(id: number) {
return requestClient.get<ShopVO.Info>(`/ec/shop/detail/${id}`);
}
/**
* 上传店铺Logo
*/
@@ -2,31 +2,55 @@
* 店铺相关VO类型定义
*/
/** 拼多多外部店铺信息(列表关联返回) */
/** 拼多多授权信息(不含 token) */
export interface PddAuthInfo {
/** 授权主键ID */
id: number;
/** 公司ID */
companyId: number;
/** 拼多多授权主体ID(owner_id) */
ownerId?: string;
/** access_token 过期时间 */
expiresAt?: string;
/** refresh_token 过期时间 */
refreshTokenExpiresAt?: string;
/** 授权 scope(JSON 数组字符串) */
scope?: string;
/** 状态:0=失效 1=正常 2=已撤销 */
status?: number;
/** 创建时间 */
createTime?: string;
/** 更新时间 */
updateTime?: string;
}
/** 拼多多外部店铺信息 */
export interface PddShopInfo {
/** 主键ID */
id: number;
/** 公司ID */
companyId: number;
/** 拼多多授权ID */
companyId?: number;
/** 拼多多授权ID(列表简要也会带,用于判断是否已授权) */
pddAuthId?: null | number;
/** 关联授权信息(仅详情接口返回) */
auth?: null | PddAuthInfo;
/** 拼多多店铺ID(mall_id) */
mallId: number;
mallId?: number;
/** 店铺名称 */
mallName?: string;
/** 店铺logo */
logo?: string;
/** 店铺描述 */
/** 店铺描述(详情) */
mallDesc?: string;
/** 店铺类型:1个人 2企业 3旗舰店 4专卖店 5专营店 6普通店 */
/** 店铺类型(详情) */
merchantType?: number;
/** 店铺身份:0厂商 1分销商 2都不是 3都是 */
/** 店铺身份(详情) */
mallCharacter?: number;
/** 最近一次同步时间 */
/** 最近一次同步时间(详情) */
lastSyncTime?: string;
/** 创建时间 */
/** 创建时间(详情) */
createTime?: string;
/** 更新时间 */
/** 更新时间(详情) */
updateTime?: string;
}
@@ -47,8 +71,8 @@ export namespace ShopVO {
platformCode?: string;
/** 平台名称(后端回填) */
platformName?: string;
/** 外部店铺ID(如拼多多 mall_id) */
externalShopId?: null | string;
/** 外部/平台店铺表主键 ID(如 channel_pdd_shop.id) */
externalShopId?: null | number;
/** 关联的拼多多外部店铺(已授权绑定时返回) */
pddShop?: null | PddShopInfo;
/** 创建时间 */