mirror of
https://github.com/certd/certd.git
synced 2026-04-19 00:50:53 +08:00
63 lines
1.2 KiB
TypeScript
63 lines
1.2 KiB
TypeScript
import {
|
|
ALL,
|
|
Body,
|
|
Controller,
|
|
Inject,
|
|
Post,
|
|
Provide,
|
|
Query,
|
|
} from '@midwayjs/core';
|
|
import { CrudController } from '../../../basic/crud-controller.js';
|
|
import { PermissionService } from '../service/permission-service.js';
|
|
|
|
/**
|
|
* 权限资源
|
|
*/
|
|
@Provide()
|
|
@Controller('/api/sys/authority/permission')
|
|
export class PermissionController extends CrudController<PermissionService> {
|
|
@Inject()
|
|
service: PermissionService;
|
|
|
|
getService() {
|
|
return this.service;
|
|
}
|
|
|
|
@Post('/page', { summary: 'sys:auth:per:view' })
|
|
async page(
|
|
@Body(ALL)
|
|
body
|
|
) {
|
|
return await super.page(body);
|
|
}
|
|
|
|
@Post('/add', { summary: 'sys:auth:per:add' })
|
|
async add(
|
|
@Body(ALL)
|
|
bean
|
|
) {
|
|
return await super.add(bean);
|
|
}
|
|
|
|
@Post('/update', { summary: 'sys:auth:per:edit' })
|
|
async update(
|
|
@Body(ALL)
|
|
bean
|
|
) {
|
|
return await super.update(bean);
|
|
}
|
|
@Post('/delete', { summary: 'sys:auth:per:remove' })
|
|
async delete(
|
|
@Query('id')
|
|
id : number
|
|
) {
|
|
return await super.delete(id);
|
|
}
|
|
|
|
@Post('/tree', { summary: 'sys:auth:per:view' })
|
|
async tree() {
|
|
const tree = await this.service.tree({});
|
|
return this.ok(tree);
|
|
}
|
|
}
|