mirror of
https://github.com/certd/certd.git
synced 2026-07-16 18:57:32 +08:00
6f6606d76d
BREAKING CHANGE: 接口配置变更
63 lines
1009 B
TypeScript
63 lines
1009 B
TypeScript
import {
|
|
ALL,
|
|
Body,
|
|
Controller,
|
|
Inject,
|
|
Post,
|
|
Provide,
|
|
Query,
|
|
} from '@midwayjs/decorator';
|
|
import { CrudController } from '../../../basic/crud-controller';
|
|
import { PermissionService } from '../service/permission-service';
|
|
|
|
/**
|
|
* 权限资源
|
|
*/
|
|
@Provide()
|
|
@Controller('/api/sys/authority/permission')
|
|
export class PermissionController extends CrudController<PermissionService> {
|
|
@Inject()
|
|
service: PermissionService;
|
|
|
|
getService() {
|
|
return this.service;
|
|
}
|
|
|
|
@Post('/page')
|
|
async page(
|
|
@Body(ALL)
|
|
body
|
|
) {
|
|
return await super.page(body);
|
|
}
|
|
|
|
@Post('/add')
|
|
async add(
|
|
@Body(ALL)
|
|
bean
|
|
) {
|
|
return await super.add(bean);
|
|
}
|
|
|
|
@Post('/update')
|
|
async update(
|
|
@Body(ALL)
|
|
bean
|
|
) {
|
|
return await super.update(bean);
|
|
}
|
|
@Post('/delete')
|
|
async delete(
|
|
@Query('id')
|
|
id
|
|
) {
|
|
return await super.delete(id);
|
|
}
|
|
|
|
@Post('/tree')
|
|
async tree() {
|
|
const tree = await this.service.tree({});
|
|
return this.ok(tree);
|
|
}
|
|
}
|