Преглед на файлове

开发智能对话记录功能提交

zsy преди 1 година
родител
ревизия
716149a326

+ 1 - 1
src/main/java/com/rf/kjb/chat/rest/ChatController.java

@@ -484,7 +484,7 @@ public class ChatController extends BaseController {
         return fail(ErrorCode.FAILED);
     }
 
-    private static void deleteDirectoryStream(Path path) {
+    public static void deleteDirectoryStream(Path path) {
         try {
             Files.delete(path);
         } catch (IOException e) {

+ 35 - 0
src/main/java/com/rf/kjb/intelligentDialogue/dao/domain/IntelligentDialogueEntity.java

@@ -0,0 +1,35 @@
+package com.rf.kjb.intelligentDialogue.dao.domain;
+
+import com.rf.kjb.base.model.BaseEntry;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @Author:zzf
+ * @Date:2023/9/14:15:19
+ * @Description:
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_intelligent_dialogue")
+@org.hibernate.annotations.Table(appliesTo = "t_intelligent_dialogue", comment = "智能对话记录表")
+public class IntelligentDialogueEntity extends BaseEntry {
+    @Column(name = "user_name",columnDefinition = "varchar(50) not null comment '用户名'")
+    private String userName;
+
+    @Column(name = "identifier" ,columnDefinition = "varchar(20) not null  comment '用户编号'")
+    private String identifier;
+
+    @Column(name = "label",columnDefinition = "varchar(2) not null comment '对话分类:0-问;1-答'")
+    private String label;
+
+    @Column(name = "content",columnDefinition = "varchar(500) not null comment '对话内容'")
+    private String content;
+}

+ 31 - 0
src/main/java/com/rf/kjb/intelligentDialogue/dao/repository/IntelligentDialogueRepository.java

@@ -0,0 +1,31 @@
+package com.rf.kjb.intelligentDialogue.dao.repository;
+
+import com.rf.kjb.base.repository.BaseRepository;
+import com.rf.kjb.intelligentDialogue.dao.domain.IntelligentDialogueEntity;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface IntelligentDialogueRepository extends BaseRepository<IntelligentDialogueEntity,String> {
+
+    /*@Query(value = "SELECT t1.* FROM t_chat_record t1 INNER JOIN (SELECT MAX(create_time) AS create_time FROM t_chat_record GROUP BY identifier ) t2 ON t1.create_time = t2.create_time " +
+            "where 1=1 and ( if(:searchKey is not null and :searchKey!='',t1.identifier like CONCAT('%',:searchKey,'%')  ,1=1) " +
+            "or if(:searchKey is not null and :searchKey!='',t1.user_name like CONCAT('%',:searchKey,'%')  ,1=1)) and " +
+            "if(:beginTime is not null and :beginTime!='',t1.create_time>:beginTime ,1=1)  and if(:endTime is not null and :endTime!='', t1.create_time<:endTime ,1=1)" +
+            "limit :pageNum ,:pageSize ", nativeQuery = true)*/
+    @Query(value = "SELECT t1.* FROM t_intelligent_dialogue t1 INNER JOIN (SELECT MAX(id) AS id FROM t_intelligent_dialogue GROUP BY identifier ) t2 ON t1.id = t2.id " +
+            "where 1=1 and ( if(:searchKey is not null and :searchKey!='',t1.identifier like CONCAT('%',:searchKey,'%')  ,1=1) " +
+            "or if(:searchKey is not null and :searchKey!='',t1.user_name like CONCAT('%',:searchKey,'%')  ,1=1)) ",
+            countQuery = "SELECT t1.* FROM t_intelligent_dialogue t1 INNER JOIN (SELECT MAX(id) AS id FROM t_intelligent_dialogue GROUP BY identifier ) t2 ON t1.id = t2.id " +
+                    "where 1=1 and ( if(:searchKey is not null and :searchKey!='',t1.identifier like CONCAT('%',:searchKey,'%')  ,1=1) " +
+                    "or if(:searchKey is not null and :searchKey!='',t1.user_name like CONCAT('%',:searchKey,'%')  ,1=1)) ", nativeQuery = true)
+    Page<IntelligentDialogueEntity> getIntelligentDialogueList(Pageable pageable, @Param("searchKey") String searchKey);
+
+    List<IntelligentDialogueEntity> findByIdentifier(String identifier);
+
+    @Query(value = "SELECT t1.* FROM t_intelligent_dialogue t1 INNER JOIN (SELECT MAX(id) AS id FROM t_intelligent_dialogue GROUP BY identifier ) t2 ON t1.id = t2.id ", nativeQuery = true)
+    List<IntelligentDialogueEntity> findAllIdentifier();
+}

+ 380 - 0
src/main/java/com/rf/kjb/intelligentDialogue/rest/IntelligentDialogueController.java

@@ -0,0 +1,380 @@
+package com.rf.kjb.intelligentDialogue.rest;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rf.kjb.base.rest.BaseController;
+import com.rf.kjb.chat.rest.ChatController;
+import com.rf.kjb.excel.ExcelUtil;
+import com.rf.kjb.exception.ErrorCode;
+import com.rf.kjb.intelligentDialogue.dao.domain.IntelligentDialogueEntity;
+import com.rf.kjb.intelligentDialogue.service.IntelligentDialogueService;
+import com.rf.kjb.scale.util.DateUtil;
+import com.rf.kjb.utils.Result;
+import com.rf.kjb.utils.ZipUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.stream.Stream;
+
+@Slf4j
+@RestController
+@RequestMapping("/intelligent")
+@Api(tags = "对话")
+public class IntelligentDialogueController extends BaseController {
+
+    @Autowired
+    private IntelligentDialogueService intelligentDialogueService;
+
+
+    @PostMapping("/save")
+    @ApiOperation(value = "保存对话", notes = "identifier:用户编号;userName:用户名;label:对话分类:0-问;1-答;content:对话内容")
+    public Result save(@RequestBody String json) throws IOException {
+        IntelligentDialogueEntity intelligentDialogue = JSONObject.parseObject(json, IntelligentDialogueEntity.class);
+        //保存记录
+        intelligentDialogue.setCreateTime(new Date());
+        this.intelligentDialogueService.save(intelligentDialogue);
+        return success();
+    }
+
+    @GetMapping("/dialogueList")
+    @ApiOperation(value = "智能对话列表", notes = "identifier:编号;beginDate:查询起始日期;endDate:查询结束日期;pageNum:页数;pageSize:每页记录数")
+    public Result getChatList(String identifier, int pageNum, int pageSize) {
+        Page<IntelligentDialogueEntity> intelligentDialogueEntities = this.intelligentDialogueService.find(identifier, pageNum, pageSize);
+        return success(intelligentDialogueEntities);
+    }
+
+
+    @ApiOperation(value = "对话记录下载")
+    @GetMapping("/dialogueRecord/download")
+    public Result chatRecordDownload(String identifier, HttpServletResponse response) throws Exception {
+        if (identifier != null || !identifier.equals("")) {
+            List<IntelligentDialogueEntity> intelligentDialogueEntityList = this.intelligentDialogueService.findByIdentifier(identifier);
+            if (intelligentDialogueEntityList != null && intelligentDialogueEntityList.size() > 0) {
+                String filePath = "./对话记录/" + identifier + "-智能对话记录-" + DateUtil.getNowTime_CN() + ".xlsx";
+                File file = new File(filePath);
+                if (!file.exists()) {
+                    file.createNewFile();
+                }
+                XSSFWorkbook workbook = new XSSFWorkbook();
+                ExcelUtil.createFont(workbook);
+                XSSFSheet sheet = workbook.createSheet("智能对话记录");
+                XSSFRow titleRow = sheet.createRow(0);
+                XSSFCell cellOrder = titleRow.createCell(0);
+                cellOrder.setCellValue("角色");
+                XSSFCell cellQuestion = titleRow.createCell(1);
+                cellQuestion.setCellValue("内容");
+                for (int i = 0; i < intelligentDialogueEntityList.size(); i++) {
+                    XSSFRow row = sheet.createRow(i + 1);
+                    XSSFCell cellOrder1 = row.createCell(0);
+                    if (intelligentDialogueEntityList.get(i).getLabel().equals("0")) {
+                        cellOrder1.setCellValue("智能助手:");
+                    } else {
+                        cellOrder1.setCellValue("用户:");
+                    }
+                    XSSFCell cellQuestion1 = row.createCell(1);
+                    cellQuestion1.setCellValue(intelligentDialogueEntityList.get(i).getContent());
+                }
+                OutputStream outputStream = Files.newOutputStream(file.toPath());
+                workbook.write(outputStream);
+                outputStream.close();
+
+                response.reset();
+                response.setContentType("application/octet-stream");
+                response.setCharacterEncoding("utf-8");
+                response.setContentLength((int) file.length());
+                response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode(file.getName(), "UTF-8"));
+                response.setHeader("filename",java.net.URLEncoder.encode(file.getName(), "UTF-8"));
+                byte[] buffer = new byte[1024];
+                FileInputStream fis = null;
+                BufferedInputStream bis = null;
+                try {
+                    fis = new FileInputStream(file);
+                    bis = new BufferedInputStream(fis);
+                    OutputStream os = response.getOutputStream();
+                    int i = bis.read(buffer);
+                    while (i != -1) {
+                        os.write(buffer, 0, i);
+                        i = bis.read(buffer);
+                    }
+                    return success();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                } finally {
+                    if (bis != null) {
+                        try {
+                            bis.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    if (fis != null) {
+                        try {
+                            fis.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    //删除生成的文件
+                    Files.delete(Paths.get(filePath));
+                }
+            } else {
+                return fail(ErrorCode.FAILED);
+            }
+        }
+        return fail(ErrorCode.FAILED);
+    }
+
+    @SneakyThrows
+    @ApiOperation(value = "智能对话记录批量下载接口")
+    @GetMapping("/dialogueRecord/batchDownload")
+    public Result chatRecordBatchDownload(@RequestParam(value = "identifiers", required = false) List<String> identifiers, HttpServletResponse response) {
+        //原始记录文件
+        File file = null;
+        //原始记录文件路径
+        String primitiveFilePath = "./对话记录/";
+        //原始记录复制后文件
+        File destFile = null;
+        //所有记录汇总后文件夹,用来压缩
+        String filePath ="./对话记录/记录下载";
+        //原始记录文件名
+        String fileName = null;
+        for (int i = 0; i < identifiers.size(); i++) {
+            List<IntelligentDialogueEntity> intelligentDialogueEntityList = this.intelligentDialogueService.findByIdentifier(identifiers.get(i));
+            if (intelligentDialogueEntityList != null && intelligentDialogueEntityList.size() > 0) {
+                fileName = identifiers.get(i) + "-智能对话记录-" + DateUtil.getNowTime_CN() + ".xlsx";
+                file = new File(primitiveFilePath + fileName);
+                if (!file.exists()) {
+                    file.createNewFile();
+                }
+                XSSFWorkbook workbook = new XSSFWorkbook();
+                ExcelUtil.createFont(workbook);
+                XSSFSheet sheet = workbook.createSheet("智能对话记录");
+                XSSFRow titleRow = sheet.createRow(0);
+                XSSFCell cellOrder = titleRow.createCell(0);
+                cellOrder.setCellValue("角色");
+                XSSFCell cellQuestion = titleRow.createCell(1);
+                cellQuestion.setCellValue("内容");
+                for (int y = 0; y < intelligentDialogueEntityList.size(); y++) {
+                    XSSFRow row = sheet.createRow(y + 1);
+                    XSSFCell cellOrder1 = row.createCell(0);
+                    if (intelligentDialogueEntityList.get(y).getLabel().equals("0")) {
+                        cellOrder1.setCellValue("智能助手:");
+                    } else {
+                        cellOrder1.setCellValue("用户:");
+                    }
+                    XSSFCell cellQuestion1 = row.createCell(1);
+                    cellQuestion1.setCellValue(intelligentDialogueEntityList.get(y).getContent());
+                }
+                OutputStream outputStream = Files.newOutputStream(file.toPath());
+                workbook.write(outputStream);
+                outputStream.close();
+            }
+            if (file.exists()){
+                destFile = new File(filePath+"/"+fileName);
+                //将原始文件进行复制
+                org.apache.commons.io.FileUtils.copyFile(file, destFile);
+            }
+            //删除生成的文件
+            Files.delete(Paths.get(primitiveFilePath + fileName));
+        }
+        //将复制后的整个文件夹打包
+        ZipUtils.createZip(filePath, filePath + ".zip", true);
+        File zipFile = new File(filePath + ".zip");
+        //下载压缩后文件
+        if (zipFile.exists()) {
+            response.reset();
+            response.setContentType("application/octet-stream");
+            response.setCharacterEncoding("utf-8");
+            response.setContentLength((int) zipFile.length());
+            response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode("chatRecord.zip", "UTF-8"));
+            response.setHeader("filename",java.net.URLEncoder.encode("chatRecord.zip", "UTF-8"));
+            byte[] buffer = new byte[1024];
+            FileInputStream fis = null;
+            BufferedInputStream bis = null;
+            try {
+                fis = new FileInputStream(zipFile);
+                bis = new BufferedInputStream(fis);
+                OutputStream os = response.getOutputStream();
+                int i = bis.read(buffer);
+                while (i != -1) {
+                    os.write(buffer, 0, i);
+                    i = bis.read(buffer);
+                }
+                return success();
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                if (bis != null) {
+                    try {
+                        bis.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+                if (fis != null) {
+                    try {
+                        fis.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+                //将复制后的整个文件夹删除
+                Path path = Paths.get(filePath);
+                try (Stream<Path> walk = Files.walk(path)) {
+                    walk.sorted(Comparator.reverseOrder())
+                            .forEach(ChatController::deleteDirectoryStream);
+                }
+                //删除生成的压缩包
+                Files.delete(Paths.get(filePath + ".zip"));
+            }
+        }
+        //删除生成的压缩包
+        Files.delete(Paths.get(filePath + ".zip"));
+        //将复制后的整个文件夹删除
+        Path path = Paths.get(filePath);
+        try (Stream<Path> walk = Files.walk(path)) {
+            walk.sorted(Comparator.reverseOrder())
+                    .forEach(ChatController::deleteDirectoryStream);
+        }
+        return fail(ErrorCode.FAILED);
+    }
+
+    @SneakyThrows
+    @ApiOperation(value = "智能对话记录全部下载接口")
+    @GetMapping("/dialogueRecord/AllDownload")
+    public Result chatRecordAllDownload(String identifier, HttpServletResponse response) {
+        List<String> identifiers = new ArrayList<>();
+        if (identifier != null && !identifier.equals("")) {
+            identifiers.add(identifier);
+        }else {
+            List<IntelligentDialogueEntity> intelligentDialogueEntitys = this.intelligentDialogueService.findAllIdentifier();
+            for (IntelligentDialogueEntity intelligentDialogueEntity : intelligentDialogueEntitys) {
+                identifiers.add(intelligentDialogueEntity.getIdentifier());
+            }
+        }
+        //原始记录文件
+        File file = null;
+        //原始记录文件路径
+        String primitiveFilePath = "./对话记录/";
+        //原始记录复制后文件
+        File destFile = null;
+        //所有记录汇总后文件夹,用来压缩
+        String filePath ="./对话记录/记录下载";
+        //原始记录文件名
+        String fileName = null;
+        for (int i = 0; i < identifiers.size(); i++) {
+            List<IntelligentDialogueEntity> intelligentDialogueEntityList = this.intelligentDialogueService.findByIdentifier(identifiers.get(i));
+            if (intelligentDialogueEntityList != null && intelligentDialogueEntityList.size() > 0) {
+                fileName = identifiers.get(i) + "-智能对话记录-" + DateUtil.getNowTime_CN() + ".xlsx";
+                file = new File(primitiveFilePath + fileName);
+                if (!file.exists()) {
+                    file.createNewFile();
+                }
+                XSSFWorkbook workbook = new XSSFWorkbook();
+                ExcelUtil.createFont(workbook);
+                XSSFSheet sheet = workbook.createSheet("智能对话记录");
+                XSSFRow titleRow = sheet.createRow(0);
+                XSSFCell cellOrder = titleRow.createCell(0);
+                cellOrder.setCellValue("角色");
+                XSSFCell cellQuestion = titleRow.createCell(1);
+                cellQuestion.setCellValue("内容");
+                for (int y = 0; y < intelligentDialogueEntityList.size(); y++) {
+                    XSSFRow row = sheet.createRow(y + 1);
+                    XSSFCell cellOrder1 = row.createCell(0);
+                    if (intelligentDialogueEntityList.get(y).getLabel().equals("0")) {
+                        cellOrder1.setCellValue("智能助手:");
+                    } else {
+                        cellOrder1.setCellValue("用户:");
+                    }
+                    XSSFCell cellQuestion1 = row.createCell(1);
+                    cellQuestion1.setCellValue(intelligentDialogueEntityList.get(y).getContent());
+                }
+                OutputStream outputStream = Files.newOutputStream(file.toPath());
+                workbook.write(outputStream);
+                outputStream.close();
+            }
+            if (file.exists()){
+                destFile = new File(filePath+"/"+fileName);
+                //将原始文件进行复制
+                org.apache.commons.io.FileUtils.copyFile(file, destFile);
+            }
+            //删除生成的文件
+            Files.delete(Paths.get(primitiveFilePath + fileName));
+        }
+        //将复制后的整个文件夹打包
+        ZipUtils.createZip(filePath, filePath + ".zip", true);
+        File zipFile = new File(filePath + ".zip");
+        //下载压缩后文件
+        if (zipFile.exists()) {
+            response.reset();
+            response.setContentType("application/octet-stream");
+            response.setCharacterEncoding("utf-8");
+            response.setContentLength((int) zipFile.length());
+            response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode("chatRecord.zip", "UTF-8"));
+            response.setHeader("filename",java.net.URLEncoder.encode("chatRecord.zip", "UTF-8"));
+            byte[] buffer = new byte[1024];
+            FileInputStream fis = null;
+            BufferedInputStream bis = null;
+            try {
+                fis = new FileInputStream(zipFile);
+                bis = new BufferedInputStream(fis);
+                OutputStream os = response.getOutputStream();
+                int i = bis.read(buffer);
+                while (i != -1) {
+                    os.write(buffer, 0, i);
+                    i = bis.read(buffer);
+                }
+                return success();
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                if (bis != null) {
+                    try {
+                        bis.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+                if (fis != null) {
+                    try {
+                        fis.close();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+                //将复制后的整个文件夹删除
+                Path path = Paths.get(filePath);
+                try (Stream<Path> walk = Files.walk(path)) {
+                    walk.sorted(Comparator.reverseOrder())
+                            .forEach(ChatController::deleteDirectoryStream);
+                }
+                //删除生成的压缩包
+                Files.delete(Paths.get(filePath + ".zip"));
+            }
+        }
+        //删除生成的压缩包
+        Files.delete(Paths.get(filePath + ".zip"));
+        //将复制后的整个文件夹删除
+        Path path = Paths.get(filePath);
+        try (Stream<Path> walk = Files.walk(path)) {
+            walk.sorted(Comparator.reverseOrder())
+                    .forEach(ChatController::deleteDirectoryStream);
+        }
+        return fail(ErrorCode.FAILED);
+    }
+
+}

+ 16 - 0
src/main/java/com/rf/kjb/intelligentDialogue/service/IntelligentDialogueService.java

@@ -0,0 +1,16 @@
+package com.rf.kjb.intelligentDialogue.service;
+
+import com.rf.kjb.intelligentDialogue.dao.domain.IntelligentDialogueEntity;
+import org.springframework.data.domain.Page;
+
+import java.util.List;
+
+public interface IntelligentDialogueService {
+    void save(IntelligentDialogueEntity intelligentDialogue);
+
+    Page<IntelligentDialogueEntity> find(String identifier, int pageNum, int pageSize);
+
+    List<IntelligentDialogueEntity> findByIdentifier(String identifier);
+
+    List<IntelligentDialogueEntity> findAllIdentifier();
+}

+ 68 - 0
src/main/java/com/rf/kjb/intelligentDialogue/service/impl/IntelligentDialogueServiceImpl.java

@@ -0,0 +1,68 @@
+package com.rf.kjb.intelligentDialogue.service.impl;
+
+import com.rf.kjb.intelligentDialogue.dao.domain.IntelligentDialogueEntity;
+import com.rf.kjb.intelligentDialogue.dao.repository.IntelligentDialogueRepository;
+import com.rf.kjb.intelligentDialogue.service.IntelligentDialogueService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @Author:zzf
+ * @Date:2023/9/14:15:27
+ * @Description:
+ */
+@Service
+public class IntelligentDialogueServiceImpl implements IntelligentDialogueService {
+    @Autowired
+    private IntelligentDialogueRepository repository;
+    @Override
+    public void save(IntelligentDialogueEntity intelligentDialogue) {
+        repository.save(intelligentDialogue);
+    }
+
+    @Override
+    public Page<IntelligentDialogueEntity> find(String searchKey, int pageNum, int pageSize) {
+        return this.repository.getIntelligentDialogueList(PageRequest.of(pageNum - 1, pageSize), searchKey);
+        /*Specification<IntelligentDialogueEntity> specification = (root, query, cb) -> {
+            List<javax.persistence.criteria.Predicate> predicateList = new ArrayList<>();
+            if(StringUtils.isNotBlank(identifier)){
+                predicateList.add(cb.or(cb.like(root.get("identifier"),"%"+identifier+"%"),cb.like(root.get("userName"),"%"+identifier+"%")));
+            }
+            try {
+                if(StringUtils.isNotBlank(beginDate)){
+                    predicateList.add(cb.greaterThanOrEqualTo(root.get("createTime"),new SimpleDateFormat("yyyy-MM-dd").parse(beginDate)));
+                }
+
+                if(StringUtils.isNotBlank(endDate)){
+                    predicateList.add(cb.lessThanOrEqualTo(root.get("createTime"),new SimpleDateFormat("yyyy-MM-dd").parse(endDate)));
+                }
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            query.where(cb.and(predicateList.toArray(new Predicate[0])));
+            query.orderBy(cb.asc(root.get("createTime")));
+            return query.getRestriction();
+        };
+        if (pageNum <= 0) {
+            pageNum = 1;
+        }
+        if(pageSize <= 0){
+            pageSize = 10;
+        }
+        return this.repository.findAll(specification, PageRequest.of(pageNum-1,pageSize));*/
+    }
+
+    @Override
+    public List<IntelligentDialogueEntity> findByIdentifier(String identifier) {
+        return this.repository.findByIdentifier(identifier);
+    }
+
+    @Override
+    public List<IntelligentDialogueEntity> findAllIdentifier() {
+        return this.repository.findAllIdentifier();
+    }
+}