cundd/rest-adapter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cundd/rest-adapter

Composer 安装命令:

composer require cundd/rest-adapter

包简介

TypeScript Adapter for [Cundd Rest](https://rest.cundd.net)

README 文档

README

Library to fetch and deserialize objects from a REST API

import {AdapterConfiguration, RestAdapter, PropertyTypeOptions, ra_property} from '@cundd/rest-adapter';

export class Person {
    // Map property `name` 1:1 when converting 
    @ra_property()
    public name: string;

    // Convert the input data of `realEstates` into an array of `RealEstate` objects 
    @ra_property(RealEstate, PropertyTypeOptions.Multiple)
    public realEstates: RealEstate[];
}

export class RealEstate {
    // Use key `street` for property `_street` when converting 
    @ra_property('street')
    private _street: string;

    get street(): string {
        return this._street;
    }
}

const rd = new RestAdapter(AdapterConfiguration.fromUrl('http://base.url.tld/rest/'));
const promise = rd.findAll<Person>('Iresults-RealEstate-Person');
promise
    .then((foundPersons: Person[])=> {
        // Do something with the found records
    })
    .catch(error => {
        // Handle errors
    });

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: TypeScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固