From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/api/mall/promotion/diy/template.ts |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/src/api/mall/promotion/diy/template.ts b/src/api/mall/promotion/diy/template.ts
new file mode 100644
index 0000000..87134c9
--- /dev/null
+++ b/src/api/mall/promotion/diy/template.ts
@@ -0,0 +1,58 @@
+import request from '@/config/axios'
+import { DiyPageVO } from '@/api/mall/promotion/diy/page'
+
+export interface DiyTemplateVO {
+  id?: number
+  name: string
+  used: boolean
+  usedTime?: Date
+  remark: string
+  previewPicUrls: string[]
+  property: string
+}
+
+export interface DiyTemplatePropertyVO extends DiyTemplateVO {
+  pages: DiyPageVO[]
+}
+
+// 鏌ヨ瑁呬慨妯℃澘鍒楄〃
+export const getDiyTemplatePage = async (params: any) => {
+  return await request.get({ url: `/promotion/diy-template/page`, params })
+}
+
+// 鏌ヨ瑁呬慨妯℃澘璇︽儏
+export const getDiyTemplate = async (id: number) => {
+  return await request.get({ url: `/promotion/diy-template/get?id=` + id })
+}
+
+// 鏂板瑁呬慨妯℃澘
+export const createDiyTemplate = async (data: DiyTemplateVO) => {
+  return await request.post({ url: `/promotion/diy-template/create`, data })
+}
+
+// 淇敼瑁呬慨妯℃澘
+export const updateDiyTemplate = async (data: DiyTemplateVO) => {
+  return await request.put({ url: `/promotion/diy-template/update`, data })
+}
+
+// 鍒犻櫎瑁呬慨妯℃澘
+export const deleteDiyTemplate = async (id: number) => {
+  return await request.delete({ url: `/promotion/diy-template/delete?id=` + id })
+}
+
+// 浣跨敤瑁呬慨妯℃澘
+export const useDiyTemplate = async (id: number) => {
+  return await request.put({ url: `/promotion/diy-template/use?id=` + id })
+}
+
+// 鑾峰緱瑁呬慨妯℃澘灞炴��
+export const getDiyTemplateProperty = async (id: number) => {
+  return await request.get<DiyTemplatePropertyVO>({
+    url: `/promotion/diy-template/get-property?id=` + id
+  })
+}
+
+// 鏇存柊瑁呬慨妯℃澘灞炴��
+export const updateDiyTemplateProperty = async (data: DiyTemplateVO) => {
+  return await request.put({ url: `/promotion/diy-template/update-property`, data })
+}

--
Gitblit v1.8.0