Atitit ati licenseService 设计原理
C:\0workspace\AtiPlatf\src_atibrow\com\attilax\license\LicenseX.java
V1
更具时间超是
V2 按照时间慢的百分率..
V3 草案..
Laicense file ,hto sh aes time..
Invoke
System.out.println( licenseX.isCanUse_byUsePercent("2016-05-01") );
private int usePercent(String last_check_time) {
// String d="2016-09-01";
Date d= DateUtil.str2date(last_check_time, false);
if(new Date().getTime()<=d.getTime())
return 100;
int dayInterval = DateUtil.getDayInterval(d,new Date());
if(dayInterval>100)
return 0;
dayInterval=100-dayInterval;
return dayInterval ;
}
public boolean isCanUse_byUsePercent(String last_check_time) {
int use=usePercent(last_check_time);
int rdm= randomx.random(1, 100);
if(rdm<=use)
return true;
else
return false;
}