refactor(llm): 优化模型部署和删除的代码逻辑
- 修改模型部署接口的请求参数格式,使用 Map 封装模型名称 - 修改模型删除接口的请求参数格式,使用 Map 封装部署 ID - 优化代码结构,提高可读性和可维护性
This commit is contained in:
parent
031135c5ca
commit
16338b56d6
@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -95,7 +96,9 @@ public class BaseModelServiceImpl implements BaseModelService {
|
||||
// 校验存在
|
||||
String moder = updateReqVO.getModelName();
|
||||
try {
|
||||
String resStr = HttpUtils.post(llmBackendProperties.getDeployModel(), null, JSON.toJSONString(moder));
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("model",moder);
|
||||
String resStr = HttpUtils.post(llmBackendProperties.getDeployModel(), null,JSON.toJSONString(map));
|
||||
validateBaseModelExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BaseModelDO updateObj = BeanUtils.toBean(updateReqVO, BaseModelDO.class);
|
||||
@ -169,6 +172,8 @@ public class BaseModelServiceImpl implements BaseModelService {
|
||||
try {
|
||||
BaseModelDO baseModelDO = baseModelMapper.selectById(updateReqVO.getId());
|
||||
Long deploy_id = baseModelDO.getModelId();
|
||||
Map<String,Long> map = new HashMap<>();
|
||||
map.put("deploy_id",deploy_id);
|
||||
String resStr = HttpUtils.post(llmBackendProperties.getDeleteModel(), null, JSON.toJSONString(deploy_id));
|
||||
// 禁用模型
|
||||
updateReqVO.setIsActive(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user