1
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user