export async function postTemplate(action_name: string): Promise { return `import type { Context } from "koa"; import { Mountable } from "@sealcode/sealgen"; import type Router from "@koa/router"; export const actionName = "${action_name}"; export default new (class ${action_name}Redirect extends Mountable { // eslint-disable-next-line @typescript-eslint/no-unused-vars async canAccess(_: Context) { return { canAccess: true, message: "" }; } mount(router: Router, path: string) { router.post(path, async (ctx) => { ctx.body = { message: "OK!" } }); } })(); `; }