|
|
@@ -3,11 +3,13 @@ package com.uas.sso.controller;
|
|
|
import com.uas.account.exception.AccountException;
|
|
|
import com.uas.sso.core.Const;
|
|
|
import com.uas.sso.entity.*;
|
|
|
-import com.uas.sso.i.CountCallBack;
|
|
|
import com.uas.sso.service.ApplyUserSpaceService;
|
|
|
import com.uas.sso.service.UserService;
|
|
|
import com.uas.sso.service.UserspaceService;
|
|
|
+import com.uas.sso.util.encry.Md5Utils;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -38,6 +40,8 @@ public class UserManagerController extends BaseController {
|
|
|
@Autowired
|
|
|
private ApplyUserSpaceService applyUserSpaceService;
|
|
|
|
|
|
+ private static final Logger LOGGER = LoggerFactory.getLogger(UserManagerController.class);
|
|
|
+
|
|
|
/**
|
|
|
* 用户信息新增、修改
|
|
|
*
|
|
|
@@ -626,4 +630,31 @@ public class UserManagerController extends BaseController {
|
|
|
public ModelMap getMaxUUInLastWeek() {
|
|
|
return success(userService.getMaxUUInLastWeek());
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页获取用户信息
|
|
|
+ * @param pageNumber 当前页数
|
|
|
+ * @param pageSize 每页大小
|
|
|
+ * @param timestamp 时间戳,与当前时间不能相差10分钟
|
|
|
+ * @param encro 签名 md5(#{pageNumber}, #{pageSize}, #{timestamp}, ssoAccountSync),
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/paging/info")
|
|
|
+ public ModelMap getUserPaging(int pageNumber, int pageSize, long timestamp, String encro) {
|
|
|
+ // 验证时间
|
|
|
+ long current = System.currentTimeMillis();
|
|
|
+ if (Math.abs(current - timestamp) > 10 * 60 * 1000) {
|
|
|
+ LOGGER.warn("全量更新:分页获取用户信息请求过期,当前时间:{},请求时间:{}", current, timestamp);
|
|
|
+ return error("请求过期");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 验证签名
|
|
|
+ String laws = String.format("%s, %s, %s, %s", pageNumber, pageSize, timestamp, "ssoAccountSync");
|
|
|
+ String str = Md5Utils.encode(laws, null);
|
|
|
+ if (!str.equals(encro)) {
|
|
|
+ LOGGER.warn("全量更新:分页获取用户信息签名错误,明文:{},签名:{}", laws, encro);
|
|
|
+ return error("签名错误");
|
|
|
+ }
|
|
|
+ return success(userService.getUserInfo(pageNumber, pageSize));
|
|
|
+ }
|
|
|
}
|