mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-08 01:07:31 +00:00
feat: 调整知识库问答接入提示词模板
This commit is contained in:
@@ -46,4 +46,11 @@ public interface IPromptTemplateService {
|
||||
* 校验并批量删除提示词模板信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据分类查询提示词模板
|
||||
*
|
||||
* @param category 分类
|
||||
*/
|
||||
PromptTemplateVo queryByCategory(String category);
|
||||
}
|
||||
|
||||
@@ -109,4 +109,13 @@ public class PromptTemplateServiceImpl implements IPromptTemplateService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PromptTemplateVo queryByCategory(String category) {
|
||||
LambdaQueryWrapper<PromptTemplate> queryWrapper = Wrappers.lambdaQuery(PromptTemplate.class);
|
||||
queryWrapper.eq(PromptTemplate::getCategory, category);
|
||||
queryWrapper.orderByDesc(PromptTemplate::getUpdateTime);
|
||||
queryWrapper.last("limit 1");
|
||||
return baseMapper.selectVoOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user