diff --git a/.drone.yml b/.drone.yml index 1415826..febe77a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -104,6 +104,28 @@ steps: event: [push, pull_request] branch: [development, main] +- name: notify + image: fifsky/drone-wechat-work + pull: if-not-exists + settings: + url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=95507e79-9ef7-4cd7-a20a-562f0d75c738 + msgtype: markdown + content: | + {{if eq .Status "success" }} + #### 🎉 ${DRONE_REPO} 构建成功 + > Commit: ${DRONE_COMMIT_MESSAGE} + > Author: ${DRONE_COMMIT_AUTHOR} + {{else}} + #### ❌ ${DRONE_REPO} 构建失败 + > Commit: ${DRONE_COMMIT_MESSAGE} + > Author: ${DRONE_COMMIT_AUTHOR} + > 请立即修复!!! + {{end}} + when: + status: + - failure + - success + # - name: notify # image: fifsky/drone-wechat-work # pull: if-not-exists diff --git a/src/app.controller.ts b/src/app.controller.ts index d30da7d..50c039a 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -879,17 +879,17 @@ export class AppController { throw new BadRequestException("无权限, 请联系管理员") } const where: any = {}; - const query = this.areaRepository.createQueryBuilder('area'); + const query = this.deviceRepository.createQueryBuilder('device'); query.where(where); if (query_data.search) { const string = `%${query_data.search}%`; const fields = ['name']; - const searchString = fields.join(' like :search OR area.'); - query.where(`area.${searchString} like :search`, { + const searchString = fields.join(' like :search OR device.'); + query.where(`device.${searchString} like :search`, { search: string, }); } - const order_key = 'area.created_date'; + const order_key = 'device.created_date'; let order_value: any = 'DESC'; const [list, count] = await query .skip(query_data.skip)