lrf 5 mesi fa
parent
commit
407b90847e

+ 7 - 7
src/controller/system/admin.controller.ts

@@ -30,22 +30,22 @@ export class AdminController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
+  async update(@Param('id') _id: string, @Body() body) {
     // 删除account字段,不允许更改
     delete body.account;
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
     return RF.success();
   }
 }

+ 2 - 2
src/controller/system/config.controller.ts

@@ -34,8 +34,8 @@ export class ConfigController {
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
-    const result = await this.service.update({ id }, body);
+  async update(@Param('id') _id: string, @Body() body) {
+    const result = await this.service.update({ _id }, body);
     return RF.success(result)
   }
 

+ 8 - 8
src/controller/system/dictData.controller.ts

@@ -29,20 +29,20 @@ export class DictDataController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+  async update(@Param('id') _id: string, @Body() body) {
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
-    return RF.success()
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
+    return RF.success();
   }
 }

+ 8 - 8
src/controller/system/dictType.controller.ts

@@ -29,20 +29,20 @@ export class DictTypeController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+  async update(@Param('id') _id: string, @Body() body) {
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
-    return RF.success()
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
+    return RF.success();
   }
 }

+ 8 - 8
src/controller/system/menus.controller.ts

@@ -28,20 +28,20 @@ export class MenusController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+  async update(@Param('id') _id: string, @Body() body) {
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
-    return RF.success()
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
+    return RF.success();
   }
 }

+ 8 - 8
src/controller/system/role.controller.ts

@@ -29,20 +29,20 @@ export class RoleController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+  async update(@Param('id') _id: string, @Body() body) {
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
-    return RF.success()
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
+    return RF.success();
   }
 }

+ 8 - 8
src/controller/system/user.controller.ts

@@ -30,22 +30,22 @@ export class UserController {
   }
 
   @Get('/:id')
-  async fetch(@Param('id') id: string) {
-    const result = await this.service.findOne({ id });
+  async fetch(@Param('id') _id: string) {
+    const result = await this.service.findOne({ _id });
     return RF.success(result);
   }
 
   @Post('/:id')
-  async update(@Param('id') id: string, @Body() body) {
+  async update(@Param('id') _id: string, @Body() body) {
     // 删除account字段,不允许更改
     delete body.account;
-    const result = await this.service.update({ id }, body);
-    return RF.success(result)
+    const result = await this.service.update({ _id }, body);
+    return RF.success(result);
   }
 
   @Del('/:id')
-  async delete(@Param('id') id: string) {
-    await this.service.delete({ id });
-    return RF.success()
+  async delete(@Param('id') _id: string) {
+    await this.service.delete({ _id });
+    return RF.success();
   }
 }