fanliang11 / surging

Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
MIT License
3.24k stars 924 forks source link

服务接口入参能否支持数组 #131

Open jakcm opened 6 years ago

jakcm commented 6 years ago

服务接口定义: Task Approve(System.Collections.Generic.List< int > idList)

运行时报错: exception = {System.TypeLoadException: GenericArguments[0], 'Newtonsoft.Json.Linq.JContainer', on 'MessagePack.Formatters.NonGenericListFormatter`1[T]' violates the constraint of type parameter 'T'. at MessagePack.FormatterResolverExtensions.GetFormatterWithVerify[...

fanliang11 commented 6 years ago

可以传递集合,你把传递的参数发出来

jakcm commented 6 years ago

是前端JS传入数组,直接调用网关: $.ajax({ type: "POST", contentType : "application/json", url: 'http://xxx/api/Project/Approve', data: { idList: [1,2] });

fanliang11 commented 6 years ago

现在比较忙,查看后稍后回复你

fanliang11 commented 6 years ago

BUG已经修复