feat(core): 初始化项目基础架构和CMS功能模块
- 添加Docker相关配置文件(.dockerignore, .env.example, .gitignore) - 实现服务端API代理功能,支持文件、模块和服务器API转发 - 创建文章详情页、栏目文章列表页和单页内容展示页面 - 集成Ant Design Vue组件库并实现SSR样式提取功能 - 定义API响应数据结构类型和应用布局组件 - 开发开发者应用中心和文章管理页面 - 实现CMS导航菜单获取和多租户切换功能
This commit is contained in:
104
app/api/user/balance-log/index.ts
Normal file
104
app/api/user/balance-log/index.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserBalanceLog, UserBalanceLogParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询余额明细
|
||||
*/
|
||||
export async function pageUserBalanceLog(params: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserBalanceLog>>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*/
|
||||
export async function listUserBalanceLog(params?: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog[]>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询余额明细
|
||||
*/
|
||||
export async function getUserBalanceLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加余额明细
|
||||
*/
|
||||
export async function addUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*/
|
||||
export async function updateUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLogs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/user-balance-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
app/api/user/balance-log/model/index.ts
Normal file
31
app/api/user/balance-log/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 余额明细
|
||||
*/
|
||||
export interface UserBalanceLog {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
money?: string;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserBalanceLogParam extends PageParam {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
103
app/api/user/feedback/index.ts
Normal file
103
app/api/user/feedback/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserFeedback, UserFeedbackParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询意见反馈
|
||||
*/
|
||||
export async function pageUserFeedback(params: UserFeedbackParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserFeedback>>>(
|
||||
'/shop/user-feedback/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询意见反馈列表
|
||||
*/
|
||||
export async function listUserFeedback(params?: UserFeedbackParam) {
|
||||
const res = await request.get<ApiResult<UserFeedback[]>>(
|
||||
'/shop/user-feedback',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询意见反馈
|
||||
*/
|
||||
export async function getUserFeedback(id: number) {
|
||||
const res = await request.get<ApiResult<UserFeedback>>(
|
||||
'/shop/user-feedback/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加意见反馈
|
||||
*/
|
||||
export async function addUserFeedback(data: UserFeedback) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/user-feedback',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见反馈
|
||||
*/
|
||||
export async function updateUserFeedback(data: UserFeedback) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/user-feedback',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除意见反馈
|
||||
*/
|
||||
export async function removeUserFeedback(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/user-feedback/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除意见反馈
|
||||
*/
|
||||
export async function removeBatchUserFeedbacks(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/user-feedback/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
app/api/user/feedback/model/index.ts
Normal file
29
app/api/user/feedback/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 意见反馈
|
||||
*/
|
||||
export interface UserFeedback {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
type?: string;
|
||||
content?: string;
|
||||
images?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserFeedbackParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
type?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
114
app/api/user/grade/index.ts
Normal file
114
app/api/user/grade/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Grade, GradeParam } from '@/api/user/grade/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageGrade(params: GradeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Grade>>>(
|
||||
SERVER_API_URL + '/system/user-grade/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listGrade(params?: GradeParam) {
|
||||
const res = await request.get<ApiResult<Grade[]>>('/system/user-grade', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addGrade(data: Grade) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>('/system/user-grade', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchGrade(data: Grade[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeGrade(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchGrade(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
app/api/user/grade/model/index.ts
Normal file
28
app/api/user/grade/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Grade {
|
||||
gradeId?: number;
|
||||
name?: string;
|
||||
weight?: string;
|
||||
upgrade?: string;
|
||||
equity?: string;
|
||||
commission?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface GradeParam extends PageParam {
|
||||
gradeId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
18
app/api/user/index.ts
Normal file
18
app/api/user/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { User } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 修改当前登录用户信息
|
||||
*/
|
||||
export async function authUser(data: User) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/auth/user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
app/api/user/model/index.ts
Normal file
57
app/api/user/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface User {
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 性别(字典)
|
||||
sex?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
// 手机号
|
||||
address?: string;
|
||||
// 个人简介
|
||||
introduction?: string;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 性别名称
|
||||
sexName?: string;
|
||||
// 机构名称
|
||||
organizationName?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
sex?: string;
|
||||
phone?: string;
|
||||
status?: number;
|
||||
organizationId?: number;
|
||||
sexName?: string;
|
||||
}
|
||||
109
app/api/user/recharge/export/index.ts
Normal file
109
app/api/user/recharge/export/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
RechargeOrder,
|
||||
RechargeOrderParam
|
||||
} from '@/api/user/recharge/export/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询充值计划
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值计划列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值计划
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值计划
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定充值计划
|
||||
*/
|
||||
export async function bindRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值计划
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值计划
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
app/api/user/recharge/export/model/index.ts
Normal file
37
app/api/user/recharge/export/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
rechargeType?: number;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
phone?: string;
|
||||
payPrice?: number;
|
||||
giftMoney?: number;
|
||||
actualMoney?: number;
|
||||
operator?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
expendMoney?: string;
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
organizationId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
}
|
||||
134
app/api/user/recharge/order/index.ts
Normal file
134
app/api/user/recharge/order/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { RechargeOrder, RechargeOrderParam } from './model/index';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
export async function recharge(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/recharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询充值记录
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值记录列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询充值记录
|
||||
*/
|
||||
export async function getRechargeOrder(id: number) {
|
||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值记录
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值记录
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值记录
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值记录
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量充值操作
|
||||
*/
|
||||
export async function batchRecharge(data: RechargeOrder[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/sys/recharge-order/batchRecharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
34
app/api/user/recharge/order/model/index.ts
Normal file
34
app/api/user/recharge/order/model/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
*/
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
orderNo?: string;
|
||||
money?: string;
|
||||
payPrice?: number;
|
||||
actualMoney?: number;
|
||||
organizationId?: number;
|
||||
rechargeType?: number;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
balance?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
102
app/api/user/referee/index.ts
Normal file
102
app/api/user/referee/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserReferee, UserRefereeParam } from '@/api/user/referee/model';
|
||||
/**
|
||||
* 分页查询推荐关系
|
||||
*/
|
||||
export async function pageUserReferee(params: UserRefereeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserReferee>>>(
|
||||
'/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 listUserReferee(params?: UserRefereeParam) {
|
||||
const res = await request.get<ApiResult<UserReferee[]>>(
|
||||
'/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 addUserReferee(data: UserReferee) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/user-referee',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改推荐关系
|
||||
*/
|
||||
export async function updateUserReferee(data: UserReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/user-referee', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定推荐关系
|
||||
*/
|
||||
export async function bindUserReferee(data: UserReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/user-referee/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除推荐关系
|
||||
*/
|
||||
export async function removeUserReferee(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/user-referee/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除推荐关系
|
||||
*/
|
||||
export async function removeBatchUserReferee(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/user-referee/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
24
app/api/user/referee/model/index.ts
Normal file
24
app/api/user/referee/model/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 推荐关系
|
||||
*/
|
||||
export interface UserReferee {
|
||||
id?: number;
|
||||
dealerId?: number;
|
||||
userId?: number;
|
||||
level?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserRefereeParam extends PageParam {
|
||||
id?: number;
|
||||
dealerId?: number;
|
||||
userId?: number;
|
||||
level?: number;
|
||||
}
|
||||
106
app/api/user/userCoupon/index.ts
Normal file
106
app/api/user/userCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCoupon, UserCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageUserCoupon(params: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listUserCoupon(params?: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<UserCoupon[]>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addUserCoupon(data: UserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateUserCoupon(data: UserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeUserCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchUserCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getUserCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<UserCoupon>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
app/api/user/userCoupon/model/index.ts
Normal file
59
app/api/user/userCoupon/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface UserCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠劵id
|
||||
couponId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: number;
|
||||
// 有效期结束时间
|
||||
endTime?: number;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 是否已使用(0未使用 1已使用)
|
||||
isUse?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface UserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user