rez_core 1.0.38 → 1.0.39
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/.idea/250218_nodejs_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dataSources.xml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/meta/controller/media.controller.js +0 -2
- package/dist/module/meta/controller/media.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +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/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/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/media.controller.ts +1 -1
- 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/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/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/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
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Body,
|
|
3
|
-
Controller,
|
|
4
|
-
HttpStatus,
|
|
5
|
-
Inject,
|
|
6
|
-
Post,
|
|
7
|
-
Res,
|
|
8
|
-
ValidationPipe,
|
|
9
|
-
} from '@nestjs/common';
|
|
10
|
-
import { UserService } from '../service/user.service';
|
|
11
|
-
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
-
import { Response } from 'express';
|
|
13
|
-
|
|
14
|
-
@Controller('user')
|
|
15
|
-
export class UserController {
|
|
16
|
-
constructor(
|
|
17
|
-
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
-
) {}
|
|
19
|
-
|
|
20
|
-
@Post('signup')
|
|
21
|
-
async signup(
|
|
22
|
-
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
-
@Res() res: Response,
|
|
24
|
-
) {
|
|
25
|
-
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
-
res.status(HttpStatus.OK).json(result);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
HttpStatus,
|
|
5
|
+
Inject,
|
|
6
|
+
Post,
|
|
7
|
+
Res,
|
|
8
|
+
ValidationPipe,
|
|
9
|
+
} from '@nestjs/common';
|
|
10
|
+
import { UserService } from '../service/user.service';
|
|
11
|
+
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
+
import { Response } from 'express';
|
|
13
|
+
|
|
14
|
+
@Controller('user')
|
|
15
|
+
export class UserController {
|
|
16
|
+
constructor(
|
|
17
|
+
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
@Post('signup')
|
|
21
|
+
async signup(
|
|
22
|
+
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
+
@Res() res: Response,
|
|
24
|
+
) {
|
|
25
|
+
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
+
res.status(HttpStatus.OK).json(result);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
-
import { CreateUserDto } from './create-user.dto';
|
|
3
|
-
|
|
4
|
-
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
1
|
+
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
+
import { CreateUserDto } from './create-user.dto';
|
|
3
|
+
|
|
4
|
+
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_user_role_mapping' })
|
|
4
|
-
export class UserRoleMapping {
|
|
5
|
-
constructor(user_id: number, role_id: number) {
|
|
6
|
-
this.user_id = user_id;
|
|
7
|
-
this.role_id = role_id;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@PrimaryGeneratedColumn()
|
|
11
|
-
id: number;
|
|
12
|
-
|
|
13
|
-
@Column({ type: 'bigint', nullable: true })
|
|
14
|
-
user_id: number;
|
|
15
|
-
|
|
16
|
-
@Column({ type: 'bigint', nullable: true })
|
|
17
|
-
role_id: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'int', nullable: true })
|
|
20
|
-
is_default: number;
|
|
21
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_user_role_mapping' })
|
|
4
|
+
export class UserRoleMapping {
|
|
5
|
+
constructor(user_id: number, role_id: number) {
|
|
6
|
+
this.user_id = user_id;
|
|
7
|
+
this.role_id = role_id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@PrimaryGeneratedColumn()
|
|
11
|
+
id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'bigint', nullable: true })
|
|
14
|
+
user_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'bigint', nullable: true })
|
|
17
|
+
role_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'int', nullable: true })
|
|
20
|
+
is_default: number;
|
|
21
|
+
}
|