学习资源 获取用户数量,容器数量

This commit is contained in:
ire 2025-01-03 18:20:53 +08:00
parent 89db585254
commit a1b68f8617
5 changed files with 32 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.llm.controller.admin.learningresources;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -39,6 +40,9 @@ public class LearningResourcesController {
@Resource
private LearningResourcesService learningResourcesService;
@Resource
private AdminUserApi adminUserApi;
@PostMapping("/create")
@Operation(summary = "创建学习资源")
@PreAuthorize("@ss.hasPermission('llm:learning-resources:create')")
@ -100,4 +104,18 @@ public class LearningResourcesController {
BeanUtils.toBean(list, LearningResourcesRespVO.class));
}
}
@GetMapping("/getUserNumber")
@Operation(summary = "获得用户数量")
public CommonResult<Long> getNumber() {
Long aLong = adminUserApi.getUserNumber();
return success(aLong);
}
@GetMapping("/getContainerNumber")
@Operation(summary = "获得容器数量")
public CommonResult<Long> getContainerNumber() {
Long aLong = 5l;
return success(aLong);
}
}

View File

@ -86,4 +86,5 @@ public interface AdminUserApi {
*/
void validateUserList(Collection<Long> ids);
Long getUserNumber();
}

View File

@ -82,4 +82,9 @@ public class AdminUserApiImpl implements AdminUserApi {
userService.validateUserList(ids);
}
@Override
public Long getUserNumber() {
return userService.getUserNumber();
}
}

View File

@ -218,4 +218,5 @@ public interface AdminUserService {
*/
boolean isPasswordMatch(String rawPassword, String encodedPassword);
Long getUserNumber();
}

View File

@ -547,6 +547,12 @@ public class AdminUserServiceImpl implements AdminUserService {
return passwordEncoder.matches(rawPassword, encodedPassword);
}
@Override
public Long getUserNumber() {
Long aLong = userMapper.selectCount();
return aLong;
}
/**
* 对密码进行加密
*