feat: 新增书籍及书籍分类管理模块(entity/controller/service)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Body, Post, Provide } from '@midwayjs/core';
|
||||
import { CoolController, BaseController } from '@cool-midway/core';
|
||||
import { KnowledgeBookEntity } from '../../entity/book';
|
||||
import { KnowledgeBookService } from '../../service/book';
|
||||
|
||||
@CoolController({
|
||||
api: ['add', 'delete', 'update', 'info', 'list', 'page'],
|
||||
entity: KnowledgeBookEntity,
|
||||
service: KnowledgeBookService,
|
||||
pageQueryOp: {
|
||||
keyWordLikeFields: ['a.name', 'a.author'],
|
||||
fieldEq: ['a.quality', 'a.priority', 'a.categoryId'],
|
||||
},
|
||||
})
|
||||
export class AdminKnowledgeBookController extends BaseController {
|
||||
@Post('/import', { summary: '批量导入书籍' })
|
||||
async importBooks(@Body() books: any[]) {
|
||||
return this.ok(await this.service.importBooks(books));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user