From 6f5b42cc73cc4357b860d9ad66f7b6244b61db81 Mon Sep 17 00:00:00 2001 From: fengjunfeng Date: Thu, 27 Jan 2022 16:06:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/license/controller/LicenseController.java | 13 +++++++------ 1 file 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(""); } }