diff --git a/src/app/modules/polyglot/member/services/member.service.ts b/src/app/modules/polyglot/member/services/member.service.ts index 5076392..62cd674 100644 --- a/src/app/modules/polyglot/member/services/member.service.ts +++ b/src/app/modules/polyglot/member/services/member.service.ts @@ -22,7 +22,7 @@ import { SUBJECT_UPDATE_MEMBER, SUBJECT_CREATE_MEMBER, SUBJECT_UPDATE_MEMBER_FOR_PASSWORD, -} from 'app/modules/proto/c2se/backend/member_pb'; +} from 'app/modules/proto/c2se/frontend/member_pb'; import { Pagination } from 'app/modules/proto/protobuf/pagination_pb'; @Injectable({ diff --git a/src/app/modules/polyglot/member_referrer/services/member_referrer.service.ts b/src/app/modules/polyglot/member_referrer/services/member_referrer.service.ts index 057f21f..32babb2 100644 --- a/src/app/modules/polyglot/member_referrer/services/member_referrer.service.ts +++ b/src/app/modules/polyglot/member_referrer/services/member_referrer.service.ts @@ -5,27 +5,14 @@ import * as nats from 'nats.ws'; import { Error } from 'app/modules/proto/protobuf/rpc_pb'; import { - ListMemberReferrersRequest, - ListMemberReferrersResponse, - CreateMemberReferrerRequest, - CreateMemberReferrerResponse, UpdateMemberReferrerRequest, UpdateMemberReferrerResponse, DeleteMemberReferrerRequest, DeleteMemberReferrerResponse, - GetMemberReferrerResponse, - GetMemberReferrerRequest, GetMemberReferrerByCodeResponse, GetMemberReferrerByCodeRequest, } from 'app/modules/proto/c2se/member_referrer_pb'; -import { - SUBJECT_LIST_MEMBER_REFERRERS, - SUBJECT_CREATE_MEMBER_REFERRER, - SUBJECT_UPDATE_MEMBER_REFERRER, - SUBJECT_DELETE_MEMBER_REFERRER, - SUBJECT_GET_MEMBER_REFERRER, - SUBJECT_GET_MEMBER_REFERRER_BY_CODE, -} from 'app/modules/proto/c2se/backend/member_referrer_pb'; +import { SUBJECT_GET_MEMBER_REFERRER_BY_CODE } from 'app/modules/proto/c2se/frontend/member_referrer_pb'; @Injectable({ providedIn: 'root', @@ -44,78 +31,6 @@ export class MemberReferrerService { // @ Public methods // ----------------------------------------------------------------------------------------------------- - createMemberReferrer( - memberId: string - ): Promise { - return new Promise( - (resolve, reject) => { - let req = new CreateMemberReferrerRequest(); - req.setMemberId(memberId); - - this.__natsService - .request( - SUBJECT_CREATE_MEMBER_REFERRER, - req.serializeBinary(), - CreateMemberReferrerResponse.deserializeBinary - ) - .then((result) => { - console.log('success', result, result.getMemberReferrer()); - return resolve(result); - }) - .catch((e: Error) => { - console.log('failed', e); - return reject(e); - }); - } - ); - } - - listMemberReferrers(): Promise { - return new Promise( - (resolve, reject) => { - let req = new ListMemberReferrersRequest(); - - this.__natsService - .request( - SUBJECT_LIST_MEMBER_REFERRERS, - req.serializeBinary(), - ListMemberReferrersResponse.deserializeBinary - ) - .then((result) => { - console.log('success', result, result.getMemberReferrersList()); - return resolve(result); - }) - .catch((e: Error) => { - console.log('failed', e); - reject(e); - }); - } - ); - } - - getMemberReferrer(id: string): Promise { - return new Promise((resolve, reject) => { - let req = new GetMemberReferrerRequest(); - - req.setId(id); - - this.__natsService - .request( - SUBJECT_GET_MEMBER_REFERRER, - req.serializeBinary(), - GetMemberReferrerResponse.deserializeBinary - ) - .then((result) => { - console.log('success', result, result.getMemberReferrer()); - return resolve(result); - }) - .catch((e: Error) => { - console.log('failed', e); - return reject(e); - }); - }); - } - getMemberReferrerByCode( code: string ): Promise { @@ -142,54 +57,4 @@ export class MemberReferrerService { } ); } - - updateMemberReferrer(): Promise { - return new Promise( - (resolve, reject) => { - let req = new UpdateMemberReferrerRequest(); - - this.__natsService - .request( - SUBJECT_UPDATE_MEMBER_REFERRER, - req.serializeBinary(), - UpdateMemberReferrerResponse.deserializeBinary - ) - .then((result) => { - console.log('success', result, result.getMemberReferrer()); - return resolve(result); - }) - .catch((e: Error) => { - console.log('failed', e); - return reject(e); - }); - } - ); - } - - deleteMemberReferrer( - id: string - ): Promise { - return new Promise( - (resolve, reject) => { - let req = new DeleteMemberReferrerRequest(); - - req.setId(id); - - this.__natsService - .request( - SUBJECT_DELETE_MEMBER_REFERRER, - req.serializeBinary(), - DeleteMemberReferrerResponse.deserializeBinary - ) - .then((result) => { - console.log('success', result); - return resolve(result); - }) - .catch((e: Error) => { - console.log('failed', e); - return reject(e); - }); - } - ); - } }