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

View File

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