From 45bb511a4b9a6c4887ab9d67bcdcc677f5507f3a Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Tue, 30 Aug 2022 10:44:12 +0000 Subject: [PATCH] constants are added --- .../member/partner/components/list.component.ts | 15 ++++++++------- .../partner/compose/regist-compose.component.ts | 3 ++- .../member/partner/resolvers/partner.resolver.ts | 13 +++++++------ .../polyglot/member/services/member.service.ts | 2 +- src/environments/environment.prod.ts | 16 ++++++++++++++++ src/environments/environment.ts | 16 ++++++++++++++++ src/environments/environment.type.ts | 16 ++++++++++++++++ 7 files changed, 66 insertions(+), 15 deletions(-) diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index d2ed8aa..5ff562e 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -59,6 +59,7 @@ import { ListMemberLevelsResponse } from 'app/modules/proto/c2se/member_level_pb import { MemberLevel } from 'app/modules/proto/models/member_level_pb'; import { Pagination } from 'app/modules/proto/protobuf/pagination_pb'; import { VendorService } from 'app/modules/polyglot/api/services/vendor.service'; +import { environment } from 'environments/environment'; @Component({ selector: 'partner-list', @@ -139,32 +140,32 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { case '/member/partner/all': this.title = '전체목록'; this.btnTitle = '대본등록'; - this.memberClassId = '4b014ef5-3bab-4413-aaf9-b0040a70ec77'; + this.memberClassId = environment.constants.classeIds.mainOffice; break; case '/member/partner/main-office': this.title = '본사목록'; this.btnTitle = '대본등록'; - this.memberClassId = 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb'; + this.memberClassId = environment.constants.classeIds.branch; break; case '/member/partner/branch': this.title = '대본목록'; this.btnTitle = '부본등록'; - this.memberClassId = 'f25a17e9-5c5f-4e9c-bf80-92a9cedf829c'; + this.memberClassId = environment.constants.classeIds.division; break; case '/member/partner/division': this.title = '부본목록'; this.btnTitle = '총판등록'; - this.memberClassId = 'cac7b897-2549-4f04-8415-8868f1dcb1da'; + this.memberClassId = environment.constants.classeIds.office; break; case '/member/partner/office': this.title = '총판목록'; this.btnTitle = '매장등록'; - this.memberClassId = 'e11cac11-3825-4f4e-9cd5-39367f23f973'; + this.memberClassId = environment.constants.classeIds.store; break; case '/member/partner/store': this.title = '매장목록'; this.btnTitle = '회원등록'; - this.memberClassId = '4598f07a-86d1-42a4-b038-25706683a7cd'; + this.memberClassId = environment.constants.classeIds.user; break; default: console.log(this.router.url); @@ -254,7 +255,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { req.setPagination(paging); let search = new ListMembersRequest.Search(); - search.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77'); + search.setMemberClassId(environment.constants.classeIds.mainOffice); req.setSearch(search); return of(this.__memberService.listMembers(req)); diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts index 1b0f6bc..727ef6f 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts @@ -20,6 +20,7 @@ import { Site } from 'app/modules/proto/models/site_pb'; import { MemberModel } from 'app/modules/proto/models/member_pb'; import { fuseAnimations } from '@fuse/animations'; import { BankService } from 'app/modules/polyglot/bank/services/bank.service'; +import { environment } from 'environments/environment'; export interface RegistComposeData { title: string; @@ -168,7 +169,7 @@ export class RegistComposeComponent implements OnInit { member.setUsername(username); member.setPassword(password); member.setMemberClassId(this.data.classId); - member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57'); + member.setMemberLevelId(environment.constants.levelIds.level1); if (!!parentUsername) { member.setReferrerMemberUsername(parentUsername); } diff --git a/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts b/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts index f81dfcf..a050487 100644 --- a/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts +++ b/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts @@ -11,6 +11,7 @@ import { ListMembersResponse, } from 'app/modules/proto/c2se/member_pb'; import { Pagination } from 'app/modules/proto/protobuf/pagination_pb'; +import { environment } from 'environments/environment'; import { catchError, Observable, throwError } from 'rxjs'; import { Partner } from '../models/partner'; @@ -122,7 +123,7 @@ export class PartnerListResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77'); + search.setMemberClassId(environment.constants.classeIds.mainOffice); req.setSearch(search); return this.__memberService.listMembers(req); @@ -157,7 +158,7 @@ export class PartnerListForMainOfficeResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77'); + search.setMemberClassId(environment.constants.classeIds.mainOffice); req.setSearch(search); return this.__memberService.listMembers(req); @@ -192,7 +193,7 @@ export class PartnerListForBranchResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('ae9b874e-5d0e-4c4d-8432-f45f02691ceb'); + search.setMemberClassId(environment.constants.classeIds.branch); req.setSearch(search); return this.__memberService.listMembers(req); @@ -227,7 +228,7 @@ export class PartnerListForDivisionResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('f25a17e9-5c5f-4e9c-bf80-92a9cedf829c'); + search.setMemberClassId(environment.constants.classeIds.division); req.setSearch(search); return this.__memberService.listMembers(req); @@ -262,7 +263,7 @@ export class PartnerListForOfficeResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('cac7b897-2549-4f04-8415-8868f1dcb1da'); + search.setMemberClassId(environment.constants.classeIds.office); req.setSearch(search); return this.__memberService.listMembers(req); @@ -297,7 +298,7 @@ export class PartnerListForStoreResolver implements Resolve { | ListMembersResponse.Result { let req = new ListMembersRequest(); let search = new ListMembersRequest.Search(); - search.setMemberClassId('e11cac11-3825-4f4e-9cd5-39367f23f973'); + search.setMemberClassId(environment.constants.classeIds.store); req.setSearch(search); return this.__memberService.listMembers(req); diff --git a/src/app/modules/polyglot/member/services/member.service.ts b/src/app/modules/polyglot/member/services/member.service.ts index 43cc27c..eebd4d4 100644 --- a/src/app/modules/polyglot/member/services/member.service.ts +++ b/src/app/modules/polyglot/member/services/member.service.ts @@ -186,7 +186,7 @@ export class MemberService { // siteId: 8429a7ab-b9de-400b-a209-28ff46e22bec // classId: 4b014ef5-3bab-4413-aaf9-b0040a70ec77 - // levelId: c56231ac-2120-4a81-a30a-5d41fafb6c57 + // levelId: environment.constants.levelIds.level1 createMember(req: CreateMemberRequest): Promise { return new Promise((resolve, reject) => { diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 5a2a8b7..790209d 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -11,4 +11,20 @@ export const environment: Environment = { // servers: ['ws://30.20.0.149:8088'], }, }, + constants: { + classeIds: { + mainOffice: '4b014ef5-3bab-4413-aaf9-b0040a70ec77', + branch: 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb', + division: 'f25a17e9-5c5f-4e9c-bf80-92a9cedf829c', + office: 'cac7b897-2549-4f04-8415-8868f1dcb1da', + store: 'e11cac11-3825-4f4e-9cd5-39367f23f973', + user: '4598f07a-86d1-42a4-b038-25706683a7cd', + }, + levelIds: { + level1: 'c56231ac-2120-4a81-a30a-5d41fafb6c57', + level2: 'df49d067-d554-43b1-87f4-82fb246cec5f', + level3: '0cce35ee-9668-495e-8840-e3d7b5b01b76', + level4: 'e7e768d7-1d3d-4ae1-866d-4db1c1f0d9a5', + }, + }, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c8cd57b..3404129 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -15,6 +15,22 @@ export const environment: Environment = { // servers: ['ws://30.20.0.149:8088'], }, }, + constants: { + classeIds: { + mainOffice: '4b014ef5-3bab-4413-aaf9-b0040a70ec77', + branch: 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb', + division: 'f25a17e9-5c5f-4e9c-bf80-92a9cedf829c', + office: 'cac7b897-2549-4f04-8415-8868f1dcb1da', + store: 'e11cac11-3825-4f4e-9cd5-39367f23f973', + user: '4598f07a-86d1-42a4-b038-25706683a7cd', + }, + levelIds: { + level1: 'c56231ac-2120-4a81-a30a-5d41fafb6c57', + level2: 'df49d067-d554-43b1-87f4-82fb246cec5f', + level3: '0cce35ee-9668-495e-8840-e3d7b5b01b76', + level4: 'e7e768d7-1d3d-4ae1-866d-4db1c1f0d9a5', + }, + }, }; /* diff --git a/src/environments/environment.type.ts b/src/environments/environment.type.ts index fc344ad..06d58a4 100644 --- a/src/environments/environment.type.ts +++ b/src/environments/environment.type.ts @@ -5,4 +5,20 @@ export interface Environment { nats: { connectionOptions: nats.ConnectionOptions; }; + constants: { + classeIds: { + mainOffice: string; + branch: string; + division: string; + office: string; + store: string; + user: string; + }; + levelIds: { + level1: string; + level2: string; + level3: string; + level4: string; + }; + }; }