学习资源 获取用户数量,容器数量
This commit is contained in:
parent
89db585254
commit
a1b68f8617
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,4 +86,5 @@ public interface AdminUserApi {
|
||||
*/
|
||||
void validateUserList(Collection<Long> ids);
|
||||
|
||||
Long getUserNumber();
|
||||
}
|
||||
|
@ -82,4 +82,9 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
userService.validateUserList(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getUserNumber() {
|
||||
return userService.getUserNumber();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -218,4 +218,5 @@ public interface AdminUserService {
|
||||
*/
|
||||
boolean isPasswordMatch(String rawPassword, String encodedPassword);
|
||||
|
||||
Long getUserNumber();
|
||||
}
|
||||
|
@ -547,6 +547,12 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
return passwordEncoder.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getUserNumber() {
|
||||
Long aLong = userMapper.selectCount();
|
||||
return aLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密码进行加密
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user