feat:【antd/ele】【mall/product】优化 api 的注释

This commit is contained in:
YunaiV
2025-11-20 09:16:08 +08:00
parent 19c45368db
commit 2e4d79c99d
16 changed files with 288 additions and 392 deletions

View File

@@ -3,12 +3,6 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace MallCommentApi {
export interface Property {
propertyId: number; // 属性 ID
propertyName: string; // 属性名称
valueId: number; // 属性值 ID
valueName: string; // 属性值名称
}
/** 商品评论 */
export interface Comment {
id: number; // 评论编号
@@ -32,17 +26,22 @@ export namespace MallCommentApi {
replyContent: string; // 回复内容
replyTime: Date; // 回复时间
createTime: Date; // 创建时间
skuProperties: Property[]; // SKU 属性数组
skuProperties: {
propertyId: number; // 属性 ID
propertyName: string; // 属性名称
valueId: number; // 属性值 ID
valueName: string; // 属性值名称
}[]; // SKU 属性数组
}
/** 评论可见性更新 */
export interface CommentVisibleUpdate {
/** 评论可见性更新请求 */
export interface CommentVisibleUpdateReqVO {
id: number; // 评论编号
visible: boolean; // 是否可见
}
/** 评论回复 */
export interface CommentReply {
/** 评论回复请求 */
export interface CommentReplyReqVO {
id: number; // 评论编号
replyContent: string; // 回复内容
}
@@ -70,12 +69,12 @@ export function createComment(data: MallCommentApi.Comment) {
/** 显示 / 隐藏评论 */
export function updateCommentVisible(
data: MallCommentApi.CommentVisibleUpdate,
data: MallCommentApi.CommentVisibleUpdateReqVO,
) {
return requestClient.put('/product/comment/update-visible', data);
}
/** 商家回复 */
export function replyComment(data: MallCommentApi.CommentReply) {
export function replyComment(data: MallCommentApi.CommentReplyReqVO) {
return requestClient.put('/product/comment/reply', data);
}

View File

@@ -12,9 +12,7 @@ export namespace MallHistoryApi {
}
}
/**
*
*/
/** 获得商品浏览记录分页 */
export function getBrowseHistoryPage(params: PageParam) {
return requestClient.get<PageResult<MallHistoryApi.BrowseHistory>>(
'/product/browse-history/page',

View File

@@ -17,11 +17,6 @@ export namespace MallPropertyApi {
name: string; // 名称
remark?: string; // 备注
}
/** 属性值查询参数 */
export interface PropertyValueQuery extends PageParam {
propertyId?: number; // 属性编号
}
}
/** 创建属性项 */
@@ -62,9 +57,7 @@ export function getPropertySimpleList() {
}
/** 获得属性值分页 */
export function getPropertyValuePage(
params: MallPropertyApi.PropertyValueQuery,
) {
export function getPropertyValuePage(params: PageParam) {
return requestClient.get<PageResult<MallPropertyApi.PropertyValue>>(
'/product/property/value/page',
{ params },

View File

@@ -3,39 +3,6 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace MallSpuApi {
/** 商品属性 */
export interface Property {
propertyId?: number; // 属性编号
propertyName?: string; // 属性名称
valueId?: number; // 属性值编号
valueName?: string; // 属性值名称
}
/** 商品 SKU */
export interface Sku {
id?: number; // 商品 SKU 编号
name?: string; // 商品 SKU 名称
spuId?: number; // SPU 编号
properties?: Property[]; // 属性数组
price?: number | string; // 商品价格
marketPrice?: number | string; // 市场价
costPrice?: number | string; // 成本价
barCode?: string; // 商品条码
picUrl?: string; // 图片地址
stock?: number; // 库存
weight?: number; // 商品重量单位kg 千克
volume?: number; // 商品体积单位m^3 平米
firstBrokeragePrice?: number | string; // 一级分销的佣金
secondBrokeragePrice?: number | string; // 二级分销的佣金
salesCount?: number; // 商品销量
}
/** 优惠券模板 */
export interface GiveCouponTemplate {
id?: number; // 优惠券编号
name?: string; // 优惠券名称
}
/** 商品 SPU */
export interface Spu {
id?: number; // 商品编号
@@ -68,8 +35,42 @@ export namespace MallSpuApi {
browseCount?: number; // 浏览量
}
/** 商品状态更新 */
export interface StatusUpdate {
/** 商品 SKU */
export interface Sku {
id?: number; // 商品 SKU 编号
name?: string; // 商品 SKU 名称
spuId?: number; // SPU 编号
properties?: Property[]; // 属性数组
price?: number | string; // 商品价格
marketPrice?: number | string; // 市场价
costPrice?: number | string; // 成本价
barCode?: string; // 商品条码
picUrl?: string; // 图片地址
stock?: number; // 库存
weight?: number; // 商品重量单位kg 千克
volume?: number; // 商品体积单位m^3 平米
firstBrokeragePrice?: number | string; // 一级分销的佣金
secondBrokeragePrice?: number | string; // 二级分销的佣金
salesCount?: number; // 商品销量
}
/** 商品属性 */
export interface Property {
propertyId?: number; // 属性编号
propertyName?: string; // 属性名称
valueId?: number; // 属性值编号
valueName?: string; // 属性值名称
}
// TODO @puhui999这个还要么
/** 优惠券模板 */
export interface GiveCouponTemplate {
id?: number; // 优惠券编号
name?: string; // 优惠券名称
}
/** 商品状态更新请求 */
export interface SpuStatusUpdateReqVO {
id: number; // 商品编号
status: number; // 商品状态
}
@@ -98,7 +99,7 @@ export function updateSpu(data: MallSpuApi.Spu) {
}
/** 更新商品 SPU 状态 */
export function updateStatus(data: MallSpuApi.StatusUpdate) {
export function updateStatus(data: MallSpuApi.SpuStatusUpdateReqVO) {
return requestClient.put('/product/spu/update-status', data);
}