zs 1 anno fa
parent
commit
f5454e2e38
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      src/controller/User.controller.ts

+ 8 - 0
src/controller/User.controller.ts

@@ -35,6 +35,7 @@ import {
 } from '@midwayjs/swagger';
 import { Validate } from '@midwayjs/validate';
 import { JwtService } from '@midwayjs/jwt';
+import { UserUtilService } from '../../service/util/user.util';
 @ApiTags(['用户'])
 @Controller('/User')
 export class UserController extends BaseController {
@@ -50,6 +51,9 @@ export class UserController extends BaseController {
   @Config('jwt.expiresIn')
   jwtExpiresIn;
 
+   @Inject()
+  userUtil: UserUtilService;
+
   @Post('/login')
   @Validate()
   async login(@Body() body: LoginDTO) {
@@ -81,6 +85,8 @@ export class UserController extends BaseController {
   @Validate()
   @ApiResponse({ type: CVO_User })
   async create(@Body() data: CDTO_User) {
+     // 检查手机号和上级id
+    // await this.userUtil.checkPhoneAndPid(data);
     const dbData = await this.service.create(data);
     const result = new CVO_User(dbData);
     return result;
@@ -115,6 +121,8 @@ export class UserController extends BaseController {
   @Validate()
   @ApiResponse({ type: UVAO_User })
   async update(@Param('id') id: string, @Body() body: UDTO_User) {
+    // 检查手机号和上级id
+    // await this.userUtil.checkUpdateCardAndPid(id, body);
     const result = await this.service.updateOne(id, body);
     return result;
   }