fixed Observable return type error

This commit is contained in:
leejh 2019-09-23 11:47:36 +09:00
parent 1c848e6e1c
commit d19602e378
2 changed files with 21 additions and 13 deletions

View File

@ -15,17 +15,20 @@ import {
import { import {
BuddyAddRequest, BuddyAddRequest,
encodeBuddyAdd, encodeBuddyAdd,
decodeBuddyAdd decodeBuddyAdd,
BuddyAddResponse
} from '../models/buddy-add'; } from '../models/buddy-add';
import { import {
BuddyDelRequest, BuddyDelRequest,
encodeBuddyDel, encodeBuddyDel,
decodeBuddyDel decodeBuddyDel,
BuddyDelResponse
} from '../models/buddy-del'; } from '../models/buddy-del';
import { import {
BuddyUpdateRequest, BuddyUpdateRequest,
decodeBuddyUpdate, decodeBuddyUpdate,
encodeBuddyUpdate encodeBuddyUpdate,
BuddyUpdateResponse
} from '../models/buddy-update'; } from '../models/buddy-update';
@Injectable({ @Injectable({
@ -34,19 +37,19 @@ import {
export class BuddyProtocolService { export class BuddyProtocolService {
constructor(private protocolService: ProtocolService) {} constructor(private protocolService: ProtocolService) {}
public buddyAdd(req: BuddyAddRequest): Observable<BuddyAddRequest> { public buddyAdd(req: BuddyAddRequest): Observable<BuddyAddResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_ADD_REQ, ...encodeBuddyAdd(req)) .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_ADD_REQ, ...encodeBuddyAdd(req))
.pipe(map(res => decodeBuddyAdd(res))); .pipe(map(res => decodeBuddyAdd(res)));
} }
public buddyDel(req: BuddyDelRequest): Observable<BuddyDelRequest> { public buddyDel(req: BuddyDelRequest): Observable<BuddyDelResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_DEL_REQ, ...encodeBuddyDel(req)) .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_DEL_REQ, ...encodeBuddyDel(req))
.pipe(map(res => decodeBuddyDel(res))); .pipe(map(res => decodeBuddyDel(res)));
} }
public buddyUpdate(req: BuddyUpdateRequest): Observable<BuddyUpdateRequest> { public buddyUpdate(req: BuddyUpdateRequest): Observable<BuddyUpdateResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_UPD_REQ, ...encodeBuddyUpdate(req)) .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_UPD_REQ, ...encodeBuddyUpdate(req))
.pipe(map(res => decodeBuddyUpdate(res))); .pipe(map(res => decodeBuddyUpdate(res)));

View File

@ -7,7 +7,8 @@ import { ProtocolService } from '@ucap-webmessenger/protocol';
import { import {
GroupAddRequest, GroupAddRequest,
encodeGroupAdd, encodeGroupAdd,
decodeGroupAdd decodeGroupAdd,
GroupAddResponse
} from '../models/group-add'; } from '../models/group-add';
import { import {
SVC_TYPE_GROUP, SVC_TYPE_GROUP,
@ -19,14 +20,16 @@ import {
import { import {
GroupDelRequest, GroupDelRequest,
encodeGroupDel, encodeGroupDel,
decodeGroupDel decodeGroupDel,
GroupDelResponse
} from '../models/group-del'; } from '../models/group-del';
import { import {
GroupUpdateRequest, GroupUpdateRequest,
encodeGroupUpdate, encodeGroupUpdate,
decodeGroupUpdate, decodeGroupUpdate,
encodeGroupUpdate2, encodeGroupUpdate2,
decodeGroupUpdate2 decodeGroupUpdate2,
GroupUpdateResponse
} from '../models/group-update'; } from '../models/group-update';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -34,25 +37,27 @@ import {
export class GroupProtocolService { export class GroupProtocolService {
constructor(private protocolService: ProtocolService) {} constructor(private protocolService: ProtocolService) {}
public groupAdd(req: GroupAddRequest): Observable<GroupAddRequest> { public groupAdd(req: GroupAddRequest): Observable<GroupAddResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_ADD_REQ, ...encodeGroupAdd(req)) .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_ADD_REQ, ...encodeGroupAdd(req))
.pipe(map(res => decodeGroupAdd(res))); .pipe(map(res => decodeGroupAdd(res)));
} }
public groupDel(req: GroupDelRequest): Observable<GroupDelRequest> { public groupDel(req: GroupDelRequest): Observable<GroupDelResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_DEL_REQ, ...encodeGroupDel(req)) .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_DEL_REQ, ...encodeGroupDel(req))
.pipe(map(res => decodeGroupDel(res))); .pipe(map(res => decodeGroupDel(res)));
} }
public groupUpdate(req: GroupUpdateRequest): Observable<GroupUpdateRequest> { public groupUpdate(req: GroupUpdateRequest): Observable<GroupUpdateResponse> {
return this.protocolService return this.protocolService
.call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ, ...encodeGroupUpdate(req)) .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ, ...encodeGroupUpdate(req))
.pipe(map(res => decodeGroupUpdate(res))); .pipe(map(res => decodeGroupUpdate(res)));
} }
public groupUpdate2(req: GroupUpdateRequest): Observable<GroupUpdateRequest> { public groupUpdate2(
req: GroupUpdateRequest
): Observable<GroupUpdateResponse> {
return this.protocolService return this.protocolService
.call( .call(
SVC_TYPE_GROUP, SVC_TYPE_GROUP,