open-renamer/openRenamerBackend/api/GlobalConfigApi.ts

23 lines
475 B
TypeScript
Raw Normal View History

2022-11-29 23:02:06 +08:00
import { Context } from "koa";
import service from "../service/GlobalService";
const router = {};
/**
*
*/
router["GET /config/code"] = async function (ctx: Context) {
ctx.body = await service.getVal(ctx.request.query.code as string);
};
/**
*
*/
router["POST /config/update"] = async function (ctx: Context) {
ctx.body = await service.updateVal(ctx.request.body.code, ctx.request.body.val);
};
export default router;