Files
certd/packages/ui/certd-server/src/controller/sys/authority/permission-controller.ts
T

55 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-05-31 01:41:33 +08:00
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
import { CrudController } from "@certd/lib-server";
import { PermissionService } from "../../../modules/sys/authority/service/permission-service.js";
/**
* 权限资源
*/
@Provide()
2026-05-31 01:41:33 +08:00
@Controller("/api/sys/authority/permission")
export class PermissionController extends CrudController<PermissionService> {
@Inject()
service: PermissionService;
getService() {
return this.service;
}
2026-05-31 01:41:33 +08:00
@Post("/page", { description: "sys:auth:per:view" })
async page(
@Body(ALL)
body
) {
return await super.page(body);
}
2026-05-31 01:41:33 +08:00
@Post("/add", { description: "sys:auth:per:add" })
async add(
@Body(ALL)
bean
) {
return await super.add(bean);
}
2026-05-31 01:41:33 +08:00
@Post("/update", { description: "sys:auth:per:edit" })
async update(
@Body(ALL)
bean
) {
return await super.update(bean);
}
2026-05-31 01:41:33 +08:00
@Post("/delete", { description: "sys:auth:per:remove" })
async delete(
2026-05-31 01:41:33 +08:00
@Query("id")
id: number
) {
return await super.delete(id);
}
2026-05-31 01:41:33 +08:00
@Post("/tree", { description: "sys:auth:per:view" })
async tree() {
const tree = await this.service.tree({});
return this.ok(tree);
}
}