数据回流数据添加
This commit is contained in:
parent
bbf3681be6
commit
dc0839b155
@ -67,6 +67,7 @@ public class DataRefluxDataController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-reflux-data:query')")
|
||||
public CommonResult<DataRefluxDataRespVO> getDataRefluxData(@RequestParam("id") Long id) {
|
||||
//TODO 查看按钮后面没具体内容
|
||||
DataRefluxDataDO dataRefluxData = dataRefluxDataService.getDataRefluxData(id);
|
||||
return success(BeanUtils.toBean(dataRefluxData, DataRefluxDataRespVO.class));
|
||||
}
|
||||
@ -79,6 +80,16 @@ public class DataRefluxDataController {
|
||||
return success(BeanUtils.toBean(pageResult, DataRefluxDataRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/review-the-data")
|
||||
@Operation(summary = "数据回流配置保存数据")
|
||||
public void saveTheData(@RequestParam("id") DataRefluxDataReqVO pageReqVO){
|
||||
if (pageReqVO.getId() != null){
|
||||
pageReqVO.setIds(Collections.singletonList(pageReqVO.getId()));
|
||||
}
|
||||
//TODO 数据回流配置保存数据
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出数据回流 —— 数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('llm:data-reflux-data:export')")
|
||||
@ -92,4 +103,4 @@ public class DataRefluxDataController {
|
||||
BeanUtils.toBean(list, DataRefluxDataRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.llm.controller.admin.datarefluxdata.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 数据回流 —— 保存数据")
|
||||
@Data
|
||||
public class DataRefluxDataReqVO {
|
||||
@Schema(description = "配置ID",example = "16823")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "多个配置ID",example = "16823")
|
||||
private List<Long> ids;
|
||||
}
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.llm.service.datarefluxdata;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datarefluxconfig.vo.DataRefluxConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datarefluxconfig.DataRefluxConfigDO;
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.datarefluxconfig.DataRefluxConfigMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
@ -31,11 +33,19 @@ public class DataRefluxDataServiceImpl implements DataRefluxDataService {
|
||||
|
||||
@Resource
|
||||
private DataRefluxDataMapper dataRefluxDataMapper;
|
||||
@Resource
|
||||
private DataRefluxConfigMapper dataRefluxConfigMapper;
|
||||
|
||||
@Override
|
||||
public Long createDataRefluxData(DataRefluxDataSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DataRefluxDataDO dataRefluxData = BeanUtils.toBean(createReqVO, DataRefluxDataDO.class);
|
||||
LambdaQueryWrapper<DataRefluxConfigDO> eq = new LambdaQueryWrapper<DataRefluxConfigDO>()
|
||||
.eq(DataRefluxConfigDO::getModelServiceId, dataRefluxData.getModelServiceId())
|
||||
.eq(DataRefluxConfigDO::getModelType, dataRefluxData.getModelType())
|
||||
.like(DataRefluxConfigDO::getCreator, dataRefluxData.getCreator());
|
||||
List<DataRefluxConfigDO> dataRefluxConfigDOS = dataRefluxConfigMapper.selectList(eq);
|
||||
dataRefluxData.setConfigId(dataRefluxConfigDOS.get(0).getId());
|
||||
dataRefluxDataMapper.insert(dataRefluxData);
|
||||
// 返回
|
||||
return dataRefluxData.getId();
|
||||
|
Loading…
x
Reference in New Issue
Block a user