修改数据返回结构
This commit is contained in:
@@ -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("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user