去除数据库关键字

This commit is contained in:
ap 2022-02-24 15:51:29 +08:00
parent 1b4374c272
commit b89eb0685c
2 changed files with 16 additions and 0 deletions

View File

@ -19,6 +19,9 @@ import { TaskInfoService } from '../../service/info';
api: ['add', 'delete', 'update', 'info', 'page'],
entity: TaskInfoEntity,
service: TaskInfoService,
before: ctx => {
ctx.request.body.limit = ctx.request.body.repeatCount;
},
pageQueryOp: {
fieldEq: ['status', 'type'],
},

View File

@ -263,6 +263,19 @@ export class TaskInfoService extends BaseService {
);
}
/**
*
* @param id
* @returns
*/
async info(id: any): Promise<any> {
const info = await this.taskInfoEntity.findOne({ id });
return {
...info,
repeatCount: info.limit,
};
}
/**
*
*/