Browse Source

添加用户字段 修改报名

zs 8 months ago
parent
commit
0be26858cc

+ 1 - 0
src/controller/platform/sign.controller.ts

@@ -59,6 +59,7 @@ export class SignController implements BaseController {
   @ApiResponse({ type: UVAO_sign })
   @ApiResponse({ type: UVAO_sign })
   async update(@Param('id') id: number, @Body() data: object) {
   async update(@Param('id') id: number, @Body() data: object) {
     if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
     if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
+    await this.service.updateExamine(data);
     const result = await this.service.update({ id }, data);
     const result = await this.service.update({ id }, data);
     return result;
     return result;
   }
   }

+ 2 - 0
src/entity/platform/journal.entity.ts

@@ -3,6 +3,8 @@ import { BaseModel } from '../../frame/BaseModel';
 // 行研产研
 // 行研产研
 @Entity('journal')
 @Entity('journal')
 export class Journal extends BaseModel {
 export class Journal extends BaseModel {
+  @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
+  user: number;
   @Column({ type: 'character varying', nullable: true, comment: '名称' })
   @Column({ type: 'character varying', nullable: true, comment: '名称' })
   name: string;
   name: string;
   @Column({ type: 'jsonb', nullable: true, comment: '封面', default: [] })
   @Column({ type: 'jsonb', nullable: true, comment: '封面', default: [] })

+ 2 - 0
src/entity/platform/news.entity.ts

@@ -4,6 +4,8 @@ import * as dayjs from 'dayjs';
 // 新闻
 // 新闻
 @Entity('news')
 @Entity('news')
 export class News extends BaseModel {
 export class News extends BaseModel {
+  @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
+  user: number;
   @Column({ type: 'jsonb', nullable: true, comment: '标签', default: [] })
   @Column({ type: 'jsonb', nullable: true, comment: '标签', default: [] })
   tags: Array<any>;
   tags: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '标题' })
   @Column({ type: 'character varying', nullable: true, comment: '标题' })

+ 1 - 0
src/error/service.error.ts

@@ -12,6 +12,7 @@ export enum ErrorCode {
   USER_IS_DISABLED = 'USER_IS_DISABLED',
   USER_IS_DISABLED = 'USER_IS_DISABLED',
   ROLE_IS_DISABLED = 'ROLE_IS_DISABLED',
   ROLE_IS_DISABLED = 'ROLE_IS_DISABLED',
   SERVICE_REPEAT = 'SERVICE_REPEAT',
   SERVICE_REPEAT = 'SERVICE_REPEAT',
+  SERVICE_END = 'SERVICE_END',
   DUPLICATE_USERS_ACCOUNT = 'DUPLICATE_USERS_ACCOUNT',
   DUPLICATE_USERS_ACCOUNT = 'DUPLICATE_USERS_ACCOUNT',
   DUPLICATE_USERS_OPENID = 'DUPLICATE_USERS_OPENID',
   DUPLICATE_USERS_OPENID = 'DUPLICATE_USERS_OPENID',
 
 

+ 7 - 0
src/interface/platform/journal.interface.ts

@@ -8,6 +8,8 @@ export class FVO_journal {
   }
   }
   @ApiProperty({ description: '数据id' })
   @ApiProperty({ description: '数据id' })
   id: number = undefined;
   id: number = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': number = undefined;
   @ApiProperty({ description: '封面' })
   @ApiProperty({ description: '封面' })
   'file': Array<any> = undefined;
   'file': Array<any> = undefined;
   @ApiProperty({ description: '名称' })
   @ApiProperty({ description: '名称' })
@@ -21,6 +23,8 @@ export class FVO_journal {
 }
 }
 
 
 export class QDTO_journal extends SearchBase {
 export class QDTO_journal extends SearchBase {
+  @ApiProperty({ description: '用户id' })
+  'user': number = undefined;
   @ApiProperty({ description: '名称' })
   @ApiProperty({ description: '名称' })
   'name': string = undefined;
   'name': string = undefined;
   @ApiProperty({ description: '是否使用' })
   @ApiProperty({ description: '是否使用' })
@@ -37,6 +41,9 @@ export class QVO_journal extends FVO_journal {
 }
 }
 
 
 export class CDTO_journal {
 export class CDTO_journal {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['number']().empty(''))
+  'user': number = undefined;
   @ApiProperty({ description: '封面' })
   @ApiProperty({ description: '封面' })
   @Rule(RuleType['array']().empty(''))
   @Rule(RuleType['array']().empty(''))
   'file': Array<any> = undefined;
   'file': Array<any> = undefined;

+ 7 - 0
src/interface/platform/news.interface.ts

@@ -8,6 +8,8 @@ export class FVO_news {
   }
   }
   @ApiProperty({ description: '数据id' })
   @ApiProperty({ description: '数据id' })
   id: number = undefined;
   id: number = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': number = undefined;
   @ApiProperty({ description: '标签' })
   @ApiProperty({ description: '标签' })
   'tags': Array<any> = undefined;
   'tags': Array<any> = undefined;
   @ApiProperty({ description: '标题' })
   @ApiProperty({ description: '标题' })
@@ -31,6 +33,8 @@ export class FVO_news {
 }
 }
 
 
 export class QDTO_news extends SearchBase {
 export class QDTO_news extends SearchBase {
+  @ApiProperty({ description: '用户id' })
+  'user': number = undefined;
   @ApiProperty({ description: '标题' })
   @ApiProperty({ description: '标题' })
   'title': string = undefined;
   'title': string = undefined;
   @ApiProperty({ description: '标签' })
   @ApiProperty({ description: '标签' })
@@ -55,6 +59,9 @@ export class QVO_news extends FVO_news {
 }
 }
 
 
 export class CDTO_news {
 export class CDTO_news {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['number']().empty(''))
+  'user': number = undefined;
   @ApiProperty({ description: '标签' })
   @ApiProperty({ description: '标签' })
   @Rule(RuleType['array']().empty(''))
   @Rule(RuleType['array']().empty(''))
   'tags': Array<any> = undefined;
   'tags': Array<any> = undefined;

+ 9 - 0
src/service/platform/sign.service.ts

@@ -21,6 +21,15 @@ export class SignService extends BaseServiceV2 {
     if (result) throw new ServiceError(ErrorCode.SERVICE_REPEAT);
     if (result) throw new ServiceError(ErrorCode.SERVICE_REPEAT);
   }
   }
 
 
+  // 修改报名信息检查
+  async updateExamine(data) {
+    const { match } = data;
+    if (match) {
+      const result = await this.mModel.findOneBy({ id: Equal(match) });
+      if (result && get(result, 'match_status') === '2') throw new ServiceError(ErrorCode.SERVICE_END);
+    }
+  }
+
   // // 列表
   // // 列表
   // async sign(query) {
   // async sign(query) {
   //   const { skip = 0, limit = 0, ...condition } = query;
   //   const { skip = 0, limit = 0, ...condition } = query;