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,12 +1,12 @@
const crud = require("../service/biz_admin_crud");
const { getRequestBody } = crud;
const baseModel = require("../../middleware/baseModel");
const logic = require("../service/biz_subscription_logic");
const audit = require("../service/biz_audit_service");
module.exports = {
"POST /biz_subscription/page": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const data = await crud.page("biz_subscription", body);
ctx.success({ rows: data.rows, count: data.count });
},
@@ -26,7 +26,7 @@ module.exports = {
ctx.success(rows);
},
"POST /biz_subscription/open": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const row = await logic.openSubscription(body);
await audit.logAudit({
admin_user_id: audit.pickAdminId(ctx),
@@ -39,7 +39,7 @@ module.exports = {
ctx.success(row);
},
"POST /biz_subscription/upgrade": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const row = await logic.upgradeSubscription(body);
await audit.logAudit({
admin_user_id: audit.pickAdminId(ctx),
@@ -51,7 +51,7 @@ module.exports = {
ctx.success(row);
},
"POST /biz_subscription/renew": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const row = await logic.renewSubscription(body);
await audit.logAudit({
admin_user_id: audit.pickAdminId(ctx),
@@ -62,7 +62,7 @@ module.exports = {
ctx.success(row);
},
"POST /biz_subscription/cancel": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const row = await logic.cancelSubscription(body);
await audit.logAudit({
admin_user_id: audit.pickAdminId(ctx),
@@ -73,7 +73,7 @@ module.exports = {
ctx.success(row);
},
"POST /biz_subscription/export": async (ctx) => {
const body = getRequestBody(ctx);
const body = ctx.getBody();
const res = await crud.exportCsv("biz_subscription", body);
ctx.success(res);
},