summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfengjunfeng <[email protected]>2022-01-27 16:06:20 +0800
committerfengjunfeng <[email protected]>2022-01-27 16:06:20 +0800
commit6f5b42cc73cc4357b860d9ad66f7b6244b61db81 (patch)
treed68449b0513ce0af3684675bd3de11a4604fafc8 /src
parent5bf71b65b368fad28fcd5e0be2069899482b4a9d (diff)
修改数据返回结构develop_22.02
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/license/controller/LicenseController.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/com/license/controller/LicenseController.java b/src/main/java/com/license/controller/LicenseController.java
index 24c9cd8..e30b2d3 100644
--- a/src/main/java/com/license/controller/LicenseController.java
+++ b/src/main/java/com/license/controller/LicenseController.java
@@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
import cn.hutool.log.Log;
import com.license.bean.LicenseInfo;
+import com.license.bean.Rets;
import com.license.cache.CacheManager;
import com.license.utils.Constant;
import com.license.utils.GetIpProtUtil;
@@ -42,23 +43,23 @@ public class LicenseController {
@PostMapping("/licenseOperation")
public Object licenseOperation(@RequestBody LicenseInfo licenseInfo) {
if (!verify(licenseInfo.getServerId())){
- return null;
+ return Rets.failure("");
}
if (licenseInfo.getType().equals(Constant.LICENSE_C2V)){
//获取C2V信息
- return HaspUtil.readC2V(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
+ return Rets.success(HaspUtil.readC2V(licenseInfo.getVendorCode(),licenseInfo.getFeatureId()));
}else if (licenseInfo.getType().equals(Constant.LICENSE_UPDATE)){
//上传license信息
- return HaspUtil.updateKeyWithLicense(licenseInfo.getV2C());
+ return Rets.success(HaspUtil.updateKeyWithLicense(licenseInfo.getV2C()));
}else if (licenseInfo.getType().equals(Constant.LICENSE_QUERY)){
//获取license信息
- return HaspUtil.getLicenseInfo(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
+ return Rets.success(HaspUtil.getLicenseInfo(licenseInfo.getVendorCode(),licenseInfo.getFeatureId()));
}else if (licenseInfo.getType().equals(Constant.LICENSE_VERIFY)){
//验证license信息
- return HaspUtil.verify(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
+ return Rets.success(HaspUtil.verify(licenseInfo.getVendorCode(),licenseInfo.getFeatureId()));
}else {
log.info("type error");
- return null;
+ return Rets.failure("");
}
}