import { AxiosInstance } from "axios"; import { int32, int64 } from "../type"; import { AsyncReply, Page } from "../shared"; export default class ProductService { static readonly SERVICE_NAME = "portal-provider/product"; constructor(private readonly http: AxiosInstance) {} /** * 分页查询商品信息 * @param input */ queryProductPage(input: ProductQuery): AsyncReply> { return this.http .post(`${ProductService.SERVICE_NAME}/query`, input) .then(r => r.data); } /** * 根据ID获取商品信息 * @param productId */ findProductById(productId: int64): AsyncReply { return this.http .get(`${ProductService.SERVICE_NAME}/${productId}`) .then(r => r.data); } /** * 根据分类ID获取模版信息 * @param categoryId */ findTemplateByCategoryId(categoryId: int32): AsyncReply