bookingUser改为shopUser
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { OrderInfo } from "@/api/shop/orderInfo/model";
|
||||
|
||||
/**
|
||||
* 预约订单
|
||||
@@ -68,7 +69,7 @@ export interface Order {
|
||||
isInvoice?: string;
|
||||
// 下单时间
|
||||
createTime?: number;
|
||||
//
|
||||
//
|
||||
updateTime?: number;
|
||||
// 付款时间
|
||||
payTime?: number;
|
||||
@@ -84,6 +85,12 @@ export interface Order {
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户图标
|
||||
merchantAvatar?: string;
|
||||
//
|
||||
orderInfoList?: OrderInfo[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,4 +99,5 @@ export interface Order {
|
||||
export interface OrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
106
src/api/shop/orderInfo/index.ts
Normal file
106
src/api/shop/orderInfo/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderInfo, OrderInfoParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrderInfo(params: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderInfo>>>(
|
||||
MODULES_API_URL + '/shop/order-info/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrderInfo(params?: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<OrderInfo[]>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addOrderInfo(data: OrderInfo) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrderInfo(data: OrderInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrderInfo(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrderInfo(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-info/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrderInfo(id: number) {
|
||||
const res = await request.get<ApiResult<OrderInfo>>(
|
||||
MODULES_API_URL + '/shop/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
src/api/shop/orderInfo/model/index.ts
Normal file
55
src/api/shop/orderInfo/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface OrderInfo {
|
||||
//
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
oid?: number;
|
||||
// 关联场馆id
|
||||
sid?: number;
|
||||
// 关联场地id
|
||||
fid?: number;
|
||||
// 场馆
|
||||
siteName?: string;
|
||||
// 场地
|
||||
fieldName?: string;
|
||||
// 预约时间段
|
||||
dateTime?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 成人人数
|
||||
adultNum?: string;
|
||||
// 儿童人数
|
||||
childrenNum?: string;
|
||||
// 1已付款,2未付款,3无需付款或占用状态
|
||||
payStatus?: string;
|
||||
// 是否免费:1免费、2收费
|
||||
isFree?: string;
|
||||
// 是否支持儿童票:1支持,2不支持
|
||||
isChildren?: string;
|
||||
// 预订类型:1全场,2半场
|
||||
type?: string;
|
||||
// 组合数据:日期+时间段+场馆id+场地id
|
||||
mergeData?: string;
|
||||
// 开场时间
|
||||
startTime?: number;
|
||||
// 下单时间
|
||||
orderTime?: number;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderInfoParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/users/index.ts
Normal file
106
src/api/shop/users/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Users, UsersParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户
|
||||
*/
|
||||
export async function pageUsers(params: UsersParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Users>>>(
|
||||
MODULES_API_URL + '/shop/users/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function listUsers(params?: UsersParam) {
|
||||
const res = await request.get<ApiResult<Users[]>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户
|
||||
*/
|
||||
export async function addUsers(data: Users) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
export async function updateUsers(data: Users) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
export async function removeUsers(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户
|
||||
*/
|
||||
export async function removeBatchUsers(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/users/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户
|
||||
*/
|
||||
export async function getUsers(id: number) {
|
||||
const res = await request.get<ApiResult<Users>>(
|
||||
MODULES_API_URL + '/shop/users/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
73
src/api/shop/users/model/index.ts
Normal file
73
src/api/shop/users/model/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface Users {
|
||||
//
|
||||
userId?: number;
|
||||
// 用户唯一小程序id
|
||||
openid?: string;
|
||||
// 小程序用户秘钥
|
||||
sessionKey?: string;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
sex?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 省份
|
||||
province?: string;
|
||||
// 城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 邮箱是否验证, 0否, 1是
|
||||
emailVerified?: number;
|
||||
// 积分
|
||||
points?: string;
|
||||
// 余额
|
||||
balance?: string;
|
||||
// 注册时间
|
||||
addTime?: number;
|
||||
// 身份证号码
|
||||
idCard?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: number;
|
||||
// 客户端ID
|
||||
clientId?: string;
|
||||
// 注册来源客户端 (APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UsersParam extends PageParam {
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user