update xmlrootelement annotation
This commit is contained in:
parent
19c613f26b
commit
dce67fcc80
@ -164,7 +164,9 @@ public class SimpleHttpClient implements HttpClient {
|
|||||||
if (os != null) {
|
if (os != null) {
|
||||||
os.close();
|
os.close();
|
||||||
}
|
}
|
||||||
is.close();
|
if (is != null) {
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpResponse response = new HttpResponse();
|
HttpResponse response = new HttpResponse();
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.io.Serializable;
|
|||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class XmlResult implements Serializable {
|
public class XmlResult implements Serializable {
|
||||||
|
|
||||||
|
|||||||
@ -77,14 +77,16 @@ public final class XmlStream {
|
|||||||
Source source = new StreamSource(content);
|
Source source = new StreamSource(content);
|
||||||
XmlRootElement rootElement = clazz
|
XmlRootElement rootElement = clazz
|
||||||
.getAnnotation(XmlRootElement.class);
|
.getAnnotation(XmlRootElement.class);
|
||||||
if (rootElement == null) {
|
if (rootElement == null || rootElement.name().equals(
|
||||||
|
XmlRootElement.class.getMethod("name")
|
||||||
|
.getDefaultValue().toString())) {
|
||||||
JAXBElement<T> jaxbElement = unmarshaller.unmarshal(source,
|
JAXBElement<T> jaxbElement = unmarshaller.unmarshal(source,
|
||||||
clazz);
|
clazz);
|
||||||
return jaxbElement.getValue();
|
return jaxbElement.getValue();
|
||||||
} else {
|
} else {
|
||||||
return (T) unmarshaller.unmarshal(source);
|
return (T) unmarshaller.unmarshal(source);
|
||||||
}
|
}
|
||||||
} catch (JAXBException e) {
|
} catch (Exception e) {
|
||||||
throw new IllegalArgumentException(e);
|
throw new IllegalArgumentException(e);
|
||||||
} finally {
|
} finally {
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
@ -253,7 +255,10 @@ public final class XmlStream {
|
|||||||
try {
|
try {
|
||||||
XmlRootElement rootElement = clazz
|
XmlRootElement rootElement = clazz
|
||||||
.getAnnotation(XmlRootElement.class);
|
.getAnnotation(XmlRootElement.class);
|
||||||
if (rootElement == null) {
|
if (rootElement == null
|
||||||
|
|| rootElement.name().equals(
|
||||||
|
XmlRootElement.class.getMethod("name")
|
||||||
|
.getDefaultValue().toString())) {
|
||||||
marshaller.marshal(new JAXBElement<T>(new QName(
|
marshaller.marshal(new JAXBElement<T>(new QName(
|
||||||
ROOT_ELEMENT_XML), clazz, t), os);
|
ROOT_ELEMENT_XML), clazz, t), os);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class MediaApi extends MpApi {
|
|||||||
fileName)), new FormBodyPart("type",
|
fileName)), new FormBodyPart("type",
|
||||||
new StringBody(mediaType, Consts.UTF_8)));
|
new StringBody(mediaType, Consts.UTF_8)));
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
; // ignore
|
throw new WeixinException(e); // ignore
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String file_upload_uri = getRequestUri("file_upload_uri");
|
String file_upload_uri = getRequestUri("file_upload_uri");
|
||||||
@ -386,8 +386,8 @@ public class MediaApi extends MpApi {
|
|||||||
public MediaCounter countMaterialMedia() throws WeixinException {
|
public MediaCounter countMaterialMedia() throws WeixinException {
|
||||||
Token token = tokenHolder.getToken();
|
Token token = tokenHolder.getToken();
|
||||||
String material_media_count_uri = getRequestUri("material_media_count_uri");
|
String material_media_count_uri = getRequestUri("material_media_count_uri");
|
||||||
WeixinResponse response = weixinClient.get(String.format(material_media_count_uri,
|
WeixinResponse response = weixinClient.get(String.format(
|
||||||
token.getAccessToken()));
|
material_media_count_uri, token.getAccessToken()));
|
||||||
|
|
||||||
return response.getAsObject(new TypeReference<MediaCounter>() {
|
return response.getAsObject(new TypeReference<MediaCounter>() {
|
||||||
});
|
});
|
||||||
|
|||||||
@ -186,6 +186,11 @@ public class User implements Serializable {
|
|||||||
this.unionid = unionid;
|
this.unionid = unionid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return super.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof User) {
|
if (obj instanceof User) {
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment;
|
package com.foxinmy.weixin4j.mp.payment;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
|
||||||
@ -13,6 +16,8 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class JsPayNotify extends PayBaseInfo {
|
public class JsPayNotify extends PayBaseInfo {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4659030958445259803L;
|
private static final long serialVersionUID = -4659030958445259803L;
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.foxinmy.weixin4j.mp.payment;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -18,7 +20,8 @@ import com.foxinmy.weixin4j.util.RandomUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class MicroPayPackage extends PayPackage {
|
public class MicroPayPackage extends PayPackage {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8944928173669656177L;
|
private static final long serialVersionUID = 8944928173669656177L;
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.type.SignType;
|
import com.foxinmy.weixin4j.mp.type.SignType;
|
||||||
@ -16,6 +19,8 @@ import com.foxinmy.weixin4j.mp.type.SignType;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayBaseInfo implements Serializable {
|
public class PayBaseInfo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1843024880782466990L;
|
private static final long serialVersionUID = 1843024880782466990L;
|
||||||
|
|||||||
@ -3,7 +3,10 @@ package com.foxinmy.weixin4j.mp.payment;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.util.DateUtil;
|
import com.foxinmy.weixin4j.util.DateUtil;
|
||||||
@ -17,6 +20,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayPackage implements Serializable {
|
public class PayPackage implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3450161267802545790L;
|
private static final long serialVersionUID = 3450161267802545790L;
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment;
|
package com.foxinmy.weixin4j.mp.payment;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.util.DateUtil;
|
import com.foxinmy.weixin4j.util.DateUtil;
|
||||||
import com.foxinmy.weixin4j.util.RandomUtil;
|
import com.foxinmy.weixin4j.util.RandomUtil;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayRequest extends PayBaseInfo {
|
public class PayRequest extends PayBaseInfo {
|
||||||
|
|
||||||
private static final long serialVersionUID = -453746488398523883L;
|
private static final long serialVersionUID = -453746488398523883L;
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.coupon;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
||||||
@ -21,6 +24,8 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class CouponDetail extends ApiResult {
|
public class CouponDetail extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = -311265355895457070L;
|
private static final long serialVersionUID = -311265355895457070L;
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.coupon;
|
package com.foxinmy.weixin4j.mp.payment.coupon;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
||||||
@ -14,6 +17,8 @@ import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class CouponResult extends ApiResult {
|
public class CouponResult extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1996967923720149124L;
|
private static final long serialVersionUID = -1996967923720149124L;
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.coupon;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
||||||
@ -19,6 +22,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class CouponStock extends ApiResult {
|
public class CouponStock extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8627202879200080499L;
|
private static final long serialVersionUID = -8627202879200080499L;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.io.Serializable;
|
|||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.type.SignType;
|
import com.foxinmy.weixin4j.mp.type.SignType;
|
||||||
@ -19,6 +20,7 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ApiResult implements Serializable {
|
public class ApiResult implements Serializable {
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.v2;
|
|||||||
|
|
||||||
import java.beans.Transient;
|
import java.beans.Transient;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.model.WeixinMpAccount;
|
import com.foxinmy.weixin4j.mp.model.WeixinMpAccount;
|
||||||
import com.foxinmy.weixin4j.mp.payment.PayRequest;
|
import com.foxinmy.weixin4j.mp.payment.PayRequest;
|
||||||
@ -23,6 +27,8 @@ import com.foxinmy.weixin4j.util.MapUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class JsPayRequestV2 extends PayRequest {
|
public class JsPayRequestV2 extends PayRequest {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5972173459255255197L;
|
private static final long serialVersionUID = -5972173459255255197L;
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v2;
|
package com.foxinmy.weixin4j.mp.payment.v2;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.mp.payment.JsPayNotify;
|
import com.foxinmy.weixin4j.mp.payment.JsPayNotify;
|
||||||
|
|
||||||
@ -13,6 +16,8 @@ import com.foxinmy.weixin4j.mp.payment.JsPayNotify;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class NativePayNotifyV2 extends JsPayNotify {
|
public class NativePayNotifyV2 extends JsPayNotify {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1868431159301749988L;
|
private static final long serialVersionUID = 1868431159301749988L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v2;
|
package com.foxinmy.weixin4j.mp.payment.v2;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -14,7 +16,8 @@ import com.foxinmy.weixin4j.mp.model.WeixinMpAccount;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class NativePayResponseV2 extends JsPayRequestV2 {
|
public class NativePayResponseV2 extends JsPayRequestV2 {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6119895998783333012L;
|
private static final long serialVersionUID = 6119895998783333012L;
|
||||||
|
|||||||
@ -2,6 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.v2;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.type.CurrencyType;
|
import com.foxinmy.weixin4j.mp.type.CurrencyType;
|
||||||
import com.foxinmy.weixin4j.mp.type.TradeState;
|
import com.foxinmy.weixin4j.mp.type.TradeState;
|
||||||
@ -16,6 +20,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class Order extends ApiResult {
|
public class Order extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4543552984506609920L;
|
private static final long serialVersionUID = 4543552984506609920L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v2;
|
package com.foxinmy.weixin4j.mp.payment.v2;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -14,7 +16,8 @@ import com.foxinmy.weixin4j.mp.payment.PayBaseInfo;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayFeedback extends PayBaseInfo {
|
public class PayFeedback extends PayBaseInfo {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7230049346213966310L;
|
private static final long serialVersionUID = 7230049346213966310L;
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.v2;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.payment.PayPackage;
|
import com.foxinmy.weixin4j.mp.payment.PayPackage;
|
||||||
@ -17,6 +20,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayPackageV2 extends PayPackage {
|
public class PayPackageV2 extends PayPackage {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5557542103637795834L;
|
private static final long serialVersionUID = 5557542103637795834L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v2;
|
package com.foxinmy.weixin4j.mp.payment.v2;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -14,7 +16,8 @@ import com.foxinmy.weixin4j.mp.payment.PayBaseInfo;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayWarn extends PayBaseInfo {
|
public class PayWarn extends PayBaseInfo {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2334592957844332640L;
|
private static final long serialVersionUID = 2334592957844332640L;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.mp.payment.v2.RefundDetail
|
* @see com.foxinmy.weixin4j.mp.payment.v2.RefundDetail
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class RefundRecord extends ApiResult {
|
public class RefundRecord extends ApiResult {
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class RefundResult extends RefundDetail {
|
public class RefundResult extends RefundDetail {
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.foxinmy.weixin4j.mp.payment.v3;
|
|||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
||||||
@ -17,6 +18,7 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ApiResult extends XmlResult {
|
public class ApiResult extends XmlResult {
|
||||||
|
|
||||||
@ -121,8 +123,8 @@ public class ApiResult extends XmlResult {
|
|||||||
return recall;
|
return recall;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String setRecall() {
|
public void setRecall(String recall) {
|
||||||
return recall;
|
this.recall = recall;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(deserialize = false, serialize = false)
|
@JSONField(deserialize = false, serialize = false)
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.v3;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.mp.type.MPPaymentCheckNameType;
|
import com.foxinmy.weixin4j.mp.type.MPPaymentCheckNameType;
|
||||||
@ -17,6 +20,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class MPPayment implements Serializable {
|
public class MPPayment implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3734639674346425312L;
|
private static final long serialVersionUID = 3734639674346425312L;
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
|
||||||
@ -13,6 +16,8 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class MPPaymentResult extends ApiResult {
|
public class MPPaymentResult extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1110472826089211646L;
|
private static final long serialVersionUID = 1110472826089211646L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -12,7 +14,8 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class NativePayNotifyV3 extends ApiResult {
|
public class NativePayNotifyV3 extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4515471400239795492L;
|
private static final long serialVersionUID = 4515471400239795492L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
|
|
||||||
@ -18,7 +20,8 @@ import com.foxinmy.weixin4j.util.RandomUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class NativePayResponseV3 extends ApiResult {
|
public class NativePayResponseV3 extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6119895998783333012L;
|
private static final long serialVersionUID = 6119895998783333012L;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class Order extends ApiResult {
|
public class Order extends ApiResult {
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.foxinmy.weixin4j.mp.payment.v3;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -20,7 +22,8 @@ import com.foxinmy.weixin4j.util.RandomUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayPackageV3 extends PayPackage {
|
public class PayPackageV3 extends PayPackage {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8944928173669656177L;
|
private static final long serialVersionUID = 8944928173669656177L;
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.PayException;
|
import com.foxinmy.weixin4j.exception.PayException;
|
||||||
import com.foxinmy.weixin4j.mp.payment.PayRequest;
|
import com.foxinmy.weixin4j.mp.payment.PayRequest;
|
||||||
|
|
||||||
@ -20,6 +24,8 @@ import com.foxinmy.weixin4j.mp.payment.PayRequest;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.mp.payment.v3.PrePay
|
* @see com.foxinmy.weixin4j.mp.payment.v3.PrePay
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PayRequestV3 extends PayRequest {
|
public class PayRequestV3 extends PayRequest {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5972173459255255197L;
|
private static final long serialVersionUID = -5972173459255255197L;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@ -14,7 +16,8 @@ import com.foxinmy.weixin4j.mp.type.TradeType;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class PrePay extends ApiResult {
|
public class PrePay extends ApiResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8430005768959715444L;
|
private static final long serialVersionUID = -8430005768959715444L;
|
||||||
|
|||||||
@ -2,7 +2,10 @@ package com.foxinmy.weixin4j.mp.payment.v3;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.util.DateUtil;
|
import com.foxinmy.weixin4j.util.DateUtil;
|
||||||
@ -17,6 +20,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
|||||||
* @see <a
|
* @see <a
|
||||||
* href="http://pay.weixin.qq.com/wiki/doc/api/cash_coupon.php?chapter=13_1">红包简介</a>
|
* href="http://pay.weixin.qq.com/wiki/doc/api/cash_coupon.php?chapter=13_1">红包简介</a>
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class Redpacket implements Serializable {
|
public class Redpacket implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7021352305575714281L;
|
private static final long serialVersionUID = -7021352305575714281L;
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.mp.payment.v3;
|
package com.foxinmy.weixin4j.mp.payment.v3;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
||||||
@ -14,6 +17,8 @@ import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class RedpacketSendResult extends XmlResult {
|
public class RedpacketSendResult extends XmlResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5611847899634131711L;
|
private static final long serialVersionUID = 5611847899634131711L;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import com.foxinmy.weixin4j.mp.type.CurrencyType;
|
|||||||
* @date 2014年11月1日
|
* @date 2014年11月1日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class RefundRecord extends ApiResult {
|
public class RefundRecord extends ApiResult {
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "xml")
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class RefundResult extends RefundDetail {
|
public class RefundResult extends RefundDetail {
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,7 @@ public class MassTest extends TokenTest {
|
|||||||
public void previewMass() throws WeixinException {
|
public void previewMass() throws WeixinException {
|
||||||
JsonResult result = massApi.previewMassNews(
|
JsonResult result = massApi.previewMassNews(
|
||||||
"oyFLst1bqtuTcxK-ojF8hOGtLQao", new Text("test"));
|
"oyFLst1bqtuTcxK-ojF8hOGtLQao", new Text("test"));
|
||||||
Assert.assertEquals("0", result.getCode());
|
Assert.assertEquals(0, result.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -101,8 +101,9 @@ public class XmlstreamTest {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
// map2xml();
|
// map2xml();
|
||||||
// xml2map();
|
// xml2map();
|
||||||
// xml2order();
|
xml2order();
|
||||||
// xml2refundRecordV2();
|
// xml2refundRecordV2();
|
||||||
xml2refundRecordV3();
|
// xml2refundRecordV3();
|
||||||
|
// object2xmlWithoutRootElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user