wangzhibo
4 天以前 c19f1f7e21c93d1f13b4f44a8a615f65af577559
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { CoolController, BaseController } from '@cool-midway/core';
import { PushAuditlogEntity } from '../../entity/auditlog';
import { PushAuditlogService } from '../../service/auditlog';
 
/**
 * 接口审计日志管理
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: PushAuditlogEntity,
  service: PushAuditlogService,
  pageQueryOp: {
    select: ['a.*'],
    keyWordLikeFields: ['a.errorMessage'],
    fieldEq: ['a.deviceNo', 'a.pushType'],
    where: async ctx => {
      const { startTime, endTime } = ctx.request.body;
      const conditions = [];
      if (startTime && endTime) {
        conditions.push([
          'a.logTime BETWEEN :startTime AND :endTime',
          { startTime, endTime },
        ]);
      }
      return conditions;
    },
  },
})
export class AdminPushAuditlogController extends BaseController {}