This commit is contained in:
张成
2026-04-01 10:13:22 +08:00
parent 14f5d75d9d
commit 494555a6e1
11 changed files with 52 additions and 90 deletions

View File

@@ -1,24 +1,24 @@
const crud = require("../service/biz_admin_crud");
const { getRequestBody } = crud;
module.exports = {
"POST /biz_usage/page": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const data = await crud.page("biz_usage_monthly", body);
ctx.success({ rows: data.rows, count: data.count });
},
"POST /biz_usage/add": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const row = await crud.add("biz_usage_monthly", body);
ctx.success(row);
},
"POST /biz_usage/edit": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
await crud.edit("biz_usage_monthly", body);
ctx.success({});
},
"POST /biz_usage/del": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
await crud.del("biz_usage_monthly", body);
ctx.success({});
},
@@ -28,7 +28,7 @@ module.exports = {
ctx.success(row);
},
"POST /biz_usage/export": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const res = await crud.exportCsv("biz_usage_monthly", body);
ctx.success(res);
},