修改了首页

This commit is contained in:
2026-03-05 13:32:48 +08:00
commit 2c80df8b07
322 changed files with 48063 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopUserReferee, ShopUserRefereeParam } from './model';
/**
* 分页查询用户推荐关系表
*/
export async function pageShopUserReferee(params: ShopUserRefereeParam) {
const res = await request.get<ApiResult<PageResult<ShopUserReferee>>>(
'/shop/shop-user-referee/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询用户推荐关系表列表
*/
export async function listShopUserReferee(params?: ShopUserRefereeParam) {
const res = await request.get<ApiResult<ShopUserReferee[]>>(
'/shop/shop-user-referee',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加用户推荐关系表
*/
export async function addShopUserReferee(data: ShopUserReferee) {
const res = await request.post<ApiResult<unknown>>(
'/shop/shop-user-referee',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改用户推荐关系表
*/
export async function updateShopUserReferee(data: ShopUserReferee) {
const res = await request.put<ApiResult<unknown>>(
'/shop/shop-user-referee',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除用户推荐关系表
*/
export async function removeShopUserReferee(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/shop/shop-user-referee/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除用户推荐关系表
*/
export async function removeBatchShopUserReferee(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/shop/shop-user-referee/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询用户推荐关系表
*/
export async function getShopUserReferee(id: number) {
const res = await request.get<ApiResult<ShopUserReferee>>(
'/shop/shop-user-referee/' + 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,33 @@
import type { PageParam } from '@/api';
/**
* 用户推荐关系表
*/
export interface ShopUserReferee {
// 主键ID
id?: number;
// 推荐人ID
dealerId?: number;
// 用户id(被推荐人)
userId?: number;
// 推荐关系层级(1,2,3)
level?: number;
// 备注
comments?: string;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 用户推荐关系表搜索条件
*/
export interface ShopUserRefereeParam extends PageParam {
id?: number;
keywords?: string;
}