Commit 17073c81 authored by wujipeng's avatar wujipeng
Browse files

知识库会话历史优化

parent 7c1afae3
...@@ -39,9 +39,9 @@ public class KnowledgeSessionController { ...@@ -39,9 +39,9 @@ public class KnowledgeSessionController {
} }
@ApiOperation(value = "会话列表") @ApiOperation(value = "会话列表")
@GetMapping("/list") @PostMapping("/list")
public Result<List<KnowledgeSessionVO>> list() { public Result<List<KnowledgeSessionVO>> list(@RequestBody KnowledgeSessionDTO knowledgeSessionDTO) {
return Result.success(knowledgeSessionService.sessionList()); return Result.success(knowledgeSessionService.sessionList(knowledgeSessionDTO));
} }
@ApiOperation(value = "会话详情") @ApiOperation(value = "会话详情")
......
...@@ -2,6 +2,7 @@ package org.example.blg.mapper; ...@@ -2,6 +2,7 @@ package org.example.blg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.example.blg.pojo.dto.KnowledgeSessionDTO;
import org.example.blg.pojo.entity.KnowledgeSessionEntity; import org.example.blg.pojo.entity.KnowledgeSessionEntity;
import org.example.blg.pojo.vo.KnowledgeSessionVO; import org.example.blg.pojo.vo.KnowledgeSessionVO;
...@@ -15,6 +16,6 @@ import java.util.List; ...@@ -15,6 +16,6 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface KnowledgeSessionMapper extends BaseMapper<KnowledgeSessionEntity> { public interface KnowledgeSessionMapper extends BaseMapper<KnowledgeSessionEntity> {
List<KnowledgeSessionVO> sessionList(); List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO);
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -25,6 +26,13 @@ public class KnowledgeSessionEntity { ...@@ -25,6 +26,13 @@ public class KnowledgeSessionEntity {
@TableField(value = "session_name") @TableField(value = "session_name")
private String sessionName; private String sessionName;
@ApiModelProperty("全局/指定")
private String type;
@ApiModelProperty("文档id")
@TableField("document_id")
private String documentId;
@TableField(value = "create_time") @TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
......
package org.example.blg.service; package org.example.blg.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.example.blg.pojo.dto.KnowledgeSessionDTO;
import org.example.blg.pojo.dto.KnowledgeSessionDetailDTO; import org.example.blg.pojo.dto.KnowledgeSessionDetailDTO;
import org.example.blg.pojo.entity.KnowledgeSessionEntity; import org.example.blg.pojo.entity.KnowledgeSessionEntity;
import org.example.blg.pojo.vo.KnowledgeSessionVO; import org.example.blg.pojo.vo.KnowledgeSessionVO;
...@@ -15,7 +16,7 @@ import java.util.List; ...@@ -15,7 +16,7 @@ import java.util.List;
*/ */
public interface KnowledgeSessionService extends IService<KnowledgeSessionEntity> { public interface KnowledgeSessionService extends IService<KnowledgeSessionEntity> {
List<KnowledgeSessionVO> sessionList(); List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO);
KnowledgeSessionVO detail(String id); KnowledgeSessionVO detail(String id);
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.blg.mapper.KnowledgeSessionMapper; import org.example.blg.mapper.KnowledgeSessionMapper;
import org.example.blg.pojo.dto.KnowledgeSessionDTO;
import org.example.blg.pojo.dto.KnowledgeSessionDetailDTO; import org.example.blg.pojo.dto.KnowledgeSessionDetailDTO;
import org.example.blg.pojo.entity.KnowledgeSessionDetailEntity; import org.example.blg.pojo.entity.KnowledgeSessionDetailEntity;
import org.example.blg.pojo.entity.KnowledgeSessionEntity; import org.example.blg.pojo.entity.KnowledgeSessionEntity;
...@@ -29,8 +30,8 @@ public class KnowledgeSessionServiceImpl extends ServiceImpl<KnowledgeSessionMap ...@@ -29,8 +30,8 @@ public class KnowledgeSessionServiceImpl extends ServiceImpl<KnowledgeSessionMap
private KnowledgeSessionDetailService knowledgeSessionDetailService; private KnowledgeSessionDetailService knowledgeSessionDetailService;
@Override @Override
public List<KnowledgeSessionVO> sessionList() { public List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO) {
return baseMapper.sessionList(); return baseMapper.sessionList(knowledgeSessionDTO);
} }
@Override @Override
......
...@@ -8,9 +8,19 @@ ...@@ -8,9 +8,19 @@
select select
id, id,
session_name, session_name,
type,
document_id,
create_time create_time
from from
knowledge_session knowledge_session
<where>
<if test="type != null and type != ''">
type = #{type}
</if>
<if test="documentId != null and documentId != ''">
and document_id = #{documentId}
</if>
</where>
order by order by
create_time create_time
desc desc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment