移除无用代码

This commit is contained in:
ap 2022-02-18 18:37:31 +08:00
parent d0d47cd5f4
commit 1b4374c272
2 changed files with 5 additions and 7 deletions

View File

@ -47,7 +47,7 @@ export class BaseSysLogController extends BaseController {
/**
*
*/
@Post('/setKeep', { summary: '设置保存时间' })
@Post('/setKeep', { summary: '日志保存时间' })
public async setKeep(@Body() value: number) {
await this.baseSysConfService.updateVaule('logKeep', value);
return this.ok();
@ -56,7 +56,7 @@ export class BaseSysLogController extends BaseController {
/**
*
*/
@Get('/getKeep', { summary: '获得设置保存时间' })
@Get('/getKeep', { summary: '获得日志保存时间' })
public async getKeep() {
return this.ok(await this.baseSysConfService.getValue('logKeep'));
}

View File

@ -64,11 +64,9 @@ export class BaseSysLogService extends BaseService {
.format('YYYY-MM-DD')} 00:00:00`;
await this.baseSysLogEntity
.createQueryBuilder()
.where('createTime < :createTime', { createTime: beforeDate });
await this.nativeQuery(
' delete from base_sys_log where createTime < ? ',
[beforeDate]
);
.delete()
.where('createTime < :createTime', { createTime: beforeDate })
.execute();
} else {
await this.baseSysLogEntity.clear();
}