rez_core 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/auth/strategies/google.strategy.d.ts +0 -1
- package/dist/module/auth/strategies/google.strategy.js +11 -4
- package/dist/module/auth/strategies/google.strategy.js.map +1 -1
- package/dist/module/enterprise/controller/organization.controller.d.ts +7 -0
- package/dist/module/enterprise/controller/organization.controller.js +40 -0
- package/dist/module/enterprise/controller/organization.controller.js.map +1 -0
- package/dist/module/enterprise/enterprise.module.js +2 -0
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.js +3 -3
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.d.ts +3 -3
- package/dist/module/meta/entity/entity-master.entity.js +3 -4
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/service/entity-master.service.js +1 -1
- package/dist/module/meta/service/entity-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +6 -6
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/nest-cli.json +1 -1
- package/package.json +1 -1
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/auth.service.ts +29 -29
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/google.strategy.ts +14 -9
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/controller/organization.controller.ts +16 -0
- package/src/module/enterprise/enterprise.module.ts +2 -0
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/master/controller/master.controller.ts +22 -22
- package/src/module/meta/controller/entity.controller.ts +3 -3
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/entity/attribute-master.entity.ts +67 -67
- package/src/module/meta/entity/entity-master.entity.ts +3 -4
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/repository/attribute-master.repository.ts +28 -28
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-master.service.ts +1 -1
- package/src/module/meta/service/entity-service-impl.service.ts +6 -6
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/entity/module-access.entity.ts +22 -22
- package/src/module/module/entity/module-action.entity.ts +19 -19
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
- package/src/module/user/entity/user-session.entity.ts +61 -61
- package/src/module/user/entity/user.entity.ts +35 -35
- package/src/module/user/repository/role.repository.ts +16 -16
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/resources/dev.properties.yaml +2 -2
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/reflection-helper.service.ts +53 -53
- package/.idea/250218_nodejs_core.iml +0 -12
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/dataSources.xml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/dist/resources/dev.properties.yaml +0 -15
- package/dist/resources/uat.properties.yaml +0 -15
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Controller,
|
|
3
|
-
Post,
|
|
4
|
-
UploadedFile,
|
|
5
|
-
UseInterceptors,
|
|
6
|
-
} from '@nestjs/common';
|
|
7
|
-
import { FileInterceptor } from '@nestjs/platform-express';
|
|
8
|
-
import { MasterService } from '../service/master.service';
|
|
9
|
-
|
|
10
|
-
@Controller('master')
|
|
11
|
-
export class MasterController {
|
|
12
|
-
constructor(private readonly masterService: MasterService) {}
|
|
13
|
-
|
|
14
|
-
@Post('upload')
|
|
15
|
-
@UseInterceptors(FileInterceptor('file'))
|
|
16
|
-
async uploadFile(@UploadedFile() file) {
|
|
17
|
-
if (!file) {
|
|
18
|
-
throw new Error('File is required');
|
|
19
|
-
}
|
|
20
|
-
return this.masterService.processExcel(file);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Controller,
|
|
3
|
+
Post,
|
|
4
|
+
UploadedFile,
|
|
5
|
+
UseInterceptors,
|
|
6
|
+
} from '@nestjs/common';
|
|
7
|
+
import { FileInterceptor } from '@nestjs/platform-express';
|
|
8
|
+
import { MasterService } from '../service/master.service';
|
|
9
|
+
|
|
10
|
+
@Controller('master')
|
|
11
|
+
export class MasterController {
|
|
12
|
+
constructor(private readonly masterService: MasterService) {}
|
|
13
|
+
|
|
14
|
+
@Post('upload')
|
|
15
|
+
@UseInterceptors(FileInterceptor('file'))
|
|
16
|
+
async uploadFile(@UploadedFile() file) {
|
|
17
|
+
if (!file) {
|
|
18
|
+
throw new Error('File is required');
|
|
19
|
+
}
|
|
20
|
+
return this.masterService.processExcel(file);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -44,7 +44,7 @@ export class EntityController {
|
|
|
44
44
|
|
|
45
45
|
const entityService =
|
|
46
46
|
await this.reflectionHelper.getBean<EntityServiceImpl>(
|
|
47
|
-
entityMaster.
|
|
47
|
+
entityMaster.entity_service,
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
if (entityService) {
|
|
@@ -69,7 +69,7 @@ export class EntityController {
|
|
|
69
69
|
|
|
70
70
|
const entityService =
|
|
71
71
|
await this.reflectionHelper.getBean<EntityServiceImpl>(
|
|
72
|
-
entityMaster.
|
|
72
|
+
entityMaster.entity_service,
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
if (entityService) {
|
|
@@ -97,7 +97,7 @@ export class EntityController {
|
|
|
97
97
|
|
|
98
98
|
const entityService =
|
|
99
99
|
await this.reflectionHelper.getBean<EntityServiceImpl>(
|
|
100
|
-
entityMaster.
|
|
100
|
+
entityMaster.entity_service,
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
if (entityService) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityTab } from './entity-tab.dto';
|
|
2
|
-
|
|
3
|
-
export class EntityListData {
|
|
4
|
-
entity_list: any;
|
|
5
|
-
entity_tabs: EntityTab[];
|
|
6
|
-
}
|
|
1
|
+
import { EntityTab } from './entity-tab.dto';
|
|
2
|
+
|
|
3
|
+
export class EntityListData {
|
|
4
|
+
entity_list: any;
|
|
5
|
+
entity_tabs: EntityTab[];
|
|
6
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'cr_attribute_master' })
|
|
5
|
-
export class AttributeMaster extends BaseEntity {
|
|
6
|
-
@Column({ name: 'mapped_entity_type', type: 'varchar', nullable: true })
|
|
7
|
-
mapped_entity_type: string;
|
|
8
|
-
|
|
9
|
-
@Column({ name: 'mapped_entity_id' })
|
|
10
|
-
mapped_entity_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ name: 'element_type', type: 'varchar', nullable: true, length: 50 })
|
|
13
|
-
element_type: string;
|
|
14
|
-
|
|
15
|
-
@Column({
|
|
16
|
-
name: 'data_source_type',
|
|
17
|
-
type: 'varchar',
|
|
18
|
-
nullable: true,
|
|
19
|
-
length: 50,
|
|
20
|
-
})
|
|
21
|
-
data_source_type: string;
|
|
22
|
-
|
|
23
|
-
@Column({ name: 'datasource_list', type: 'varchar', nullable: true })
|
|
24
|
-
datasource_list: string;
|
|
25
|
-
|
|
26
|
-
@Column({
|
|
27
|
-
name: 'custom_values',
|
|
28
|
-
type: 'varchar',
|
|
29
|
-
length: 2000,
|
|
30
|
-
nullable: true,
|
|
31
|
-
})
|
|
32
|
-
custom_values: string;
|
|
33
|
-
|
|
34
|
-
@Column({ name: 'max_length', nullable: true })
|
|
35
|
-
max_length: number;
|
|
36
|
-
|
|
37
|
-
@Column({ name: 'required', nullable: true })
|
|
38
|
-
required: number;
|
|
39
|
-
|
|
40
|
-
@Column({
|
|
41
|
-
name: 'description',
|
|
42
|
-
type: 'varchar',
|
|
43
|
-
length: 2000,
|
|
44
|
-
nullable: true,
|
|
45
|
-
})
|
|
46
|
-
description: string;
|
|
47
|
-
|
|
48
|
-
@Column({
|
|
49
|
-
name: 'attribute_key',
|
|
50
|
-
type: 'varchar',
|
|
51
|
-
nullable: true,
|
|
52
|
-
length: 50,
|
|
53
|
-
})
|
|
54
|
-
attribute_key: string;
|
|
55
|
-
|
|
56
|
-
@Column({ name: 'db_datatype', type: 'varchar', nullable: true, length: 50 })
|
|
57
|
-
db_datatype: string;
|
|
58
|
-
|
|
59
|
-
@Column({ name: 'category', type: 'varchar', nullable: true, length: 50 })
|
|
60
|
-
category: string;
|
|
61
|
-
|
|
62
|
-
@Column({ name: 'is_unique', nullable: true })
|
|
63
|
-
is_unique: number;
|
|
64
|
-
|
|
65
|
-
@Column({ name: 'can_export', nullable: true })
|
|
66
|
-
can_export: number;
|
|
67
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'cr_attribute_master' })
|
|
5
|
+
export class AttributeMaster extends BaseEntity {
|
|
6
|
+
@Column({ name: 'mapped_entity_type', type: 'varchar', nullable: true })
|
|
7
|
+
mapped_entity_type: string;
|
|
8
|
+
|
|
9
|
+
@Column({ name: 'mapped_entity_id' })
|
|
10
|
+
mapped_entity_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ name: 'element_type', type: 'varchar', nullable: true, length: 50 })
|
|
13
|
+
element_type: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
name: 'data_source_type',
|
|
17
|
+
type: 'varchar',
|
|
18
|
+
nullable: true,
|
|
19
|
+
length: 50,
|
|
20
|
+
})
|
|
21
|
+
data_source_type: string;
|
|
22
|
+
|
|
23
|
+
@Column({ name: 'datasource_list', type: 'varchar', nullable: true })
|
|
24
|
+
datasource_list: string;
|
|
25
|
+
|
|
26
|
+
@Column({
|
|
27
|
+
name: 'custom_values',
|
|
28
|
+
type: 'varchar',
|
|
29
|
+
length: 2000,
|
|
30
|
+
nullable: true,
|
|
31
|
+
})
|
|
32
|
+
custom_values: string;
|
|
33
|
+
|
|
34
|
+
@Column({ name: 'max_length', nullable: true })
|
|
35
|
+
max_length: number;
|
|
36
|
+
|
|
37
|
+
@Column({ name: 'required', nullable: true })
|
|
38
|
+
required: number;
|
|
39
|
+
|
|
40
|
+
@Column({
|
|
41
|
+
name: 'description',
|
|
42
|
+
type: 'varchar',
|
|
43
|
+
length: 2000,
|
|
44
|
+
nullable: true,
|
|
45
|
+
})
|
|
46
|
+
description: string;
|
|
47
|
+
|
|
48
|
+
@Column({
|
|
49
|
+
name: 'attribute_key',
|
|
50
|
+
type: 'varchar',
|
|
51
|
+
nullable: true,
|
|
52
|
+
length: 50,
|
|
53
|
+
})
|
|
54
|
+
attribute_key: string;
|
|
55
|
+
|
|
56
|
+
@Column({ name: 'db_datatype', type: 'varchar', nullable: true, length: 50 })
|
|
57
|
+
db_datatype: string;
|
|
58
|
+
|
|
59
|
+
@Column({ name: 'category', type: 'varchar', nullable: true, length: 50 })
|
|
60
|
+
category: string;
|
|
61
|
+
|
|
62
|
+
@Column({ name: 'is_unique', nullable: true })
|
|
63
|
+
is_unique: number;
|
|
64
|
+
|
|
65
|
+
@Column({ name: 'can_export', nullable: true })
|
|
66
|
+
can_export: number;
|
|
67
|
+
}
|
|
@@ -15,8 +15,7 @@ export class EntityMaster extends BaseEntity {
|
|
|
15
15
|
length: 50,
|
|
16
16
|
nullable: false,
|
|
17
17
|
})
|
|
18
|
-
|
|
19
|
-
mappedEntityType: string;
|
|
18
|
+
mapped_entity_type: string;
|
|
20
19
|
|
|
21
20
|
@Column({ name: 'appcode', type: 'varchar', length: 50, nullable: true })
|
|
22
21
|
appCode: string;
|
|
@@ -33,7 +32,7 @@ export class EntityMaster extends BaseEntity {
|
|
|
33
32
|
length: 200,
|
|
34
33
|
nullable: true,
|
|
35
34
|
})
|
|
36
|
-
|
|
35
|
+
entity_data_class: string;
|
|
37
36
|
|
|
38
37
|
@Column({
|
|
39
38
|
name: 'entity_service',
|
|
@@ -41,7 +40,7 @@ export class EntityMaster extends BaseEntity {
|
|
|
41
40
|
length: 200,
|
|
42
41
|
nullable: true,
|
|
43
42
|
})
|
|
44
|
-
|
|
43
|
+
entity_service: string;
|
|
45
44
|
|
|
46
45
|
@Column({
|
|
47
46
|
name: 'db_table_name',
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
-
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
-
|
|
5
|
-
@Entity({ name: 'cr_preference_master' })
|
|
6
|
-
export class PreferenceMaster extends BaseEntity {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
-
appCode: string;
|
|
14
|
-
|
|
15
|
-
@Column({
|
|
16
|
-
name: 'display_name',
|
|
17
|
-
type: 'varchar',
|
|
18
|
-
length: 200,
|
|
19
|
-
nullable: true,
|
|
20
|
-
})
|
|
21
|
-
display_name: string;
|
|
22
|
-
|
|
23
|
-
@Column({
|
|
24
|
-
name: 'preference_key',
|
|
25
|
-
type: 'varchar',
|
|
26
|
-
length: 200,
|
|
27
|
-
nullable: true,
|
|
28
|
-
})
|
|
29
|
-
preference_key: string;
|
|
30
|
-
|
|
31
|
-
@Column({
|
|
32
|
-
name: 'preference_value',
|
|
33
|
-
type: 'varchar',
|
|
34
|
-
length: 200,
|
|
35
|
-
nullable: true,
|
|
36
|
-
})
|
|
37
|
-
preference_value: string;
|
|
38
|
-
|
|
39
|
-
@Column({
|
|
40
|
-
name: 'description',
|
|
41
|
-
type: 'varchar',
|
|
42
|
-
length: 2000,
|
|
43
|
-
nullable: true,
|
|
44
|
-
})
|
|
45
|
-
description: string;
|
|
46
|
-
|
|
47
|
-
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
-
reflect_on: string;
|
|
49
|
-
|
|
50
|
-
@Column({
|
|
51
|
-
name: 'default_value',
|
|
52
|
-
type: 'varchar',
|
|
53
|
-
length: 200,
|
|
54
|
-
nullable: true,
|
|
55
|
-
})
|
|
56
|
-
default_value: string;
|
|
57
|
-
|
|
58
|
-
@Column({
|
|
59
|
-
name: 'possible_values',
|
|
60
|
-
type: 'varchar',
|
|
61
|
-
length: 200,
|
|
62
|
-
nullable: true,
|
|
63
|
-
})
|
|
64
|
-
possible_values: string;
|
|
65
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'cr_preference_master' })
|
|
6
|
+
export class PreferenceMaster extends BaseEntity {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
+
appCode: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
name: 'display_name',
|
|
17
|
+
type: 'varchar',
|
|
18
|
+
length: 200,
|
|
19
|
+
nullable: true,
|
|
20
|
+
})
|
|
21
|
+
display_name: string;
|
|
22
|
+
|
|
23
|
+
@Column({
|
|
24
|
+
name: 'preference_key',
|
|
25
|
+
type: 'varchar',
|
|
26
|
+
length: 200,
|
|
27
|
+
nullable: true,
|
|
28
|
+
})
|
|
29
|
+
preference_key: string;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
name: 'preference_value',
|
|
33
|
+
type: 'varchar',
|
|
34
|
+
length: 200,
|
|
35
|
+
nullable: true,
|
|
36
|
+
})
|
|
37
|
+
preference_value: string;
|
|
38
|
+
|
|
39
|
+
@Column({
|
|
40
|
+
name: 'description',
|
|
41
|
+
type: 'varchar',
|
|
42
|
+
length: 2000,
|
|
43
|
+
nullable: true,
|
|
44
|
+
})
|
|
45
|
+
description: string;
|
|
46
|
+
|
|
47
|
+
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
+
reflect_on: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
name: 'default_value',
|
|
52
|
+
type: 'varchar',
|
|
53
|
+
length: 200,
|
|
54
|
+
nullable: true,
|
|
55
|
+
})
|
|
56
|
+
default_value: string;
|
|
57
|
+
|
|
58
|
+
@Column({
|
|
59
|
+
name: 'possible_values',
|
|
60
|
+
type: 'varchar',
|
|
61
|
+
length: 200,
|
|
62
|
+
nullable: true,
|
|
63
|
+
})
|
|
64
|
+
possible_values: string;
|
|
65
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { AttributeMaster } from '../entity/attribute-master.entity';
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class AttributeMasterRepository {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(AttributeMaster)
|
|
10
|
-
private readonly attributeMasterRepository: Repository<AttributeMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async findByMappedEntityIdAndMappedEntityTypeAndAttributeKeyAndOrganizationId(
|
|
14
|
-
mappedEntityId: number,
|
|
15
|
-
mappedEntityType: string,
|
|
16
|
-
attributeKey: string,
|
|
17
|
-
organizationId: number,
|
|
18
|
-
): Promise<AttributeMaster | null> {
|
|
19
|
-
return await this.attributeMasterRepository.findOne({
|
|
20
|
-
where: {
|
|
21
|
-
mapped_entity_id: mappedEntityId,
|
|
22
|
-
mapped_entity_type: mappedEntityType,
|
|
23
|
-
attribute_key: attributeKey,
|
|
24
|
-
organization_id: organizationId,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { AttributeMaster } from '../entity/attribute-master.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class AttributeMasterRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(AttributeMaster)
|
|
10
|
+
private readonly attributeMasterRepository: Repository<AttributeMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async findByMappedEntityIdAndMappedEntityTypeAndAttributeKeyAndOrganizationId(
|
|
14
|
+
mappedEntityId: number,
|
|
15
|
+
mappedEntityType: string,
|
|
16
|
+
attributeKey: string,
|
|
17
|
+
organizationId: number,
|
|
18
|
+
): Promise<AttributeMaster | null> {
|
|
19
|
+
return await this.attributeMasterRepository.findOne({
|
|
20
|
+
where: {
|
|
21
|
+
mapped_entity_id: mappedEntityId,
|
|
22
|
+
mapped_entity_type: mappedEntityType,
|
|
23
|
+
attribute_key: attributeKey,
|
|
24
|
+
organization_id: organizationId,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class PreferenceRepository {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(PreferenceMaster)
|
|
10
|
-
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async findByPreferenceKey(
|
|
14
|
-
preferenceKey: string,
|
|
15
|
-
): Promise<PreferenceMaster | null> {
|
|
16
|
-
return await this.preferenceRepository.findOne({
|
|
17
|
-
where: { preference_key: preferenceKey },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class PreferenceRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(PreferenceMaster)
|
|
10
|
+
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async findByPreferenceKey(
|
|
14
|
+
preferenceKey: string,
|
|
15
|
+
): Promise<PreferenceMaster | null> {
|
|
16
|
+
return await this.preferenceRepository.findOne({
|
|
17
|
+
where: { preference_key: preferenceKey },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -12,7 +12,7 @@ export class EntityMasterService {
|
|
|
12
12
|
|
|
13
13
|
async getEntityData(mappedEntityType: string): Promise<EntityMaster> {
|
|
14
14
|
const entityMaster = await this.entityMasterRepository.findOne({
|
|
15
|
-
where: { mappedEntityType },
|
|
15
|
+
where: { mapped_entity_type: mappedEntityType },
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
if (!entityMaster) {
|
|
@@ -40,8 +40,8 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
const repo = manager
|
|
43
|
-
? manager.getRepository(entityMaster.
|
|
44
|
-
: this.reflectionHelper.getRepoService(entityMaster.
|
|
43
|
+
? manager.getRepository(entityMaster.entity_data_class) // <-- Use transaction-safe repo
|
|
44
|
+
: this.reflectionHelper.getRepoService(entityMaster.entity_data_class);
|
|
45
45
|
|
|
46
46
|
if (!repo) {
|
|
47
47
|
throw new Error(
|
|
@@ -78,7 +78,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
78
78
|
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
79
79
|
|
|
80
80
|
const repoService = this.reflectionHelper.getRepoService(
|
|
81
|
-
entityData.
|
|
81
|
+
entityData.entity_data_class,
|
|
82
82
|
);
|
|
83
83
|
if (!repoService) {
|
|
84
84
|
throw new Error(
|
|
@@ -100,7 +100,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
100
100
|
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
101
101
|
|
|
102
102
|
const repoService = this.reflectionHelper.getRepoService(
|
|
103
|
-
entityData.
|
|
103
|
+
entityData.entity_data_class,
|
|
104
104
|
);
|
|
105
105
|
if (!repoService) {
|
|
106
106
|
throw new Error(
|
|
@@ -113,7 +113,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
113
113
|
async getEntityList(entityType: string): Promise<BaseEntity[]> {
|
|
114
114
|
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
115
115
|
const repoService = this.reflectionHelper.getRepoService(
|
|
116
|
-
entityData.
|
|
116
|
+
entityData.entity_data_class,
|
|
117
117
|
);
|
|
118
118
|
if (!repoService) {
|
|
119
119
|
throw new Error(
|
|
@@ -134,7 +134,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
|
134
134
|
);
|
|
135
135
|
|
|
136
136
|
const repoService = this.reflectionHelper.getRepoService(
|
|
137
|
-
entityMaster.
|
|
137
|
+
entityMaster.entity_data_class,
|
|
138
138
|
);
|
|
139
139
|
if (!repoService) {
|
|
140
140
|
throw new Error(
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
-
import { MenuService } from '../service/menu.service';
|
|
3
|
-
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
-
|
|
5
|
-
@Controller('menu')
|
|
6
|
-
export class MenuController {
|
|
7
|
-
constructor(private readonly menuService: MenuService) {}
|
|
8
|
-
|
|
9
|
-
@UseGuards(JwtAuthGuard)
|
|
10
|
-
@Get()
|
|
11
|
-
async getMenu(@Request() req) {
|
|
12
|
-
const userId = req.user.userId;
|
|
13
|
-
return this.menuService.getUserMenu(userId);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
+
import { MenuService } from '../service/menu.service';
|
|
3
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
+
|
|
5
|
+
@Controller('menu')
|
|
6
|
+
export class MenuController {
|
|
7
|
+
constructor(private readonly menuService: MenuService) {}
|
|
8
|
+
|
|
9
|
+
@UseGuards(JwtAuthGuard)
|
|
10
|
+
@Get()
|
|
11
|
+
async getMenu(@Request() req) {
|
|
12
|
+
const userId = req.user.userId;
|
|
13
|
+
return this.menuService.getUserMenu(userId);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_module_access' })
|
|
4
|
-
export class ModuleAccess {
|
|
5
|
-
@PrimaryGeneratedColumn()
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({type: 'varchar', length: 100, nullable: true})
|
|
9
|
-
module_code: string;
|
|
10
|
-
|
|
11
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
-
role_code: string;
|
|
13
|
-
|
|
14
|
-
@Column({type: 'int', nullable: true })
|
|
15
|
-
access_flag: number;
|
|
16
|
-
|
|
17
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
18
|
-
action_type: string;
|
|
19
|
-
|
|
20
|
-
@Column({type: 'varchar', length: 100, nullable: true})
|
|
21
|
-
app_code: string;
|
|
22
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_module_access' })
|
|
4
|
+
export class ModuleAccess {
|
|
5
|
+
@PrimaryGeneratedColumn()
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({type: 'varchar', length: 100, nullable: true})
|
|
9
|
+
module_code: string;
|
|
10
|
+
|
|
11
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
+
role_code: string;
|
|
13
|
+
|
|
14
|
+
@Column({type: 'int', nullable: true })
|
|
15
|
+
access_flag: number;
|
|
16
|
+
|
|
17
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
18
|
+
action_type: string;
|
|
19
|
+
|
|
20
|
+
@Column({type: 'varchar', length: 100, nullable: true})
|
|
21
|
+
app_code: string;
|
|
22
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'module_action' })
|
|
4
|
-
export class ModuleAction {
|
|
5
|
-
@PrimaryGeneratedColumn()
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({type: 'int', nullable: true})
|
|
9
|
-
module_id: number;
|
|
10
|
-
|
|
11
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
-
module_code: string;
|
|
13
|
-
|
|
14
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
15
|
-
action_name:string
|
|
16
|
-
|
|
17
|
-
@Column({type: 'varchar', length: 50, nullable: true })
|
|
18
|
-
action_type: string;
|
|
19
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'module_action' })
|
|
4
|
+
export class ModuleAction {
|
|
5
|
+
@PrimaryGeneratedColumn()
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({type: 'int', nullable: true})
|
|
9
|
+
module_id: number;
|
|
10
|
+
|
|
11
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
+
module_code: string;
|
|
13
|
+
|
|
14
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
15
|
+
action_name:string
|
|
16
|
+
|
|
17
|
+
@Column({type: 'varchar', length: 50, nullable: true })
|
|
18
|
+
action_type: string;
|
|
19
|
+
}
|