feat(core): 初始化项目基础架构和CMS功能模块
- 添加Docker相关配置文件(.dockerignore, .env.example, .gitignore) - 实现服务端API代理功能,支持文件、模块和服务器API转发 - 创建文章详情页、栏目文章列表页和单页内容展示页面 - 集成Ant Design Vue组件库并实现SSR样式提取功能 - 定义API响应数据结构类型和应用布局组件 - 开发开发者应用中心和文章管理页面 - 实现CMS导航菜单获取和多租户切换功能
This commit is contained in:
140
app/api/shop/shopDealerUser/index.ts
Normal file
140
app/api/shop/shopDealerUser/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerUser, ShopDealerUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商用户记录表
|
||||
*/
|
||||
export async function pageShopDealerUser(params: ShopDealerUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerUser>>>(
|
||||
'/shop/shop-dealer-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商用户记录表列表
|
||||
*/
|
||||
export async function listShopDealerUser(params?: ShopDealerUserParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser[]>>(
|
||||
'/shop/shop-dealer-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商用户记录表
|
||||
*/
|
||||
export async function addShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商用户记录表
|
||||
*/
|
||||
export async function updateShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商用户记录表
|
||||
*/
|
||||
export async function removeShopDealerUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商用户记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商用户记录表
|
||||
*/
|
||||
export async function getShopDealerUser(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser>>(
|
||||
'/shop/shop-dealer-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入分销商用户
|
||||
*/
|
||||
export async function importShopDealerUsers(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/import',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分销商用户
|
||||
*/
|
||||
export async function exportShopDealerUsers(params?: ShopDealerUserParam) {
|
||||
const res = await request.get<Blob>(
|
||||
'/shop/shop-dealer-user/export',
|
||||
{
|
||||
params,
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
60
app/api/shop/shopDealerUser/model/index.ts
Normal file
60
app/api/shop/shopDealerUser/model/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*/
|
||||
export interface ShopDealerUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 自增ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 支付密码
|
||||
payPassword?: string;
|
||||
// 当前可提现佣金
|
||||
money?: string;
|
||||
// 已冻结佣金
|
||||
freezeMoney?: string;
|
||||
// 累积提现佣金
|
||||
totalMoney?: string;
|
||||
// 佣金比例
|
||||
rate?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 成员数量(一级)
|
||||
firstNum?: number;
|
||||
// 成员数量(二级)
|
||||
secondNum?: number;
|
||||
// 成员数量(三级)
|
||||
thirdNum?: number;
|
||||
// 专属二维码
|
||||
qrcode?: string;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string | Date;
|
||||
// 修改时间
|
||||
updateTime?: string | Date;
|
||||
// 扩展字段,用于编辑表单
|
||||
shopDealerUserId?: number;
|
||||
shopDealerUserName?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商用户记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user