|
@@ -3,10 +3,15 @@ package com.qmth.teachcloud.report.auth;
|
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
|
import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
|
+import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
+import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.entity.TBSession;
|
|
|
+import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.StringJoiner;
|
|
|
|
|
|
public class TeachcloudReportSession implements AccessEntity {
|
|
|
|
|
@@ -52,4 +57,23 @@ public class TeachcloudReportSession implements AccessEntity {
|
|
|
public void setSignatureType(SignatureType signatureType) {
|
|
|
this.signatureType = signatureType;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getLogName() {
|
|
|
+ RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
|
+ TBSession tbSession = (TBSession) redisUtil.getUserSession(identity);
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("_");
|
|
|
+ if (Objects.nonNull(tbSession)) {
|
|
|
+ CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
|
|
|
+ if (Objects.nonNull(tbSession.getSchoolId())) {
|
|
|
+ BasicSchool basicSchool = commonCacheService.schoolCache(tbSession.getSchoolId());
|
|
|
+ stringJoiner.add("{" + basicSchool.getId() + "}").add("{" + basicSchool.getName() + "}");
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(tbSession.getIdentity())) {
|
|
|
+ SysUser sysUser = commonCacheService.userCache(Long.parseLong(tbSession.getIdentity()));
|
|
|
+ stringJoiner.add("{" + sysUser.getLoginName() + "}").add("{" + tbSession.getType() + "}");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return stringJoiner.toString();
|
|
|
+ }
|
|
|
}
|