mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
🔱: [server] sync upgrade with 21 commits [trident-sync]
Update README.md
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user