Product Favorite API Client (favorite/index.ts)

ruoyi-office-vben · apps/web-ele/src/api/mall/product/favorite/index.ts · typescript · MIT
crm, integration, lang:typescript, tag:product, tag:favorites, tag:mall

An API service module for retrieving paginated lists of user-favorited products. Use this to fetch and display customer preference data in the mall backend.

// Source: https://github.com/yuqing2026/ruoyi-office-vben | License: MIT | Copyright 2024-present, Vben
// Provided via justclaw.it.com; keep this notice with the code.
import type { PageParam, PageResult } from '@vben/request';

import { requestClient } from '#/api/request';

export namespace MallFavoriteApi {
  /** 商品收藏 */
  export interface Favorite {
    id?: number; // 收藏编号
    userId?: string; // 用户编号
    spuId?: number; // 商品 SPU 编号
  }
}

/** 获得商品收藏列表 */
export function getFavoritePage(params: PageParam) {
  return requestClient.get<PageResult<MallFavoriteApi.Favorite>>(
    '/product/favorite/page',
    { params },
  );
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key