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;
|
||||
}
|
||||
Reference in New Issue
Block a user