去掉joor的依赖,并重构相关反射代码 for #58
This commit is contained in:
@@ -30,6 +30,7 @@ public class WxMpStoreServiceImplTest {
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public void testAdd() throws WxErrorException {
|
||||
this.wxMpService.getStoreService().add(WxMpStoreBaseInfo.builder().build());
|
||||
this.wxMpService.getStoreService()
|
||||
.add(WxMpStoreBaseInfo.builder().businessName("haha").branchName("abc")
|
||||
.province("aaa").district("aaa").telephone("122").address("abc").categories(new String[] { "美食,江浙菜" })
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package me.chanjar.weixin.mp.bean.pay;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.joor.Reflect;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
|
||||
@Test
|
||||
public class WxSendRedpackRequestTest {
|
||||
|
||||
public void test() throws NoSuchFieldException, SecurityException {
|
||||
|
||||
WxSendRedpackRequest request = new WxSendRedpackRequest();
|
||||
request.setMchBillno("123");
|
||||
request.setActName("ab");
|
||||
for (Entry<String, Reflect> entry : Reflect.on(request).fields().entrySet()) {
|
||||
Reflect reflect = entry.getValue();
|
||||
if (reflect.get() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Field field = WxSendRedpackRequest.class.getDeclaredField(entry.getKey());
|
||||
if (field.isAnnotationPresent(XStreamAlias.class)) {
|
||||
System.err.println(reflect.get() + " = " + field.getAnnotation(XStreamAlias.class).value());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user