index.ts
2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import request from '@/config/axios'
const MonthlySubscriptionApi = {
// 获得月卡分页
getMonthlySubscriptionPage: (params: any) => {
return request.get({
url: '/card/page',
params
})
},
// 创建卡
createMonthlySubscription: (data: any) => {
return request.post({
url: 'card',
data
})
},
// 更新卡
updateMonthlySubscription: (data: any) => {
return request.put({
url: 'card',
data
})
},
// 获得卡
getMonthlySubscription: (id: number) => {
return request.get({
url: '/card/get?id=' + id
})
},
// 删除包月私教卡及下所有套餐
deleteMonthlySubscription: (id: number) => {
return request.delete({
url: `/card/${id}`
})
},
// 批量删除包月私教卡及下所有套餐
deleteMonthlySubscriptionBatch: (data: number[]) => {
return request.delete({
url: '/card/delete-list',
data: { ids: data }
})
},
// 对应卡所有套餐
getSetmealPage: (params: any) => {
return request.get({
url: '/card/specifications/page',
params
})
},
// 创建套餐
createSetmeal: (data: any) => {
return request.post({
url: '/card/specifications/create',
data
})
},
// 更新套餐
updateSetmeal: (data: any) => {
return request.put({
url: '/card/specifications/update',
data
})
},
// 获取套餐
getSetmeal: (id: number) => {
return request.get({
url: `/card/specifications/${id}`
})
},
// 删除套餐
deleteSetmeal: (id: number) => {
return request.delete({
url: `/card/specifications/delete`,
params: {
id
}
})
},
// 批量删除套餐
deleteSetmealBatch: (ids: number[]) => {
return request.delete({
url: `/card/specifications/delete-list`,
data: { ids }
})
},
// 获得月卡拥有记录分页
getMonthlySubscriptionRecordPage: (params: any) => {
return request.get({
url: '/user/card/page',
params
})
},
// 获得用户使用月卡记录
getUserMonthlySubscriptionRecord: (params: any) => {
return request.get({
url: '/user/card/usage-log/page',
params
})
},
}
export default MonthlySubscriptionApi