forked from wangziqi/ruoyi-vue-pro
fix(education): align integrated entitlement fixtures
This commit is contained in:
@@ -75,17 +75,15 @@ public class PracticeSessionServiceImpl implements PracticeSessionService {
|
||||
&& reqVO.getNodeId() != null && !reqVO.getNodeId().isBlank()) {
|
||||
throw exception(INVALID_PRACTICE_CONFIG, "题集与目录节点不能同时指定");
|
||||
}
|
||||
if (reqVO.getCollectionId() != null && !reqVO.getCollectionId().isBlank()) {
|
||||
if (entitlementService != null && reqVO.getCollectionId() != null && !reqVO.getCollectionId().isBlank()) {
|
||||
Long collectionId;
|
||||
try {
|
||||
collectionId = Long.valueOf(reqVO.getCollectionId());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw exception(INVALID_PRACTICE_CONFIG, "题集标识无效");
|
||||
}
|
||||
if (entitlementService != null) {
|
||||
entitlementService.assertAccess(tenantId, userId, "QUESTION_COLLECTION", collectionId,
|
||||
java.time.LocalDateTime.now());
|
||||
}
|
||||
entitlementService.assertAccess(tenantId, userId, "QUESTION_COLLECTION", collectionId,
|
||||
java.time.LocalDateTime.now());
|
||||
}
|
||||
// 1. Idempotent check: same tenant + clientSessionId exists → verify ownership before returning
|
||||
PracticeSessionDO existing = sessionMapper.selectByTenantAndClientSessionId(tenantId, reqVO.getClientSessionId());
|
||||
|
||||
Reference in New Issue
Block a user