Преглед на файлове

修改孵化基地显示 首页

zs преди 8 месеца
родител
ревизия
0f21c240b3

+ 1 - 1
src/config/config.self.ts

@@ -12,7 +12,7 @@ const dbPwd = '1234qwer!@#$';
 /**redis ip */
 const redisHost = 'localhost';
 /**redis 密码 */
-const redisPwd = '1234qwer!@#$';
+const redisPwd = '123456';
 /**redis 使用第几个数据库 */
 const redisDB = 0;
 /**redis 记录登录的key */

+ 9 - 0
src/controller/users/incubator.controller.ts

@@ -70,4 +70,13 @@ export class IncubatorController implements BaseController {
     const result = await this.service.delete({ id });
     return result;
   }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_incubator })
+  async detail(@Param('id') id: string) {
+    let data = await this.service.fetch({ id });
+    data = await this.serviceUtil.fillOnwer(data);
+    data = await this.serviceUtil.fillCollection(data, 'incubator');
+    return data;
+  }
 }

+ 1 - 1
src/entity/users/company.entity.ts

@@ -12,7 +12,7 @@ export class Company extends BaseModel {
   tags: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '企业名称' })
   name: string;
-  @Column({ type: 'jsonb', nullable: true, comment: 'logo' })
+  @Column({ type: 'jsonb', nullable: true, comment: 'logo', default: [] })
   logo: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '企业统一信用代码名称' })
   code: string;

+ 1 - 1
src/entity/users/expert.entity.ts

@@ -11,7 +11,7 @@ export class Expert extends BaseModel {
   tags: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '专家姓名' })
   name: string;
-  @Column({ type: 'jsonb', nullable: true, comment: '头像' })
+  @Column({ type: 'jsonb', nullable: true, comment: '头像', default: [] })
   icon: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '性别' })
   gender: string;

+ 8 - 0
src/entity/users/incubator.entity.ts

@@ -5,12 +5,20 @@ import { BaseModel } from '../../frame/BaseModel';
 export class Incubator extends BaseModel {
   @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
   user: number;
+  @Column({ type: 'character varying', nullable: true, comment: '所属产业' })
+  industry: string;
+  @Column({ type: 'jsonb', nullable: true, comment: '标签', default: [] })
+  tags: Array<any>;
+  @Column({ type: 'jsonb', nullable: true, comment: 'logo', default: [] })
+  logo: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '名称' })
   name: string;
   @Column({ type: 'character varying', nullable: true, comment: '负责人姓名' })
   person: string;
   @Column({ type: 'character varying', nullable: true, comment: '负责人电话' })
   person_phone: string;
+  @Column({ type: 'jsonb', nullable: true, comment: '所在地区' })
+  area: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '地址' })
   address: string;
   @Column({ type: 'text', nullable: true, comment: '简介' })

+ 26 - 0
src/interface/users/incubator.interface.ts

@@ -9,12 +9,20 @@ export class FVO_incubator {
   id: number = undefined;
   @ApiProperty({ description: '平台用户id' })
   'user': number = undefined;
+  @ApiProperty({ description: '所属产业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '标签' })
+  'tags': Array<any> = undefined;
   @ApiProperty({ description: '名称' })
   'name': string = undefined;
+  @ApiProperty({ description: 'logo' })
+  'logo': Array<any> = undefined;
   @ApiProperty({ description: '负责人姓名' })
   'person': string = undefined;
   @ApiProperty({ description: '负责人电话' })
   'person_phone': string = undefined;
+  @ApiProperty({ description: '所在地区' })
+  'area': Array<any> = undefined;
   @ApiProperty({ description: '地址' })
   'address': string = undefined;
   @ApiProperty({ description: '简介' })
@@ -30,8 +38,14 @@ export class FVO_incubator {
 export class QDTO_incubator {
   @ApiProperty({ description: '平台用户id' })
   'user': number = undefined;
+  @ApiProperty({ description: '所属产业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '标签' })
+  'tags': Array<any> = undefined;
   @ApiProperty({ description: '名称' })
   'name': string = undefined;
+  @ApiProperty({ description: 'logo' })
+  'logo': Array<any> = undefined;
   @ApiProperty({ description: '负责人电话' })
   'person_phone': string = undefined;
   @ApiProperty({ description: '是否公开' })
@@ -53,15 +67,27 @@ export class CDTO_incubator {
   @ApiProperty({ description: '平台用户id' })
   @Rule(RuleType['number']().empty(''))
   'user': number = undefined;
+  @ApiProperty({ description: '所属产业' })
+  @Rule(RuleType['string']().empty(''))
+  'industry': string = undefined;
+  @ApiProperty({ description: '标签' })
+  @Rule(RuleType['array']().empty(''))
+  'tags': Array<any> = undefined;
   @ApiProperty({ description: '名称' })
   @Rule(RuleType['string']().empty(''))
   'name': string = undefined;
+  @ApiProperty({ description: 'logo' })
+  @Rule(RuleType['array']().empty(''))
+  'logo': Array<any> = undefined;
   @ApiProperty({ description: '负责人姓名' })
   @Rule(RuleType['string']().empty(''))
   'person': string = undefined;
   @ApiProperty({ description: '负责人电话' })
   @Rule(RuleType['string']().empty(''))
   'person_phone': string = undefined;
+  @ApiProperty({ description: '所在地区' })
+  @Rule(RuleType['array']().empty(''))
+  'area': Array<any> = undefined;
   @ApiProperty({ description: '地址' })
   @Rule(RuleType['string']().empty(''))
   'address': string = undefined;

+ 3 - 0
src/service/platform/collection.service.ts

@@ -13,6 +13,7 @@ import { NewsService } from '../platform/news.service';
 import { ExpertService } from '../../service/users/expert.service';
 import { DemandService } from '../platform/demand.service';
 import { CompanyService } from '../../service/users/company.service';
+import { IncubatorService } from '../users/incubator.service';
 @Provide()
 export class CollectionService extends BaseServiceV2 {
   getQueryColumnsOpera(): object {
@@ -41,6 +42,8 @@ export class CollectionService extends BaseServiceV2 {
   demand: DemandService;
   @Inject()
   company: CompanyService;
+  @Inject()
+  incubator: IncubatorService;
 
   // 转化来源数据名称
   async fillScource(data) {

+ 9 - 0
src/service/users/incubator.service.ts

@@ -7,4 +7,13 @@ import { BaseServiceV2 } from '../../frame/BaseServiceV2';
 export class IncubatorService extends BaseServiceV2 {
   @InjectEntityModel(Incubator)
   model: Repository<Incubator>;
+  getQueryColumnsOpera() {
+    const obj = {
+      name: this.Opera.Like,
+      industry: this.Opera.In,
+      tags: this.Opera.Json,
+      area: this.Opera.Json,
+    };
+    return obj;
+  }
 }