license常量信息
This commit is contained in:
@@ -2,6 +2,7 @@ package com.sentinel.license.controller;
|
|||||||
|
|
||||||
import cn.hutool.log.Log;
|
import cn.hutool.log.Log;
|
||||||
import com.sentinel.license.bean.LicenseInfo;
|
import com.sentinel.license.bean.LicenseInfo;
|
||||||
|
import com.sentinel.license.utils.Constant;
|
||||||
import com.sentinel.license.utils.HaspUtil;
|
import com.sentinel.license.utils.HaspUtil;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -23,16 +24,16 @@ public class LicenseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/licenseOperation")
|
@PostMapping("/licenseOperation")
|
||||||
public Object licenseOperation(@RequestBody LicenseInfo licenseInfo) {
|
public Object licenseOperation(@RequestBody LicenseInfo licenseInfo) {
|
||||||
if (licenseInfo.getType() == 1){
|
if (licenseInfo.getType().equals(Constant.LICENSE_C2V)){
|
||||||
//获取C2V信息
|
//获取C2V信息
|
||||||
return HaspUtil.readC2V(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
return HaspUtil.readC2V(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
||||||
}else if (licenseInfo.getType() == 2){
|
}else if (licenseInfo.getType().equals(Constant.LICENSE_UPDATE)){
|
||||||
//上传license信息
|
//上传license信息
|
||||||
return HaspUtil.updateKeyWithLicense(licenseInfo.getV2C());
|
return HaspUtil.updateKeyWithLicense(licenseInfo.getV2C());
|
||||||
}else if (licenseInfo.getType() == 3){
|
}else if (licenseInfo.getType().equals(Constant.LICENSE_QUERY)){
|
||||||
//获取license信息
|
//获取license信息
|
||||||
return HaspUtil.getLicenseInfo(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
return HaspUtil.getLicenseInfo(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
||||||
}else if (licenseInfo.getType() == 4){
|
}else if (licenseInfo.getType().equals(Constant.LICENSE_VERIFY)){
|
||||||
//验证license信息
|
//验证license信息
|
||||||
return HaspUtil.verify(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
return HaspUtil.verify(licenseInfo.getVendorCode(),licenseInfo.getFeatureId());
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
22
src/main/java/com/sentinel/license/utils/Constant.java
Normal file
22
src/main/java/com/sentinel/license/utils/Constant.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.sentinel.license.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengjunfeng
|
||||||
|
* @date 2022/1/13
|
||||||
|
* @time 13:45
|
||||||
|
* @description
|
||||||
|
**/
|
||||||
|
public class Constant {
|
||||||
|
|
||||||
|
//获取c2v信息
|
||||||
|
public static final Integer LICENSE_C2V = 1;
|
||||||
|
|
||||||
|
//更新license信息
|
||||||
|
public static final Integer LICENSE_UPDATE = 2;
|
||||||
|
|
||||||
|
//查询license信息
|
||||||
|
public static final Integer LICENSE_QUERY = 3;
|
||||||
|
|
||||||
|
//验证授权信息
|
||||||
|
public static final Integer LICENSE_VERIFY = 4;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user