bug fixed
This commit is contained in:
parent
9fc1eb7785
commit
8119c06f94
|
@ -22,7 +22,7 @@ import {
|
||||||
SUBJECT_UPDATE_MEMBER,
|
SUBJECT_UPDATE_MEMBER,
|
||||||
SUBJECT_CREATE_MEMBER,
|
SUBJECT_CREATE_MEMBER,
|
||||||
SUBJECT_UPDATE_MEMBER_FOR_PASSWORD,
|
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';
|
import { Pagination } from 'app/modules/proto/protobuf/pagination_pb';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|
|
@ -5,27 +5,14 @@ import * as nats from 'nats.ws';
|
||||||
import { Error } from 'app/modules/proto/protobuf/rpc_pb';
|
import { Error } from 'app/modules/proto/protobuf/rpc_pb';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ListMemberReferrersRequest,
|
|
||||||
ListMemberReferrersResponse,
|
|
||||||
CreateMemberReferrerRequest,
|
|
||||||
CreateMemberReferrerResponse,
|
|
||||||
UpdateMemberReferrerRequest,
|
UpdateMemberReferrerRequest,
|
||||||
UpdateMemberReferrerResponse,
|
UpdateMemberReferrerResponse,
|
||||||
DeleteMemberReferrerRequest,
|
DeleteMemberReferrerRequest,
|
||||||
DeleteMemberReferrerResponse,
|
DeleteMemberReferrerResponse,
|
||||||
GetMemberReferrerResponse,
|
|
||||||
GetMemberReferrerRequest,
|
|
||||||
GetMemberReferrerByCodeResponse,
|
GetMemberReferrerByCodeResponse,
|
||||||
GetMemberReferrerByCodeRequest,
|
GetMemberReferrerByCodeRequest,
|
||||||
} from 'app/modules/proto/c2se/member_referrer_pb';
|
} from 'app/modules/proto/c2se/member_referrer_pb';
|
||||||
import {
|
import { SUBJECT_GET_MEMBER_REFERRER_BY_CODE } from 'app/modules/proto/c2se/frontend/member_referrer_pb';
|
||||||
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';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
@ -44,78 +31,6 @@ export class MemberReferrerService {
|
||||||
// @ Public methods
|
// @ Public methods
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
createMemberReferrer(
|
|
||||||
memberId: string
|
|
||||||
): Promise<CreateMemberReferrerResponse.Result> {
|
|
||||||
return new Promise<CreateMemberReferrerResponse.Result>(
|
|
||||||
(resolve, reject) => {
|
|
||||||
let req = new CreateMemberReferrerRequest();
|
|
||||||
req.setMemberId(memberId);
|
|
||||||
|
|
||||||
this.__natsService
|
|
||||||
.request<CreateMemberReferrerResponse.Result>(
|
|
||||||
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<ListMemberReferrersResponse.Result> {
|
|
||||||
return new Promise<ListMemberReferrersResponse.Result>(
|
|
||||||
(resolve, reject) => {
|
|
||||||
let req = new ListMemberReferrersRequest();
|
|
||||||
|
|
||||||
this.__natsService
|
|
||||||
.request<ListMemberReferrersResponse.Result>(
|
|
||||||
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<GetMemberReferrerResponse.Result> {
|
|
||||||
return new Promise<GetMemberReferrerResponse.Result>((resolve, reject) => {
|
|
||||||
let req = new GetMemberReferrerRequest();
|
|
||||||
|
|
||||||
req.setId(id);
|
|
||||||
|
|
||||||
this.__natsService
|
|
||||||
.request<GetMemberReferrerResponse.Result>(
|
|
||||||
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(
|
getMemberReferrerByCode(
|
||||||
code: string
|
code: string
|
||||||
): Promise<GetMemberReferrerByCodeResponse.Result> {
|
): Promise<GetMemberReferrerByCodeResponse.Result> {
|
||||||
|
@ -142,54 +57,4 @@ export class MemberReferrerService {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMemberReferrer(): Promise<UpdateMemberReferrerResponse.Result> {
|
|
||||||
return new Promise<UpdateMemberReferrerResponse.Result>(
|
|
||||||
(resolve, reject) => {
|
|
||||||
let req = new UpdateMemberReferrerRequest();
|
|
||||||
|
|
||||||
this.__natsService
|
|
||||||
.request<UpdateMemberReferrerResponse.Result>(
|
|
||||||
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<DeleteMemberReferrerResponse.Result> {
|
|
||||||
return new Promise<DeleteMemberReferrerResponse.Result>(
|
|
||||||
(resolve, reject) => {
|
|
||||||
let req = new DeleteMemberReferrerRequest();
|
|
||||||
|
|
||||||
req.setId(id);
|
|
||||||
|
|
||||||
this.__natsService
|
|
||||||
.request<DeleteMemberReferrerResponse.Result>(
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user