1.0.0 • Published 5 years ago

fun-soa-node v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

soa服务使用说明

1 确定应用契约 2 根据契约,创建契约相同的文件名 3 类名继承ContractCore 4 调用需要知道controller中的方法映射路径, this.executeService('banner')

例如文件: com.sce.ifun.web.IndexController.js

class ContractService extends ContractCore { constructor() {

    // 这个必须调用 否则无法读取service
    super(__filename);
}

// banner为一个java中一个controller的方法映射path
getBanners() {
    return this.executeService('banner');
}

// get-city-list为一个java中一个controller的方法映射path
getCityList() {
    return this.executeService('get-city-list');
}

}

module.exports = ContractService;