This commit is contained in:
2025-01-08 09:44:25 +08:00
parent 06f6e29972
commit 4d21314fc6
60 changed files with 5477 additions and 4495 deletions
+13 -12
View File
@@ -1,14 +1,15 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserInvoice, UserInvoiceParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
import { THINK_API_URL } from '@/config/setting';
import type {ThinkInvoice} from "@/api/think/thinkInvoice/model";
/**
* 分页查询发票
*/
export async function pageUserInvoice(params: UserInvoiceParam) {
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
MODULES_API_URL + '/booking/user-invoice/page',
THINK_API_URL + '/booking/booking-user-invoice/page',
{
params
}
@@ -24,7 +25,7 @@ export async function pageUserInvoice(params: UserInvoiceParam) {
*/
export async function listUserInvoice(params?: UserInvoiceParam) {
const res = await request.get<ApiResult<UserInvoice[]>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
{
params
}
@@ -40,7 +41,7 @@ export async function listUserInvoice(params?: UserInvoiceParam) {
*/
export async function addUserInvoice(data: UserInvoice) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
data
);
if (res.data.code === 0) {
@@ -54,7 +55,7 @@ export async function addUserInvoice(data: UserInvoice) {
*/
export async function updateUserInvoice(data: UserInvoice) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
THINK_API_URL + '/booking/booking-user-invoice',
data
);
if (res.data.code === 0) {
@@ -68,7 +69,7 @@ export async function updateUserInvoice(data: UserInvoice) {
*/
export async function removeUserInvoice(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/' + id
THINK_API_URL + '/booking/booking-user-invoice/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -81,7 +82,7 @@ export async function removeUserInvoice(id?: number) {
*/
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/batch',
THINK_API_URL + '/booking/booking-user-invoice/batch',
{
data
}
@@ -97,7 +98,7 @@ export async function removeBatchUserInvoice(data: (number | undefined)[]) {
*/
export async function getUserInvoice(id: number) {
const res = await request.get<ApiResult<UserInvoice>>(
MODULES_API_URL + '/booking/user-invoice/' + id
THINK_API_URL + '/booking/booking-user-invoice/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
@@ -108,9 +109,9 @@ export async function getUserInvoice(id: number) {
/**
* 开具发票
*/
export async function doInvoice(data: UserInvoice) {
export async function doInvoice(data: ThinkInvoice) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/doInvoice',
THINK_API_URL + '/think/think-invoice/doInvoice',
data
);
if (res.data.code === 0) {
@@ -123,9 +124,9 @@ export async function doInvoice(data: UserInvoice) {
/**
* 根据orderNo查询发票
*/
export async function showInvoice(orderNo: string) {
export async function showInvoice(id: number) {
const res = await request.get<ApiResult<UserInvoice>>(
MODULES_API_URL + '/booking/user-invoice/showInvoice/' + orderNo
THINK_API_URL + `/think/think-invoice/showInvoice/${id}`
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
+12 -12
View File
@@ -1,6 +1,6 @@
import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api';
import {MODULES_API_URL} from '@/config/setting';
import {THINK_API_URL} from '@/config/setting';
import type {Cart, CartParam, CartVo} from "@/api/shop/cart/model";
import type {Merchant} from "@/api/shop/merchant/model";
@@ -9,7 +9,7 @@ import type {Merchant} from "@/api/shop/merchant/model";
*/
export async function pageCart(params: CartParam) {
const res = await request.get<ApiResult<PageResult<Cart>>>(
MODULES_API_URL + '/shop/cart/page',
THINK_API_URL + '/shop/cart/page',
{
params
}
@@ -25,7 +25,7 @@ export async function pageCart(params: CartParam) {
*/
export async function listCart(params?: CartParam) {
const res = await request.get<ApiResult<CartVo>>(
MODULES_API_URL + '/shop/cart',
THINK_API_URL + '/shop/cart',
{
params
}
@@ -41,7 +41,7 @@ export async function listCart(params?: CartParam) {
*/
export async function addCart(data: Cart) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart',
THINK_API_URL + '/shop/cart',
data
);
console.log(res)
@@ -56,7 +56,7 @@ export async function addCart(data: Cart) {
*/
export async function updateCart(data: Cart) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart',
THINK_API_URL + '/shop/cart',
data
);
if (res.data.code === 0) {
@@ -70,7 +70,7 @@ export async function updateCart(data: Cart) {
*/
export async function removeCart(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/' + id
THINK_API_URL + '/shop/cart/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -81,7 +81,7 @@ export async function removeCart(id?: number) {
// 按店铺ID更新选中
export async function updateCartByMerchantId(id?: number) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/updateCartByMerchantId/' + id
THINK_API_URL + '/shop/cart/updateCartByMerchantId/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -93,7 +93,7 @@ export async function updateCartByMerchantId(id?: number) {
// 全选操作
export async function onSelectAll(yes: Boolean) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/onSelectAll/' + yes
THINK_API_URL + '/shop/cart/onSelectAll/' + yes
);
if (res.data.code === 0) {
return res.data;
@@ -105,7 +105,7 @@ export async function onSelectAll(yes: Boolean) {
* 批量修改
*/
export async function updateBatchCart(data: Cart[]) {
const res = await request.put<ApiResult<unknown>>(MODULES_API_URL + '/shop/cart/batch', data);
const res = await request.put<ApiResult<unknown>>(THINK_API_URL + '/shop/cart/batch', data);
if (res.data.code === 0) {
return res.data.message;
}
@@ -117,7 +117,7 @@ export async function updateBatchCart(data: Cart[]) {
*/
export async function removeBatchCart(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/batch',
THINK_API_URL + '/shop/cart/batch',
data
);
if (res.data.code === 0) {
@@ -131,7 +131,7 @@ export async function removeBatchCart(data: (number | undefined)[]) {
*/
export async function getCart(id: number) {
const res = await request.get<ApiResult<Cart>>(
MODULES_API_URL + '/shop/cart/' + id
THINK_API_URL + '/shop/cart/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
@@ -144,7 +144,7 @@ export async function getCart(id: number) {
*/
export async function myCart(params: CartParam) {
const res = await request.get<ApiResult<Merchant[]>>(
MODULES_API_URL + '/shop/cart/myCart',
THINK_API_URL + '/shop/cart/myCart',
{
params
}
+3 -2
View File
@@ -123,8 +123,9 @@ export async function bindCard(data: ThinkCard) {
THINK_API_URL + '/think/think-card/bindCard',
data
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
console.log('res.data.code', res.data.code)
if (res.data.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkCardsBills, ThinkCardsBillsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询Vip卡每日账单
*/
export async function pageThinkCardsBills(params: ThinkCardsBillsParam) {
const res = await request.get<ApiResult<PageResult<ThinkCardsBills>>>(
MODULES_API_URL + '/think/think-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 listThinkCardsBills(params?: ThinkCardsBillsParam) {
const res = await request.get<ApiResult<ThinkCardsBills[]>>(
MODULES_API_URL + '/think/think-cards-bills',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加Vip卡每日账单
*/
export async function addThinkCardsBills(data: ThinkCardsBills) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-cards-bills',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改Vip卡每日账单
*/
export async function updateThinkCardsBills(data: ThinkCardsBills) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-cards-bills',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除Vip卡每日账单
*/
export async function removeThinkCardsBills(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-cards-bills/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除Vip卡每日账单
*/
export async function removeBatchThinkCardsBills(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-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 getThinkCardsBills(id: number) {
const res = await request.get<ApiResult<ThinkCardsBills>>(
MODULES_API_URL + '/think/think-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,35 @@
import type { PageParam } from '@/api';
/**
* Vip卡每日账单
*/
export interface ThinkCardsBills {
//
id?: number;
//
uid?: number;
//
cid?: 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 ThinkCardsBillsParam extends PageParam {
id?: number;
keywords?: string;
}
+1 -1
View File
@@ -44,7 +44,7 @@ export async function addThinkDeposit(data: ThinkDeposit) {
data
);
if (res.data.code === 0) {
return res.data.message;
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkDepositItem, ThinkDepositItemParam } from './model';
import { THINK_API_URL } from '@/config/setting';
/**
* 分页查询押金物品
*/
export async function pageThinkDepositItem(params: ThinkDepositItemParam) {
const res = await request.get<ApiResult<PageResult<ThinkDepositItem>>>(
THINK_API_URL + '/think/think-deposit-item/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询押金物品列表
*/
export async function listThinkDepositItem(params?: ThinkDepositItemParam) {
const res = await request.get<ApiResult<ThinkDepositItem[]>>(
THINK_API_URL + '/think/think-deposit-item',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加押金物品
*/
export async function addThinkDepositItem(data: ThinkDepositItem) {
const res = await request.post<ApiResult<unknown>>(
THINK_API_URL + '/think/think-deposit-item',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改押金物品
*/
export async function updateThinkDepositItem(data: ThinkDepositItem) {
const res = await request.put<ApiResult<unknown>>(
THINK_API_URL + '/think/think-deposit-item',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除押金物品
*/
export async function removeThinkDepositItem(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-deposit-item/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除押金物品
*/
export async function removeBatchThinkDepositItem(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-deposit-item/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询押金物品
*/
export async function getThinkDepositItem(id: number) {
const res = await request.get<ApiResult<ThinkDepositItem>>(
THINK_API_URL + '/think/think-deposit-item/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -0,0 +1,27 @@
import type { PageParam } from '@/api';
/**
* 押金物品
*/
export interface ThinkDepositItem {
//
id?: number;
//
title?: string;
//
amount?: string;
//
siteName?: string;
// 创建时间
createTime?: number;
// 租户id
tenantId?: number;
}
/**
* 押金物品搜索条件
*/
export interface ThinkDepositItemParam extends PageParam {
id?: number;
keywords?: string;
}
+1 -1
View File
@@ -44,7 +44,7 @@ export async function addThinkGoodsOrder(data: ThinkGoodsOrder) {
data
);
if (res.data.code === 0) {
return res.data.message;
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+1 -1
View File
@@ -44,7 +44,7 @@ export async function addThinkInvoice(data: ThinkInvoice) {
data
);
if (res.data.code === 0) {
return res.data.message;
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkMachineOpenLog, ThinkMachineOpenLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询闸机开门记录
*/
export async function pageThinkMachineOpenLog(params: ThinkMachineOpenLogParam) {
const res = await request.get<ApiResult<PageResult<ThinkMachineOpenLog>>>(
MODULES_API_URL + '/think/think-machine-open-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询闸机开门记录列表
*/
export async function listThinkMachineOpenLog(params?: ThinkMachineOpenLogParam) {
const res = await request.get<ApiResult<ThinkMachineOpenLog[]>>(
MODULES_API_URL + '/think/think-machine-open-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加闸机开门记录
*/
export async function addThinkMachineOpenLog(data: ThinkMachineOpenLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改闸机开门记录
*/
export async function updateThinkMachineOpenLog(data: ThinkMachineOpenLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除闸机开门记录
*/
export async function removeThinkMachineOpenLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除闸机开门记录
*/
export async function removeBatchThinkMachineOpenLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询闸机开门记录
*/
export async function getThinkMachineOpenLog(id: number) {
const res = await request.get<ApiResult<ThinkMachineOpenLog>>(
MODULES_API_URL + '/think/think-machine-open-log/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -0,0 +1,31 @@
import type { PageParam } from '@/api';
/**
* 闸机开门记录
*/
export interface ThinkMachineOpenLog {
//
id?: number;
//
orderId?: number;
// 租户id
tenantId?: number;
// 备注
comments?: string;
// 状态, 0在线, 1离线
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 闸机开门记录搜索条件
*/
export interface ThinkMachineOpenLogParam extends PageParam {
id?: number;
keywords?: string;
}
+10
View File
@@ -105,6 +105,16 @@ export async function getThinkOrder(id: number) {
return Promise.reject(new Error(res.data.message));
}
export async function getThinkOrderByCode(code: string) {
const res = await request.get<ApiResult<ThinkOrder>>(
THINK_API_URL + `/think/think-order/by-code/${code}`
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkOrderRepay(data: ThinkOrder) {
const res = await request.post<ApiResult<ThinkOrder>>(
THINK_API_URL + '/think/think-order/repay', data
+11
View File
@@ -104,6 +104,7 @@ export async function getThinkUsersVip(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkUsersVipRepay(data: any) {
const res = await request.post<ApiResult<ThinkUsersVip>>(
THINK_API_URL + '/think/think-users-vip/repay', data
@@ -113,3 +114,13 @@ export async function thinkUsersVipRepay(data: any) {
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkUsersVipLog(id: number) {
const res = await request.get<ApiResult<any[]>>(
THINK_API_URL + `/think/think-users-vip/log/${id}`
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkVipCardsBills, ThinkVipCardsBillsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询Vip卡每日账单
*/
export async function pageThinkVipCardsBills(params: ThinkVipCardsBillsParam) {
const res = await request.get<ApiResult<PageResult<ThinkVipCardsBills>>>(
MODULES_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[]>>(
MODULES_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));
}
/**
* 添加Vip卡每日账单
*/
export async function addThinkVipCardsBills(data: ThinkVipCardsBills) {
const res = await request.post<ApiResult<unknown>>(
MODULES_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>>(
MODULES_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>>(
MODULES_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>>(
MODULES_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>>(
MODULES_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,35 @@
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;
}