36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
const crud = require("../service/biz_admin_crud");
|
|
|
|
|
|
module.exports = {
|
|
"POST /biz_usage/page": async (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 = ctx.getBody();
|
|
const row = await crud.add("biz_usage_monthly", body);
|
|
ctx.success(row);
|
|
},
|
|
"POST /biz_usage/edit": async (ctx) => {
|
|
const body = ctx.getBody();
|
|
await crud.edit("biz_usage_monthly", body);
|
|
ctx.success({});
|
|
},
|
|
"POST /biz_usage/del": async (ctx) => {
|
|
const body = ctx.getBody();
|
|
await crud.del("biz_usage_monthly", body);
|
|
ctx.success({});
|
|
},
|
|
"GET /biz_usage/detail": async (ctx) => {
|
|
const q = ctx.query || {};
|
|
const row = await crud.detail("biz_usage_monthly", { id: q.id || q.ID });
|
|
ctx.success(row);
|
|
},
|
|
"POST /biz_usage/export": async (ctx) => {
|
|
const body = ctx.getBody();
|
|
const res = await crud.exportCsv("biz_usage_monthly", body);
|
|
ctx.success(res);
|
|
},
|
|
};
|