Ver código fonte

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-service

lrf 4 meses atrás
pai
commit
3cb015ca2f

+ 1 - 1
src/controller/match/matchExt.controller.ts

@@ -63,7 +63,7 @@ export class MatchExtController implements BaseController {
   @Get('/detail/:id')
   @ApiResponse({ type: FVO_match })
   async detail(@Param('id') id: string) {
-    let data = await this.service.fetch({ id });
+    const data = await this.service.fetch({ id });
     return data;
   }
 }

+ 7 - 8
src/controller/match/matchRegistration.controller.ts

@@ -1,4 +1,3 @@
-import { MatchService } from '../../service/platform/match.service';
 import { CVO_match, FVO_match, QVO_match, UVAO_match } from '../../interface/platform/match.interface';
 import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
 import { Validate } from '@midwayjs/validate';
@@ -43,13 +42,13 @@ export class MatchRegistrationController implements BaseController {
   @Validate()
   @ApiResponse({ type: CVO_match })
   async create(@Body() data: object) {
-    const userColumns = ['user', 'user_id']
-    let regData = omit(data, userColumns)
+    const userColumns = ['user', 'user_id'];
+    let regData = omit(data, userColumns);
     if (get(data, 'user_id')) {
-      regData = { user_id: get(data, 'user_id'), ...regData }
+      regData = { user_id: get(data, 'user_id'), ...regData };
     } else {
-      const user = get(data, 'user')
-      if (!user) throw new ServiceError(ErrorCode.MATCH_NEED_USER_INFO)
+      const user = get(data, 'user');
+      if (!user) throw new ServiceError(ErrorCode.MATCH_NEED_USER_INFO);
       // 注册用户
       await this.userService.createExamine(user);
       await this.userService.checkPhone(user);
@@ -62,7 +61,7 @@ export class MatchRegistrationController implements BaseController {
         Object.assign(user, { password: hash });
       }
       const dbData = await this.userService.create(user);
-      regData = { user_id: dbData.id, ...regData }
+      regData = { user_id: dbData.id, ...regData };
     }
     // 检查是否报名
     const query = { match_id: get(data, 'match_id'), user_id: get(regData, 'user_id') }
@@ -98,7 +97,7 @@ export class MatchRegistrationController implements BaseController {
   @Get('/detail/:id')
   @ApiResponse({ type: FVO_match })
   async detail(@Param('id') id: string) {
-    let data = await this.service.fetch({ id });
+    const data = await this.service.fetch({ id });
     return data;
   }
 }