Procházet zdrojové kódy

Refactor code to change e2ee column from boolean to number in OperatorConfig and Task entities

x1ongzhu před 1 rokem
rodič
revize
2115bc515c

+ 2 - 2
src/operator_config/entities/operator-config.entiy.ts

@@ -47,6 +47,6 @@ export class OperatorConfig {
     @Column({ default: 0 })
     minTaskNum: number
 
-    @Column({ default: false })
-    e2ee: boolean
+    @Column({ default: 0 })
+    e2ee: number
 }

+ 3 - 3
src/task/entities/task.entity.ts

@@ -98,9 +98,9 @@ export class Task {
     @Column({ default: true })
     useBackup: boolean
 
-    @Column({ default: false })
-    e2ee: boolean
+    @Column({ default: 0 })
+    e2ee: number
 
     @Column({ default: 0 })
-    e2eeTimeout:number
+    e2eeTimeout: number
 }

+ 1 - 1
src/task/task.service.ts

@@ -130,7 +130,7 @@ export class TaskService implements OnModuleInit {
         task.total = phones.length
         task.country = phoneList.country
         if (task.country) {
-            task.e2ee = (await this.operatorConfigService.findByCountry(task.country))?.e2ee || false
+            task.e2ee = (await this.operatorConfigService.findByCountry(task.country))?.e2ee || 0
         }
         // 定时任务
         let cost = 0