8d0ddbb5ef
- 补充 RefObject import(local-captcha、slider-captcha、node-group-form) - 删除 slider-captcha 中无用的 _scaleX/_scaleY 变量 - user_subscribe_id 类型转换 number → string - 移除 services 文件中失效的 @ts-expect-error 指令
93 lines
2.2 KiB
TypeScript
93 lines
2.2 KiB
TypeScript
/* eslint-disable */
|
|
import request from "@workspace/ui/lib/request";
|
|
|
|
/** Update coupon PUT /v1/admin/coupon/ */
|
|
export async function updateCoupon(
|
|
body: API.UpdateCouponRequest,
|
|
options?: { [key: string]: any }
|
|
) {
|
|
return request<API.Response & { data?: any }>(
|
|
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/coupon/`,
|
|
{
|
|
method: "PUT",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
data: body,
|
|
...(options || {}),
|
|
}
|
|
);
|
|
}
|
|
|
|
/** Create coupon POST /v1/admin/coupon/ */
|
|
export async function createCoupon(
|
|
body: API.CreateCouponRequest,
|
|
options?: { [key: string]: any }
|
|
) {
|
|
return request<API.Response & { data?: any }>(
|
|
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/coupon/`,
|
|
{
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
data: body,
|
|
...(options || {}),
|
|
}
|
|
);
|
|
}
|
|
|
|
/** Delete coupon DELETE /v1/admin/coupon/ */
|
|
export async function deleteCoupon(
|
|
body: API.DeleteCouponRequest,
|
|
options?: { [key: string]: any }
|
|
) {
|
|
return request<API.Response & { data?: any }>(
|
|
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/coupon/`,
|
|
{
|
|
method: "DELETE",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
data: body,
|
|
...(options || {}),
|
|
}
|
|
);
|
|
}
|
|
|
|
/** Batch delete coupon DELETE /v1/admin/coupon/batch */
|
|
export async function batchDeleteCoupon(
|
|
body: API.BatchDeleteCouponRequest,
|
|
options?: { [key: string]: any }
|
|
) {
|
|
return request<API.Response & { data?: any }>(
|
|
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/coupon/batch`,
|
|
{
|
|
method: "DELETE",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
data: body,
|
|
...(options || {}),
|
|
}
|
|
);
|
|
}
|
|
|
|
/** Get coupon list GET /v1/admin/coupon/list */
|
|
export async function getCouponList(
|
|
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
params: API.GetCouponListParams,
|
|
options?: { [key: string]: any }
|
|
) {
|
|
return request<API.Response & { data?: API.GetCouponListResponse }>(
|
|
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/coupon/list`,
|
|
{
|
|
method: "GET",
|
|
params: {
|
|
...params,
|
|
},
|
|
...(options || {}),
|
|
}
|
|
);
|
|
}
|