优化网站导航模块

This commit is contained in:
2024-08-23 22:28:24 +08:00
parent 1d81fa9270
commit 13832d9de0
964 changed files with 90774 additions and 31362 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Match, MatchParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询比赛信息表
*/
export async function pageMatch(params: MatchParam) {
const res = await request.get<ApiResult<PageResult<Match>>>(
MODULES_API_URL + '/booking/match/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询比赛信息表列表
*/
export async function listMatch(params?: MatchParam) {
const res = await request.get<ApiResult<Match[]>>(
MODULES_API_URL + '/booking/match',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加比赛信息表
*/
export async function addMatch(data: Match) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/match',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改比赛信息表
*/
export async function updateMatch(data: Match) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/match',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除比赛信息表
*/
export async function removeMatch(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/match/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除比赛信息表
*/
export async function removeBatchMatch(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/match/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询比赛信息表
*/
export async function getMatch(id: number) {
const res = await request.get<ApiResult<Match>>(
MODULES_API_URL + '/booking/match/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,73 @@
import type { PageParam } from '@/api';
/**
* 比赛信息表
*/
export interface Match {
// 赛事ID
matchId?: number;
// 标题
title?: string;
// 比赛类型 0常规比赛
type?: number;
// 活动开始时间
matchStartTime?: number;
// 活动结束时间
matchEndTime?: number;
// 报名时间
bmStartTime?: number;
// 报名时间
bmEndTime?: number;
// 文章分类ID
categoryId?: number;
// 封面图
image?: string;
// 虚拟阅读量(仅用作展示)
virtualViews?: number;
// 实际阅读量
actualViews?: number;
// 文章附件
files?: string;
// 视频地址
video?: string;
// 退费规则
refundRule?: string;
// 活动介绍
content?: string;
// 经度
longitude?: string;
// 纬度
latitude?: string;
// 比赛活动地点
address?: string;
// 报名费用
price?: string;
// 已报名人数
users?: number;
// 报名人数限制
maxUsers?: number;
// 用户ID
userId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0未开始, 1进行中2已结束
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 比赛信息表搜索条件
*/
export interface MatchParam extends PageParam {
matchId?: number;
keywords?: string;
}