Compare commits
2 Commits
59cd0049e2
...
3c21fc3500
Author | SHA1 | Date | |
---|---|---|---|
3c21fc3500 | |||
bd4ca454a3 |
@ -239,7 +239,7 @@ public class AiolRepoController extends JeecgController<AiolRepo, IAiolRepoServi
|
||||
|
||||
@GetMapping("repoList")
|
||||
@Operation(summary = "获取有权限的所有题库")
|
||||
public Result<List<AiolRepo>> repoList(HttpServletRequest request) {
|
||||
public Result<List<Map<String, Object>>> repoList(HttpServletRequest request) {
|
||||
// 尝试获取token,判断用户id
|
||||
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
if (token != null && !token.trim().isEmpty()) {
|
||||
@ -257,8 +257,15 @@ public class AiolRepoController extends JeecgController<AiolRepo, IAiolRepoServi
|
||||
return Result.error("该用户没有权限访问任意题库");
|
||||
}
|
||||
List<String> repoIds = list.stream().map(AiolEntityPermission::getEntityId).collect(Collectors.toList());
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<AiolRepo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("id", repoIds)
|
||||
.select("aiol_repo.*", "(SELECT realname FROM sys_user WHERE username = aiol_repo.create_by) as createByName");
|
||||
|
||||
// 根据ID列表查询题库
|
||||
return Result.ok(repoMapper.selectBatchIds(repoIds));
|
||||
List<Map<String, Object>> repoList = repoMapper.selectMaps(queryWrapper);
|
||||
return Result.OK(repoList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// token无效或解析失败,忽略错误,继续执行原有逻辑
|
||||
@ -269,6 +276,7 @@ public class AiolRepoController extends JeecgController<AiolRepo, IAiolRepoServi
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = "/courseAdd")
|
||||
@Operation(summary = "课程新建题库")
|
||||
@Transactional
|
||||
|
Loading…
x
Reference in New Issue
Block a user