[update] 获得容器数量
This commit is contained in:
parent
fc56bbc6ed
commit
310b20b872
@ -114,8 +114,7 @@ public class LearningResourcesController {
|
||||
@GetMapping("/getContainerNumber")
|
||||
@Operation(summary = "获得容器数量")
|
||||
public CommonResult<Long> getContainerNumber() {
|
||||
Long aLong = 5l;
|
||||
return success(aLong);
|
||||
return success(learningResourcesService.getContainerNumber());
|
||||
}
|
||||
|
||||
@PutMapping("/videoViewsUpdate")
|
||||
|
@ -56,4 +56,10 @@ public interface BaseModelService {
|
||||
|
||||
BaseModelDO getByAigcId(Long id);
|
||||
|
||||
/**
|
||||
* 获取模型管理数量
|
||||
*
|
||||
* @return 模型管理数量
|
||||
*/
|
||||
Long getCount ();
|
||||
}
|
||||
|
@ -86,4 +86,14 @@ public class BaseModelServiceImpl implements BaseModelService {
|
||||
return baseModelMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型管理数量
|
||||
*
|
||||
* @return 模型管理数量
|
||||
*/
|
||||
@Override
|
||||
public Long getCount () {
|
||||
return baseModelMapper.selectCount(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package cn.iocoder.yudao.module.llm.service.learningresources;
|
||||
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.learningresources.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.learningresources.LearningResourcesDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.learningresources.vo.LearningResourcesPageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.learningresources.vo.LearningResourcesSaveReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.learningresources.LearningResourcesDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 学习资源 Service 接口
|
||||
@ -21,21 +20,21 @@ public interface LearningResourcesService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createLearningResources(@Valid LearningResourcesSaveReqVO createReqVO);
|
||||
Long createLearningResources (@Valid LearningResourcesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新学习资源
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateLearningResources(@Valid LearningResourcesSaveReqVO updateReqVO);
|
||||
void updateLearningResources (@Valid LearningResourcesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除学习资源
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteLearningResources(Long id);
|
||||
void deleteLearningResources (Long id);
|
||||
|
||||
/**
|
||||
* 获得学习资源
|
||||
@ -43,7 +42,7 @@ public interface LearningResourcesService {
|
||||
* @param id 编号
|
||||
* @return 学习资源
|
||||
*/
|
||||
LearningResourcesDO getLearningResources(Long id);
|
||||
LearningResourcesDO getLearningResources (Long id);
|
||||
|
||||
/**
|
||||
* 获得学习资源分页
|
||||
@ -51,14 +50,22 @@ public interface LearningResourcesService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 学习资源分页
|
||||
*/
|
||||
PageResult<LearningResourcesDO> getLearningResourcesPage(LearningResourcesPageReqVO pageReqVO);
|
||||
PageResult<LearningResourcesDO> getLearningResourcesPage (LearningResourcesPageReqVO pageReqVO);
|
||||
|
||||
String downLearningResources(Long id);
|
||||
String downLearningResources (Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 视频查看量更新
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void videoViewsUpdate (@Valid LearningResourcesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 获得容器数量
|
||||
*
|
||||
* @return 容器数量
|
||||
*/
|
||||
Long getContainerNumber ();
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.llm.service.learningresources;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.service.basemodel.BaseModelService;
|
||||
import cn.iocoder.yudao.module.llm.service.modelservice.ModelServiceService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@ -32,6 +34,12 @@ public class LearningResourcesServiceImpl implements LearningResourcesService {
|
||||
@Resource
|
||||
private LearningResourcesMapper learningResourcesMapper;
|
||||
|
||||
@Resource
|
||||
private BaseModelService baseModelService;
|
||||
|
||||
@Resource
|
||||
private ModelServiceService modelServiceService;
|
||||
|
||||
@Override
|
||||
public Long createLearningResources(LearningResourcesSaveReqVO createReqVO) {
|
||||
validateLearningResourcesNameExists(createReqVO);
|
||||
@ -118,4 +126,21 @@ public class LearningResourcesServiceImpl implements LearningResourcesService {
|
||||
.setSql("down_count = down_count + 1")
|
||||
.eq("id", id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得容器数量
|
||||
* <p>
|
||||
* 容器数量 = 模型服务管理 + 模型管理
|
||||
* </p>
|
||||
* @return 容器数量
|
||||
*/
|
||||
@Override
|
||||
public Long getContainerNumber () {
|
||||
// 获取模型服务的数量
|
||||
Long modelServiceCount = modelServiceService.getCount();
|
||||
// 获取基础模型服务的数量
|
||||
Long baseModelServiceCount = baseModelService.getCount();
|
||||
// 计算容器的总数量
|
||||
return modelServiceCount + baseModelServiceCount;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
package cn.iocoder.yudao.module.llm.service.modelservice;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelservice.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.application.ApplicationDO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.modelservice.ModelServiceDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelservice.vo.ModelServicePageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelservice.vo.ModelServiceRespVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelservice.vo.ModelServiceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.modelservice.ModelServiceDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模型服务 Service 接口
|
||||
@ -21,21 +22,21 @@ public interface ModelServiceService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createModelService(@Valid ModelServiceSaveReqVO createReqVO);
|
||||
Long createModelService (@Valid ModelServiceSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新模型服务
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateModelService(@Valid ModelServiceSaveReqVO updateReqVO);
|
||||
void updateModelService (@Valid ModelServiceSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除模型服务
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteModelService(Long id);
|
||||
void deleteModelService (Long id);
|
||||
|
||||
/**
|
||||
* 获得模型服务
|
||||
@ -43,7 +44,7 @@ public interface ModelServiceService {
|
||||
* @param id 编号
|
||||
* @return 模型服务
|
||||
*/
|
||||
ModelServiceDO getModelService(Long id);
|
||||
ModelServiceDO getModelService (Long id);
|
||||
|
||||
/**
|
||||
* 获得模型服务分页
|
||||
@ -51,21 +52,29 @@ public interface ModelServiceService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 模型服务分页
|
||||
*/
|
||||
PageResult<ModelServiceDO> getModelServicePage(ModelServicePageReqVO pageReqVO);
|
||||
PageResult<ModelServiceDO> getModelServicePage (ModelServicePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 查询所有模型服务
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ModelServiceDO> getModelServiceList();
|
||||
List<ModelServiceDO> getModelServiceList ();
|
||||
|
||||
void active(ModelServiceSaveReqVO updateReqVO);
|
||||
void active (ModelServiceSaveReqVO updateReqVO);
|
||||
|
||||
void unactive(ModelServiceSaveReqVO updateReqVO);
|
||||
void unactive (ModelServiceSaveReqVO updateReqVO);
|
||||
|
||||
PageResult<ModelServiceRespVO> getModelServicePage1(ModelServicePageReqVO pageReqVO);
|
||||
PageResult<ModelServiceRespVO> getModelServicePage1 (ModelServicePageReqVO pageReqVO);
|
||||
|
||||
ModelServiceDO getByApiKey(String apiKey);
|
||||
ModelServiceDO getByApiKey (String apiKey);
|
||||
|
||||
List<String> getDownLoadList(Long id);
|
||||
List<String> getDownLoadList (Long id);
|
||||
|
||||
/**
|
||||
* 获取模型服务管理数量
|
||||
*
|
||||
* @return 模型服务管理数量
|
||||
*/
|
||||
Long getCount ();
|
||||
}
|
||||
|
@ -202,4 +202,14 @@ public class ModelServiceServiceImpl implements ModelServiceService {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型服务管理数量
|
||||
*
|
||||
* @return 模型服务管理数量
|
||||
*/
|
||||
@Override
|
||||
public Long getCount () {
|
||||
return modelServiceMapper.selectCount(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user