1.0.14 • Published 5 years ago

@typeservice/dubbo v1.0.14

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@typeservice/dubbo

It is a service architecture based on dubbo.

It uses inversify as a dependency injection prototype, and distributes parameters to methods via parameter annotations, which is very strong to decoupled. You can write methods as you wish, distributing them to different parameters via parameter annotations.

Installing

For the latest stable version:

$ npm install @typeservice/dubbo

Usage

import Dubbo, { rpc } from '../src';
import { injectable } from 'inversify';
type COMPONENTS = {
  userinfo: UserInfo,
}
@injectable()
@rpc.Interface('com.mifa.stib.service.TestUserInfo')
@rpc.Version('2.0.0')
@rpc.Description('测试演示')
class UserInfo {
  @rpc.Method
  @rpc.Swagger.Summary('测试')
  test(@rpc.Req.PARAMETER(0) args: any, @rpc.Req.ID id: number) {
    console.log(args);
    return id;
  }
}
const dubbo = new Dubbo<COMPONENTS>({
  provider: {
    application: 'stib.test',
    dubbo_version: '2.0.2',
    port: 8080,
  },
  registry: {
    host: '192.168.2.150:2181'
  },
  swagger: 'stib'
});
dubbo.bind('userinfo', UserInfo);
dubbo.listen();

License

MIT

Copyright (c) 2019-present, yunjie (Evio) shen

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago