|
|
@ -15,11 +15,12 @@ import com.hnac.gglm.bigmodel.interactive.service.IHznlmInteractiveService; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.service.IResolveService; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.service.IResolveService; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.vo.AuthDataVO; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.vo.AuthDataVO; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.vo.ExtraVO; |
|
|
|
import com.hnac.gglm.bigmodel.interactive.vo.ExtraVO; |
|
|
|
|
|
|
|
import com.hnac.gglm.bigmodel.interactive.vo.SessionContentVO; |
|
|
|
|
|
|
|
import com.hnac.gglm.bigmodel.manager.SessionRedisManager; |
|
|
|
import groovy.util.logging.Slf4j; |
|
|
|
import groovy.util.logging.Slf4j; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.system.cache.ParamCache; |
|
|
|
import org.springblade.system.cache.ParamCache; |
|
|
|
import org.springblade.system.dto.DeptStationDTO; |
|
|
|
import org.springblade.system.dto.DeptStationDTO; |
|
|
@ -43,6 +44,7 @@ public class HznlmInteractiveServiceImpl implements IHznlmInteractiveService { |
|
|
|
|
|
|
|
|
|
|
|
private final AuthenticationService authenticationService; |
|
|
|
private final AuthenticationService authenticationService; |
|
|
|
private final IAuthClient authClient; |
|
|
|
private final IAuthClient authClient; |
|
|
|
|
|
|
|
private final SessionRedisManager sessionRedisManager; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<AuthDataVO> getAuthData(AuthDataDTO req) { |
|
|
|
public List<AuthDataVO> getAuthData(AuthDataDTO req) { |
|
|
@ -85,10 +87,15 @@ public class HznlmInteractiveServiceImpl implements IHznlmInteractiveService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> knowledgeAuth(AuthDataDTO req) { |
|
|
|
public Map<String, Object> knowledgeAuth(AuthDataDTO req) { |
|
|
|
String areaAuth = ParamCache.getValue(ParamKeyConstants.LIBRARY_AREA); |
|
|
|
|
|
|
|
String levelAuth = ParamCache.getValue(ParamKeyConstants.LIBRARY_AUTH_LEVEL); |
|
|
|
|
|
|
|
Map<String,Object> result = new HashMap<>(); |
|
|
|
Map<String,Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
SessionContentVO sessionContent = sessionRedisManager.getSessionContent(req.getSessionId()); |
|
|
|
|
|
|
|
if(Func.isNotEmpty(sessionContent) && Func.isNotEmpty(sessionContent.getAreaAuth())) { |
|
|
|
|
|
|
|
result.put("areaAuth", Func.toStrList(",",sessionContent.getAreaAuth())); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
String areaAuth = ParamCache.getValue(ParamKeyConstants.LIBRARY_AREA); |
|
|
|
result.put("areaAuth", Optional.ofNullable(areaAuth).map(auth -> Func.toStrList(",",auth)).orElse(Lists.newArrayList())); |
|
|
|
result.put("areaAuth", Optional.ofNullable(areaAuth).map(auth -> Func.toStrList(",",auth)).orElse(Lists.newArrayList())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String levelAuth = ParamCache.getValue(ParamKeyConstants.LIBRARY_AUTH_LEVEL); |
|
|
|
result.put("levelAuth",Optional.ofNullable(levelAuth).map(Integer::valueOf).orElse(0)); |
|
|
|
result.put("levelAuth",Optional.ofNullable(levelAuth).map(Integer::valueOf).orElse(0)); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|