Commit cce1a3d5 by qiuweili123

增加zk依赖;util类曾加BizResponse对象处理

parent 2dba5c90
...@@ -23,6 +23,7 @@ public class BeanUtil extends BeanUtils { ...@@ -23,6 +23,7 @@ public class BeanUtil extends BeanUtils {
return ArrayUtils.contains(arr, obj); return ArrayUtils.contains(arr, obj);
} }
public static <T> Object getFieldValueByName(T obj, String fieldName) throws Exception { public static <T> Object getFieldValueByName(T obj, String fieldName) throws Exception {
Class clazz = obj.getClass(); Class clazz = obj.getClass();
Field field = clazz.getDeclaredField(fieldName); Field field = clazz.getDeclaredField(fieldName);
......
...@@ -5,8 +5,9 @@ import java.util.Map; ...@@ -5,8 +5,9 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
* Created by liumingming on 2018/6/13. * 推荐使用CollectionUtil相关方法
*/ */
@Deprecated
public class ObjectUtils { public class ObjectUtils {
/** /**
......
package com.secoo.mall.common.util.response; package com.secoo.mall.common.util.response;
import com.secoo.mall.common.constant.CommonConstant; import com.secoo.mall.common.constant.CommonConstant;
import com.secoo.mall.common.core.bean.BizResponse;
import com.secoo.mall.common.core.bean.Response; import com.secoo.mall.common.core.bean.Response;
import com.secoo.mall.common.core.exception.BusinessException; import com.secoo.mall.common.core.exception.BusinessException;
...@@ -21,4 +22,16 @@ public interface ResponseUtil { ...@@ -21,4 +22,16 @@ public interface ResponseUtil {
return response; return response;
} }
/**
* 业务BizResponse处理
*
* @param data
* @param <T>
* @return
*/
static <T> BizResponse getSuccessBizResponse(T data) {
BizResponse response = new BizResponse(CommonConstant.Success.CODE, CommonConstant.Success.MSG);
response.setData(data);
return response;
}
} }
...@@ -210,6 +210,23 @@ ...@@ -210,6 +210,23 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!--zookeeper-->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--rocketmq--> <!--rocketmq-->
<dependency> <dependency>
<groupId>org.apache.rocketmq</groupId> <groupId>org.apache.rocketmq</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment