tBoxAutoTestingStatsModel.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. module.exports = app => {
  3. const mongoose = app.mongoose;
  4. const Schema = mongoose.Schema;
  5. const conn = app.mongooseDB.get('etlAutoDB');
  6. // TBOX自动测试 数据结构
  7. const TBoxAutoTestingStatsSchema = new Schema({
  8. _id: { type: String }, // request_id
  9. vin: { type: String }, // VIN号
  10. serviceType: { type: String }, // applicationID
  11. messageType: { type: String }, // 消息类型
  12. reqTime: { type: Date }, // 请求时间
  13. resTime: { type: Date }, // 回复时间
  14. reqSource: { type: String }, // 请求服务名:fawiovvgdebug是运维平台的
  15. source: { type: Number }, // 协议命令源
  16. authToken: { type: Number }, // 协议 请求令牌
  17. items: { type: Array }, // 命令参数
  18. vgCode: { type: Object }, // vg 命令参数
  19. reqSourceType: { type: String }, // 协议 请求端类型 0:调试系统1:管理员 Portal2:用户 Portal3:手机 APP
  20. result: { type: String }, // 执行结果
  21. resultDesc: { type: String }, // 失败原因
  22. testFlag: { type: String }, // 测试标识
  23. isRecive: { type: String }, // 是否回复应用端 1:回复 0:不回复
  24. iccid: { type: String }, // iccid
  25. productId: { type: String }, // 产品id
  26. relevancyId: { type: String }, // 流程绑定id
  27. vehicleSeries: { type: String }, // 车系
  28. errorCode: { type: String }, // 异常编码
  29. repeatNum: { type: Number }, // 重试次数
  30. });
  31. TBoxAutoTestingStatsSchema.index({ reqTime: -1, reqSource: -1 });
  32. TBoxAutoTestingStatsSchema.index({ reqTime: -1, reqSource: -1, relevancyId: -1, serviceType: -1 });
  33. return conn.model('TBoxAutoTestingStats', TBoxAutoTestingStatsSchema, 'rcCommand');
  34. };