Revert "按钮管理发送内容修改未textarea 并增加高度,新增修改详情同理,回答框增加高度,"
This reverts commit 88a16388.
正在显示
7 个修改的文件
包含
21 行增加
和
15 行删除
| @@ -137,9 +137,11 @@ public class AiragLogController extends JeecgController<AiragLog, IAiragLogServi | @@ -137,9 +137,11 @@ public class AiragLogController extends JeecgController<AiragLog, IAiragLogServi | ||
| 137 | public Result<String> saveToQuestionLibrary(@RequestBody AiragLog airagLog) { | 137 | public Result<String> saveToQuestionLibrary(@RequestBody AiragLog airagLog) { |
| 138 | QuestionEmbedding questionEmbedding = new QuestionEmbedding(); | 138 | QuestionEmbedding questionEmbedding = new QuestionEmbedding(); |
| 139 | questionEmbedding.setQuestion(airagLog.getQuestion()); | 139 | questionEmbedding.setQuestion(airagLog.getQuestion()); |
| 140 | - int questionCount = questionEmbeddingService.findQuestionCount(questionEmbedding); | ||
| 141 | - if(questionCount > 0){ | ||
| 142 | - return Result.error("重复问题不能存入"); | 140 | + List<QuestionEmbedding> list = questionEmbeddingService.findQuestion(questionEmbedding); |
| 141 | + for (QuestionEmbedding questionEmbedding1 : list){ | ||
| 142 | + if(questionEmbedding1.getQuestion().equals(airagLog.getQuestion())){ | ||
| 143 | + return Result.error("问题库已有相同问题,不可存入"); | ||
| 144 | + } | ||
| 143 | } | 145 | } |
| 144 | airagLog.setIsStorage(1); | 146 | airagLog.setIsStorage(1); |
| 145 | airagLogService.saveToQuestionLibrary(airagLog); | 147 | airagLogService.saveToQuestionLibrary(airagLog); |
| @@ -115,9 +115,9 @@ public class QuestionEmbeddingMapper { | @@ -115,9 +115,9 @@ public class QuestionEmbeddingMapper { | ||
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | // 查询所有记录 | 117 | // 查询所有记录 |
| 118 | - public Integer findQuestionCount(QuestionEmbedding questionEmbedding) { | ||
| 119 | - | ||
| 120 | - StringBuilder sql = new StringBuilder("select COUNT(1) AS total_count from question_embedding where 1 = 1"); | 118 | + public List<QuestionEmbedding> findQuestion(QuestionEmbedding questionEmbedding) { |
| 119 | + List<QuestionEmbedding> results = new ArrayList<>(); | ||
| 120 | + StringBuilder sql = new StringBuilder("select * from question_embedding where 1 = 1"); | ||
| 121 | List<Object> params = new ArrayList<>(); | 121 | List<Object> params = new ArrayList<>(); |
| 122 | 122 | ||
| 123 | if(StringUtils.isNotBlank(questionEmbedding.getQuestion())){ | 123 | if(StringUtils.isNotBlank(questionEmbedding.getQuestion())){ |
| @@ -135,15 +135,16 @@ public class QuestionEmbeddingMapper { | @@ -135,15 +135,16 @@ public class QuestionEmbeddingMapper { | ||
| 135 | 135 | ||
| 136 | try (ResultSet rs = stmt.executeQuery()) { | 136 | try (ResultSet rs = stmt.executeQuery()) { |
| 137 | while (rs.next()) { | 137 | while (rs.next()) { |
| 138 | - return rs.getInt("total_count"); | 138 | + results.add(mapRowToQuestionEmbedding(rs)); |
| 139 | } | 139 | } |
| 140 | - return 0; | ||
| 141 | } | 140 | } |
| 142 | } catch (SQLException e) { | 141 | } catch (SQLException e) { |
| 143 | log.error("查询所有记录失败", e); | 142 | log.error("查询所有记录失败", e); |
| 144 | throw new RuntimeException("查询数据时发生数据库错误", e); | 143 | throw new RuntimeException("查询数据时发生数据库错误", e); |
| 145 | } | 144 | } |
| 146 | 145 | ||
| 146 | + | ||
| 147 | + return results; | ||
| 147 | } | 148 | } |
| 148 | 149 | ||
| 149 | // 根据ID查询单个记录 | 150 | // 根据ID查询单个记录 |
| @@ -30,7 +30,10 @@ | @@ -30,7 +30,10 @@ | ||
| 30 | <if test="param1.createTime_begin != '' and param1.createTime_begin != null and param1.createTime_end != null and param1.createTime_end != null"> | 30 | <if test="param1.createTime_begin != '' and param1.createTime_begin != null and param1.createTime_end != null and param1.createTime_end != null"> |
| 31 | and create_time between #{param1.createTime_begin} and #{param1.createTime_end} | 31 | and create_time between #{param1.createTime_begin} and #{param1.createTime_end} |
| 32 | </if> | 32 | </if> |
| 33 | - ORDER BY create_time DESC | 33 | + |
| 34 | + | ||
| 35 | + | ||
| 36 | + | ||
| 34 | </select> | 37 | </select> |
| 35 | 38 | ||
| 36 | <update id="updataIsStorage"> | 39 | <update id="updataIsStorage"> |
| @@ -9,7 +9,7 @@ import java.util.List; | @@ -9,7 +9,7 @@ import java.util.List; | ||
| 9 | 9 | ||
| 10 | public interface IQuestionEmbeddingService { | 10 | public interface IQuestionEmbeddingService { |
| 11 | Page<QuestionEmbedding> findAll(QuestionEmbedding questionEmbedding, Integer pageNo, Integer pageSize); | 11 | Page<QuestionEmbedding> findAll(QuestionEmbedding questionEmbedding, Integer pageNo, Integer pageSize); |
| 12 | - Integer findQuestionCount(QuestionEmbedding questionEmbedding); | 12 | + List<QuestionEmbedding> findQuestion(QuestionEmbedding questionEmbedding); |
| 13 | QuestionEmbedding findById(String id); | 13 | QuestionEmbedding findById(String id); |
| 14 | int insert(QuestionEmbedding record); | 14 | int insert(QuestionEmbedding record); |
| 15 | int update(QuestionEmbedding record); | 15 | int update(QuestionEmbedding record); |
| @@ -70,8 +70,8 @@ public class QuestionEmbeddingServiceImpl implements IQuestionEmbeddingService { | @@ -70,8 +70,8 @@ public class QuestionEmbeddingServiceImpl implements IQuestionEmbeddingService { | ||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | @Override | 72 | @Override |
| 73 | - public Integer findQuestionCount(QuestionEmbedding questionEmbedding) { | ||
| 74 | - return questionEmbeddingMapper.findQuestionCount(questionEmbedding); | 73 | + public List<QuestionEmbedding> findQuestion(QuestionEmbedding questionEmbedding) { |
| 74 | + return questionEmbeddingMapper.findQuestion(questionEmbedding); | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | @Override | 77 | @Override |
| @@ -52,9 +52,9 @@ spring: | @@ -52,9 +52,9 @@ spring: | ||
| 52 | datasource: | 52 | datasource: |
| 53 | master: | 53 | master: |
| 54 | ## !!!!!MYSQL | 54 | ## !!!!!MYSQL |
| 55 | - url: jdbc:mysql://localhost:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai | 55 | + url: jdbc:mysql://localhost:3306/jeecg-boot-dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai |
| 56 | username: root | 56 | username: root |
| 57 | - password: root | 57 | + password: 123456 |
| 58 | driver-class-name: com.mysql.cj.jdbc.Driver | 58 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 59 | redis: | 59 | redis: |
| 60 | database: 0 | 60 | database: 0 |
| @@ -154,7 +154,7 @@ spring: | @@ -154,7 +154,7 @@ spring: | ||
| 154 | master: | 154 | master: |
| 155 | url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai | 155 | url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai |
| 156 | username: root | 156 | username: root |
| 157 | - password: root | 157 | + password: 1234 |
| 158 | driver-class-name: com.mysql.cj.jdbc.Driver | 158 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 159 | # 多数据源配置 | 159 | # 多数据源配置 |
| 160 | # pgvector: | 160 | # pgvector: |
-
请 注册 或 登录 后发表评论