• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript net.service.NetService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@eg/core/net.service.NetService的典型用法代码示例。如果您正苦于以下问题:TypeScript service.NetService类的具体用法?TypeScript service.NetService怎么用?TypeScript service.NetService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了service.NetService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: saveTree

    // Server API deletes and recreates the tree on update.
    // It manages parent/child relationships via the children array.
    // We only need send the current tree in a form the API recognizes.
    saveTree(): Promise<any> {


        const compileTree = (node?: TreeNode) => {

            if (!node) { node = this.tree.rootNode; }

            const point = node.callerData.point;

            node.children.forEach(child =>
                point.children().push(compileTree(child)));

            return point;
        };

        const rootPoint: IdlObject = compileTree();

        return this.net.request(
            'open-ils.vandelay',
            'open-ils.vandelay.match_set.update',
            this.auth.token(), this.matchSet_.id(), rootPoint
        ).toPromise().then(
            ok => this.refreshTree(),
            err => console.error(err)
        );
    }
开发者ID:evergreen-library-system,项目名称:Evergreen,代码行数:29,代码来源:match-set-expression.component.ts


示例2: removeItem

 removeItem(cacheKey: string, attr: string): Promise<string> {
     return this.net.request(
         'open-ils.actor',
         'open-ils.actor.anon_cache.set_value',
         cacheKey, attr, null
     ).toPromise();
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:7,代码来源:anon-cache.service.ts


示例3: ngOnInit

 ngOnInit() {
     this.server = window.location.hostname;
     this.net.request(
         'open-ils.actor',
         'opensrf.open-ils.system.ils_version'
     ).subscribe(v => this.version = v);
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:7,代码来源:about.component.ts


示例4:

 this.basket.getRecordIds().then(ids => {
     this.net.request(
         'open-ils.search',
         'open-ils.search.biblio.record.email',
         this.auth.token(), ids
     ).toPromise(); // fire-and-forget
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:7,代码来源:basket-actions.component.ts


示例5: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype(this.bucketType);

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                // make it find-able to the queue-add method which
                // requires the bucket name.
                bucket.id(bktId);
                this.buckets.push(bucket);
                this.addToBucket(bktId);
            }
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:26,代码来源:record-bucket-dialog.component.ts


示例6: fetchHold

    fetchHold() {
        if (!this._holdId) { return; }

        this.net.request(
            'open-ils.circ',
            'open-ils.circ.hold.wide_hash.stream',
            this.auth.token(), {id: this._holdId}
        ).subscribe(wideHold => {
            this.hold = wideHold;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:11,代码来源:detail.component.ts


示例7: getHoldCount

    // Get -> Set -> Return bib hold count
    getHoldCount(): Promise<number> {

        if (Number.isInteger(this.holdCount)) {
            return Promise.resolve(this.holdCount);
        }

        return this.net.request(
            'open-ils.circ',
            'open-ils.circ.bre.holds.count', this.id
        ).toPromise().then(count => this.holdCount = count);
    }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:12,代码来源:bib-record.service.ts


示例8: deleteNext

            const deleteNext = (idx: number) => {
                const queue = selected[idx];
                if (!queue) {
                    this.currentGrid().reload();
                    return Promise.resolve();
                }

                return this.net.request('open-ils.vandelay',
                    method, this.auth.token(), queue.id()
                ).toPromise().then(() => deleteNext(++idx));
            };
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:11,代码来源:queue-list.component.ts


示例9:

 this.gridSource.getRows = (pager: Pager) => {
     return this.net.request(
         'open-ils.vandelay',
         'open-ils.vandelay.import_item.queue.retrieve',
         this.auth.token(), this.queueId, {
             with_import_error: this.filterImportErrors,
             offset: pager.offset,
             limit: pager.limit
         }
     );
 };
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:11,代码来源:queue-items.component.ts


示例10: placeHold

    placeHold(request: HoldRequest): Observable<HoldRequest> {

        let method = 'open-ils.circ.holds.test_and_create.batch';
        if (request.override) { method = method + '.override'; }

        return this.net.request(
            'open-ils.circ', method, this.auth.token(), {
                patronid:       request.recipient,
                pickup_lib:     request.pickupLib,
                hold_type:      request.holdType,
                email_notify:   request.notifyEmail,
                phone_notify:   request.notifyPhone,
                thaw_date:      request.thawDate,
                frozen:         request.frozen,
                sms_notify:     request.notifySms,
                sms_carrier:    request.smsCarrier,
                holdable_formats_map: request.holdableFormats
            },
            [request.holdTarget]
        ).pipe(map(
            resp => {
                let result = resp.result;
                const holdResult: HoldRequestResult = {success: true};

                // API can return an ID, an array of events, or a hash
                // of info.

                if (Number(result) > 0) {
                    // On success, the API returns the hold ID.
                    holdResult.holdId = result;
                    console.debug(`Hold successfully placed ${result}`);

                } else {
                    holdResult.success = false;
                    console.info('Hold request failed: ', result);

                    if (Array.isArray(result)) { result = result[0]; }

                    if (this.evt.parse(result)) {
                        holdResult.evt = this.evt.parse(result);
                    } else {
                        holdResult.evt = this.evt.parse(result.last_event);
                    }
                }

                request.result = holdResult;
                return request;
            }
        ));
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:50,代码来源:holds.service.ts



注:本文中的@eg/core/net.service.NetService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript org.service.OrgService类代码示例发布时间:2022-05-28
下一篇:
TypeScript locale.service.LocaleService类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap