diff --git a/pom.xml b/pom.xml
index 72ed65c..ee174ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,9 +6,10 @@
com.tsl3060.open.extend
tsl-open-sdk-java-wanshun
- 0.3.12
+ 0.3.13
+ UTF-8
8
8
@@ -18,6 +19,8 @@
1.4.7
+
+
@@ -77,6 +80,7 @@
+
org.apache.maven.plugins
@@ -111,6 +115,39 @@
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 3.1.0
+
+
+
+ run
+
+ generate-sources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/tsl3060/open/extend/core/ApiClient.java b/src/main/java/com/tsl3060/open/extend/core/ApiClient.java
index 4098ec6..10ca506 100644
--- a/src/main/java/com/tsl3060/open/extend/core/ApiClient.java
+++ b/src/main/java/com/tsl3060/open/extend/core/ApiClient.java
@@ -7,6 +7,7 @@ import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
+import com.tsl3060.open.extend.core.constant.BuildInfo;
import com.tsl3060.open.extend.core.exception.ApiException;
import com.tsl3060.open.extend.core.exception.BadResourceException;
import com.tsl3060.open.extend.core.notify.IAnswer;
@@ -24,7 +25,6 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
public class ApiClient {
-
private static final int ERROR_OK = 1000;
private static final int SUB_OK = 2000;
@@ -47,6 +47,11 @@ public class ApiClient {
private final Log log = LogFactory.get();
+ public ApiClient() {
+ //输出版本
+ log.debug("SDK VERSION : {}", BuildInfo.VERSION);
+ }
+
private SecureTool getSecureTool() {
if (secureTool == null) {
secureTool = new SecureTool(getConfig());
diff --git a/src/main/java/com/tsl3060/open/extend/core/constant/BuildInfo.java b/src/main/java/com/tsl3060/open/extend/core/constant/BuildInfo.java
new file mode 100644
index 0000000..2a0adb5
--- /dev/null
+++ b/src/main/java/com/tsl3060/open/extend/core/constant/BuildInfo.java
@@ -0,0 +1,5 @@
+package com.tsl3060.open.extend.core.constant;
+public final class BuildInfo {
+/** SDK Version */
+public static String VERSION="0.3.12";
+}
diff --git a/src/main/java/com/tsl3060/open/extend/core/notify/CarbonOrderNotify.java b/src/main/java/com/tsl3060/open/extend/core/notify/CarbonOrderNotify.java
index bdce7fa..7f3411d 100644
--- a/src/main/java/com/tsl3060/open/extend/core/notify/CarbonOrderNotify.java
+++ b/src/main/java/com/tsl3060/open/extend/core/notify/CarbonOrderNotify.java
@@ -3,6 +3,8 @@ package com.tsl3060.open.extend.core.notify;
import com.alibaba.fastjson2.annotation.JSONField;
public class CarbonOrderNotify {
+
+ private final double scale = 100.0;
/**
* 用户OpenID
*/
@@ -19,13 +21,13 @@ public class CarbonOrderNotify {
private String carbonNo;
/**
- * 用户低碳积分
+ * 用户低碳积分 单位(0.01g)
*/
@JSONField(name = "carbon")
private int carbon;
/**
- * 本次订单新增积分
+ * 本次订单新增积分 单位(0.01g)
*/
@JSONField(name = "amount")
private int amount;
@@ -68,11 +70,29 @@ public class CarbonOrderNotify {
this.carbonNo = carbonNo;
}
-
+ /**
+ * 获取用户的低碳值,单位(0.01g)
+ *
+ * @return
+ */
public int getCarbon() {
return carbon;
}
+ /**
+ * 获取用户的低碳值,单位(g)
+ *
+ * @return
+ */
+ public double getCarbonValue() {
+ return carbon / scale;
+ }
+
+ /**
+ * 设置用户的低碳值 ,单位 (0.01g)
+ *
+ * @param carbon
+ */
public void setCarbon(int carbon) {
this.carbon = carbon;
}
@@ -81,6 +101,10 @@ public class CarbonOrderNotify {
return amount;
}
+ public double getAmountValue() {
+ return amount / scale;
+ }
+
public void setAmount(int amount) {
this.amount = amount;
}