listMemberRequest 설정
This commit is contained in:
parent
0e07f16204
commit
3dd1902deb
|
@ -8,13 +8,8 @@ import {
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {
|
import { FormBuilder, FormControl } from '@angular/forms';
|
||||||
FormBuilder,
|
|
||||||
FormControl,
|
|
||||||
FormGroup,
|
|
||||||
Validators,
|
|
||||||
} from '@angular/forms';
|
|
||||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import { MatSort } from '@angular/material/sort';
|
import { MatSort } from '@angular/material/sort';
|
||||||
import {
|
import {
|
||||||
|
@ -40,11 +35,12 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SiteService } from 'app/modules/polyglot/domain/services/site.service';
|
import { SiteService } from 'app/modules/polyglot/domain/services/site.service';
|
||||||
import { Site } from 'app/modules/protobuf/models/domain/site_pb';
|
import { Site } from 'app/modules/protobuf/models/domain/site_pb';
|
||||||
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
||||||
|
import { MemberModel } from 'app/modules/protobuf/models/member/member_pb';
|
||||||
import {
|
import {
|
||||||
Member,
|
ListMembersRequest,
|
||||||
MemberModel,
|
ListMembersResponse,
|
||||||
} from 'app/modules/protobuf/models/member/member_pb';
|
} from 'app/modules/protobuf/c2se/backend/member_pb';
|
||||||
import { ListMembersResponse } from 'app/modules/protobuf/c2se/backend/member_pb';
|
import { Pagination } from 'app/modules/protobuf/protobuf/pagination/pagination_pb';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'partner-list',
|
selector: 'partner-list',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
|
@ -130,23 +126,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
this._changeDetectorRef.markForCheck();
|
this._changeDetectorRef.markForCheck();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the products
|
this._siteService
|
||||||
/* this.partners$ = this._partnerService.partners$; */
|
|
||||||
|
|
||||||
/* this._siteService
|
|
||||||
.listSites()
|
.listSites()
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.sites = result.getSitesList();
|
this.sites = result.getSitesList();
|
||||||
})
|
})
|
||||||
.catch((reson) => console.log(reson));
|
.catch((reson) => console.log(reson));
|
||||||
|
// Get the products
|
||||||
|
|
||||||
this.__memberService
|
|
||||||
.listMembers()
|
|
||||||
.then((result) => {
|
|
||||||
this.__members = result.getMembersList();
|
|
||||||
console.log('member list', this.__members);
|
|
||||||
})
|
|
||||||
.catch((reson) => console.log(reson)); */
|
|
||||||
this._activatedRoute.data.subscribe((data) => {
|
this._activatedRoute.data.subscribe((data) => {
|
||||||
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
|
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
|
||||||
this.listPartner$ = of(listMemberResult.getMembersList());
|
this.listPartner$ = of(listMemberResult.getMembersList());
|
||||||
|
@ -186,12 +173,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(() => {
|
switchMap(() => {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
return this._partnerService.getPartners(
|
|
||||||
this._paginator.pageIndex,
|
let req = new ListMembersRequest();
|
||||||
this._paginator.pageSize,
|
let paging = new Pagination();
|
||||||
this._sort.active,
|
paging.setPage(this._paginator.pageIndex);
|
||||||
this._sort.direction
|
paging.setPageSize(this._paginator.pageSize);
|
||||||
);
|
|
||||||
|
req.setPagination(paging);
|
||||||
|
req.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77');
|
||||||
|
return of(this.__memberService.listMembers(req));
|
||||||
}),
|
}),
|
||||||
map(() => {
|
map(() => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
|
|
@ -6,7 +6,11 @@ import {
|
||||||
RouterStateSnapshot,
|
RouterStateSnapshot,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
||||||
import { ListMembersResponse } from 'app/modules/protobuf/c2se/backend/member_pb';
|
import {
|
||||||
|
ListMembersRequest,
|
||||||
|
ListMembersResponse,
|
||||||
|
} from 'app/modules/protobuf/c2se/backend/member_pb';
|
||||||
|
import { Pagination } from 'app/modules/protobuf/protobuf/pagination/pagination_pb';
|
||||||
import { catchError, Observable, throwError } from 'rxjs';
|
import { catchError, Observable, throwError } from 'rxjs';
|
||||||
|
|
||||||
import { Partner } from '../models/partner';
|
import { Partner } from '../models/partner';
|
||||||
|
@ -116,6 +120,10 @@ export class PartnerListResolver implements Resolve<any> {
|
||||||
| Observable<ListMembersResponse.Result>
|
| Observable<ListMembersResponse.Result>
|
||||||
| Promise<ListMembersResponse.Result>
|
| Promise<ListMembersResponse.Result>
|
||||||
| ListMembersResponse.Result {
|
| ListMembersResponse.Result {
|
||||||
return this.__memberService.listMembers();
|
let req = new ListMembersRequest();
|
||||||
|
|
||||||
|
req.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77');
|
||||||
|
|
||||||
|
return this.__memberService.listMembers(req);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {
|
||||||
SUBJECT_GET_MEMBER,
|
SUBJECT_GET_MEMBER,
|
||||||
SUBJECT_GET_MEMBER_BY_USERNAME,
|
SUBJECT_GET_MEMBER_BY_USERNAME,
|
||||||
} from 'app/modules/protobuf/c2se/backend/member_pb';
|
} from 'app/modules/protobuf/c2se/backend/member_pb';
|
||||||
|
import { Pagination } from 'app/modules/protobuf/protobuf/pagination/pagination_pb';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
@ -33,9 +34,19 @@ export class MemberService {
|
||||||
// @ Public methods
|
// @ Public methods
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
listMembers(): Promise<ListMembersResponse.Result> {
|
listMembers(req?: ListMembersRequest): Promise<ListMembersResponse.Result> {
|
||||||
return new Promise<ListMembersResponse.Result>((resolve, reject) => {
|
return new Promise<ListMembersResponse.Result>((resolve, reject) => {
|
||||||
let req = new ListMembersRequest();
|
if (!req) {
|
||||||
|
req = new ListMembersRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!req.getPagination()) {
|
||||||
|
let paging = new Pagination();
|
||||||
|
paging.setPageSize(10);
|
||||||
|
paging.setPage(0);
|
||||||
|
|
||||||
|
req.setPagination(paging);
|
||||||
|
}
|
||||||
|
|
||||||
this.__natsService
|
this.__natsService
|
||||||
.request<ListMembersResponse.Result>(
|
.request<ListMembersResponse.Result>(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user