250108
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ThinkVipCardsBills, ThinkVipCardsBillsParam } from './model';
|
||||
import { THINK_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询Vip卡每日账单
|
||||
*/
|
||||
export async function pageThinkVipCardsBills(params: ThinkVipCardsBillsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ThinkVipCardsBills>>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询Vip卡每日账单列表
|
||||
*/
|
||||
export async function listThinkVipCardsBills(params?: ThinkVipCardsBillsParam) {
|
||||
const res = await request.get<ApiResult<ThinkVipCardsBills[]>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function thinkVipCardsBillsTotalAmount(params?: ThinkVipCardsBillsParam) {
|
||||
const res = await request.get<ApiResult<ThinkVipCardsBills[]>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/total-amount',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加Vip卡每日账单
|
||||
*/
|
||||
export async function addThinkVipCardsBills(data: ThinkVipCardsBills) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改Vip卡每日账单
|
||||
*/
|
||||
export async function updateThinkVipCardsBills(data: ThinkVipCardsBills) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Vip卡每日账单
|
||||
*/
|
||||
export async function removeThinkVipCardsBills(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除Vip卡每日账单
|
||||
*/
|
||||
export async function removeBatchThinkVipCardsBills(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询Vip卡每日账单
|
||||
*/
|
||||
export async function getThinkVipCardsBills(id: number) {
|
||||
const res = await request.get<ApiResult<ThinkVipCardsBills>>(
|
||||
THINK_API_URL + '/think/think-vip-cards-bills/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* Vip卡每日账单
|
||||
*/
|
||||
export interface ThinkVipCardsBills {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
uid?: number;
|
||||
//
|
||||
vid?: number;
|
||||
//
|
||||
date?: string;
|
||||
//
|
||||
amount?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vip卡每日账单搜索条件
|
||||
*/
|
||||
export interface ThinkVipCardsBillsParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
dateStart?: string;
|
||||
dateEnd?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user