Atitit ati licenseService    设计原理

Atitit ati licenseService    设计原理

 

 

C:workspaceAtiPlatfsrc_atibrowcomattilaxlicenseLicenseX.java

 

 

V1

更具时间超是

V2   按照时间慢的百分率..

 

V3 草案..

Laicense file ,hto sh aes time..

 

Invoke

System.out.println( licenseX.isCanUse_byUsePercent("2016-05-01") );

 

作者::  ★(attilax)>>>   绰号:老哇的爪子  全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊  汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://www.cnblogs.com/attilax/

 

 

 

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;

}

原文地址:https://www.cnblogs.com/attilax/p/5847596.html