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

知识库会话历史优化

parent 7c1afae3
......@@ -39,9 +39,9 @@ public class KnowledgeSessionController {
}
@ApiOperation(value = "会话列表")
@GetMapping("/list")
public Result<List<KnowledgeSessionVO>> list() {
return Result.success(knowledgeSessionService.sessionList());
@PostMapping("/list")
public Result<List<KnowledgeSessionVO>> list(@RequestBody KnowledgeSessionDTO knowledgeSessionDTO) {
return Result.success(knowledgeSessionService.sessionList(knowledgeSessionDTO));
}
@ApiOperation(value = "会话详情")
......
......@@ -2,6 +2,7 @@ package org.example.blg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.vo.KnowledgeSessionVO;
......@@ -15,6 +16,6 @@ import java.util.List;
*/
@Mapper
public interface KnowledgeSessionMapper extends BaseMapper<KnowledgeSessionEntity> {
List<KnowledgeSessionVO> sessionList();
List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
......@@ -25,6 +26,13 @@ public class KnowledgeSessionEntity {
@TableField(value = "session_name")
private String sessionName;
@ApiModelProperty("全局/指定")
private String type;
@ApiModelProperty("文档id")
@TableField("document_id")
private String documentId;
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
......
package org.example.blg.service;
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.entity.KnowledgeSessionEntity;
import org.example.blg.pojo.vo.KnowledgeSessionVO;
......@@ -15,7 +16,7 @@ import java.util.List;
*/
public interface KnowledgeSessionService extends IService<KnowledgeSessionEntity> {
List<KnowledgeSessionVO> sessionList();
List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO);
KnowledgeSessionVO detail(String id);
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.entity.KnowledgeSessionDetailEntity;
import org.example.blg.pojo.entity.KnowledgeSessionEntity;
......@@ -29,8 +30,8 @@ public class KnowledgeSessionServiceImpl extends ServiceImpl<KnowledgeSessionMap
private KnowledgeSessionDetailService knowledgeSessionDetailService;
@Override
public List<KnowledgeSessionVO> sessionList() {
return baseMapper.sessionList();
public List<KnowledgeSessionVO> sessionList(KnowledgeSessionDTO knowledgeSessionDTO) {
return baseMapper.sessionList(knowledgeSessionDTO);
}
@Override
......
......@@ -8,11 +8,21 @@
select
id,
session_name,
type,
document_id,
create_time
from
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
create_time
desc
desc
</select>
</mapper>
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