|
@@ -1,9 +1,13 @@
|
|
|
package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateUnit;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.ucenter.common.ResultData;
|
|
|
import com.fdkankan.ucenter.common.utils.AuthLicenseUtil;
|
|
|
+import com.fdkankan.ucenter.util.DateUserUtil;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -28,7 +32,14 @@ public class AuthLicenseController {
|
|
|
|
|
|
@GetMapping("/getAuthInfo")
|
|
|
public ResultData getAuthInfo(){
|
|
|
- return ResultData.ok(AuthLicenseUtil.readLicense());
|
|
|
+ JSONObject jsonObject = AuthLicenseUtil.readLicense();
|
|
|
+ JSONObject licenseInfo = jsonObject.getJSONObject("licenseInfo");
|
|
|
+ JSONObject snInfo = licenseInfo.getJSONObject("snInfo");
|
|
|
+ String endDate = snInfo.getStr("endDate");
|
|
|
+ Date date = DateUserUtil.getDate(endDate);
|
|
|
+ Long days = DateUserUtil.between(date,new Date());
|
|
|
+ snInfo.set("expirationDays",days);
|
|
|
+ return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
}
|