This commit is contained in:
Redkale
2017-03-17 18:04:17 +08:00
parent 3531d0963d
commit 4958b454af
2 changed files with 3 additions and 6 deletions

View File

@@ -5,7 +5,6 @@
*/
package org.redkale.convert;
import java.io.Serializable;
import org.redkale.util.Creator;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@@ -13,7 +12,6 @@ import java.util.Map;
/**
* Map的反序列化操作类 <br>
* key、value的类型如果是Serializable 会自动转换成String
*
* <p>
* 详情见: https://redkale.org
@@ -50,8 +48,8 @@ public final class MapDecoder<K, V> implements Decodeable<Reader, Map<K, V>> {
this.valueType = pt.getActualTypeArguments()[1];
this.creator = factory.loadCreator((Class) pt.getRawType());
factory.register(type, this);
this.keyDecoder = factory.loadDecoder(this.keyType == Serializable.class ? String.class : this.keyType);
this.valueDecoder = factory.loadDecoder(this.valueType == Serializable.class ? String.class : this.valueType);
this.keyDecoder = factory.loadDecoder(this.keyType);
this.valueDecoder = factory.loadDecoder(this.valueType);
} else {
throw new ConvertException("mapdecoder not support the type (" + type + ")");
}

View File

@@ -1,6 +1,5 @@
package org.redkale.test.rest;
import java.io.Serializable;
import java.util.*;
import javax.annotation.Resource;
import org.redkale.net.http.*;
@@ -73,7 +72,7 @@ public class HelloService implements Service {
//查询List列表
@RestMapping(name = "listmap")
public List<HelloEntity> queryHello(HelloBean bean, @RestParam(name = "map") Map<String, Serializable> map) { //通过 /pipes/hello/list?bean={...} 查询List列表
public List<HelloEntity> queryHello(HelloBean bean, @RestParam(name = "map") Map<String, String> map) { //通过 /pipes/hello/list?bean={...} 查询List列表
System.out.println("map参数: " + map);
if (source != null) return source.queryList(HelloEntity.class, bean);
return null;