1.0.1 • Published 1 year ago

remote-invoke-vvv v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago
class HostDecor extends NetHubMethodDecorator<string> {
  collectMethodWithValue(value: string) {
    return function (config: HttpRequestConfig) {
      config.host = value;
      return config;
    };
  }
}

const Host: IDecoratorWithValue<MethodDecorator> = new HostDecor().regist();

@Service
class CDService {
  @Host("https://aaaa.com")
  @GET('/xxx/xxxx')
  aa(@QueryMap req: any): Promise<any[]> {
    throw new Error();
  }

  @POST('/xxx/xxxx')
  bb(@FieldMap f: any): Promise<boolean> {
    throw new Error();
  }
}

export default new NetHub()
  .setClient(createInstance(process.env.host, true))
  .create(CDService);
1.0.1

1 year ago

1.0.0

1 year ago