|
|
@@ -0,0 +1,24 @@
|
|
|
+import { request } from '@umijs/max';
|
|
|
+
|
|
|
+export async function fetchCreateProduct(body: API.CreateProductReq) {
|
|
|
+ return request<API.CreateProductResult>('/product/create', { method: 'POST', data: body });
|
|
|
+}
|
|
|
+
|
|
|
+export async function fetchInitialCredentials(body: { ticket: string }) {
|
|
|
+ return request<API.FetchCredentialsResult>('/product/fetchInitialCredentials', {
|
|
|
+ method: 'POST',
|
|
|
+ data: body,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+export async function fetchUpdateProduct(body: API.UpdateProductReq) {
|
|
|
+ return request<API.Result>('/product/update', { method: 'POST', data: body });
|
|
|
+}
|
|
|
+
|
|
|
+export async function fetchProductList(body: API.ProductListReq) {
|
|
|
+ return request<API.ProductListResult>('/product/list', { method: 'POST', data: body });
|
|
|
+}
|
|
|
+
|
|
|
+export async function fetchProductDetail(body: { id: number }) {
|
|
|
+ return request<API.ProductDetailResult>('/product/detail', { method: 'POST', data: body });
|
|
|
+}
|