Skip to content

Commit

Permalink
Issue #SB-4869 feat: Created dilcode API
Browse files Browse the repository at this point in the history
 for implementation.
  • Loading branch information
swayangjit committed Jul 3, 2018
1 parent c869575 commit 19df829
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/framework.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { LocationInfoService } from "./services/utils/location.service";
import { ShareUtil } from "./services/utils/share.service";
import { BuildParamService } from "./services/utils/buildparam.service";
import { FormService } from "./services/form/form.service";
import { DialCodeService } from "./services/dialcode/dialcode.service";

@NgModule({
declarations: [
Expand Down Expand Up @@ -54,6 +55,7 @@ import { FormService } from "./services/form/form.service";
LocationInfoService,
BuildParamService,
FormService,
DialCodeService,
QRScanner,
ShareUtil
],
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ export * from "./services/utils/share.service";
export * from "./services/utils/buildparam.service";
export * from "./services/form/bean";
export * from "./services/form/form.service";
export * from "./services/dialcode/bean";
export * from "./services/dialcode/dialcode.service";

export * from "./framework.module";
6 changes: 4 additions & 2 deletions src/services/content/content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ export class ContentService {

searchContent(request: ContentSearchCriteria,
isFilterApplied: boolean,
isDialCodeSearch: boolean ,
isGuestUser: boolean,
successCallback: (response: string) => void,
errorCallback: (error: string) => void) {
try {
this.factory.getContentService().searchContent(JSON.stringify(request), isFilterApplied, successCallback, errorCallback);
this.factory.getContentService().searchContent(JSON.stringify(request), isFilterApplied, isDialCodeSearch , isGuestUser, successCallback, errorCallback);
} catch (error) {
console.log(error);
}
}

getAllLocalContents(request: ContentFilterCriteria,
getAllLocalContents(request: ContentFilterCriteria,
successCallback: (response: string) => void,
errorCallback: (response: string) => void) {
try {
Expand Down
3 changes: 3 additions & 0 deletions src/services/dialcode/bean.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export class DialCodeRequest {
identifier: string;
}
21 changes: 21 additions & 0 deletions src/services/dialcode/dialcode.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Injectable } from "@angular/core";
import { ServiceProvider } from "../factory";
import { DialCodeRequest } from "./bean";

@Injectable()
export class DialCodeService {

constructor(private factory: ServiceProvider) {
}

getForm(request: DialCodeRequest,
successCallback: (response: string) => void,
errorCallback: (error: string) => void) {
try {
this.factory.getDialCodeService().getDialCode(JSON.stringify(request), successCallback, errorCallback);
} catch (error) {
console.log(error);
}
}

}
4 changes: 4 additions & 0 deletions src/services/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ export class ServiceProvider {
getFormService(): any {

}

getDialCodeService(): any {

}
}
4 changes: 4 additions & 0 deletions src/services/geniesdk.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ export class GenieSDKServiceProvider extends ServiceProvider {
return (<any>window).GenieSDK.form;
}

getDialCodeService(): any {
return (<any>window).GenieSDK.dialcode;
}

}

0 comments on commit 19df829

Please sign in to comment.