Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/resources/application.ymlmain
commit
d05091eaaf
@ -1,2 +0,0 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
@ -0,0 +1,119 @@
|
||||
package com.supervision.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.supervision.config.domain.GlobalResult;
|
||||
import com.supervision.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 统一返回
|
||||
*
|
||||
* @author wb
|
||||
* @date 2022/3/10 13:24
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice(annotations = RestController.class, basePackages = {"com.**.controller"})
|
||||
public class ResponseConfig implements ResponseBodyAdvice<Object> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supports(@Nullable MethodParameter methodParameter,
|
||||
@Nullable Class<? extends HttpMessageConverter<?>> aClass) {
|
||||
assert methodParameter != null;
|
||||
return !methodParameter.getDeclaringClass().getName().contains("swagger");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("all")
|
||||
public Object beforeBodyWrite(Object o, @Nullable MethodParameter methodParameter, @Nullable MediaType mediaType,
|
||||
@Nullable Class<? extends HttpMessageConverter<?>> aClass, @Nullable ServerHttpRequest serverHttpRequest,
|
||||
@Nullable ServerHttpResponse serverHttpResponse) {
|
||||
serverHttpResponse.getHeaders().set("Content-Type", "application/json");
|
||||
|
||||
if (Objects.isNull(o)) {
|
||||
return GlobalResult.ok(null, "success");
|
||||
}
|
||||
if (o instanceof GlobalResult) {
|
||||
return o;
|
||||
}
|
||||
// 对于String类型的返回值需要进行特殊处理
|
||||
if (o instanceof String) {
|
||||
return JSONUtil.toJsonStr(GlobalResult.ok(o, "success"));
|
||||
}
|
||||
return GlobalResult.ok(o, "success");
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常处理
|
||||
*
|
||||
* @param exception 业务异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public GlobalResult<?> businessExceptionResponse(BusinessException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
Integer code = null == exception.getCode() ? HttpStatus.INTERNAL_SERVER_ERROR.value(): exception.getCode();
|
||||
String message = StrUtil.isNotEmpty(exception.getMessage()) ? exception.getMessage() : "业务异常";
|
||||
return GlobalResult.error( code, exception.getMessage(), message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 参数验证异常处理
|
||||
*
|
||||
* @param exception 参数验证异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
|
||||
public GlobalResult<?> validationExceptionResponse(MethodArgumentNotValidException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
// 格式化错误信息
|
||||
String errorMsg = exception.getBindingResult().getFieldErrors().stream()
|
||||
.map(e -> e.getField() + ":" + e.getDefaultMessage()).collect(Collectors.joining("、"));
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMsg, "参数验证异常");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加手动校验参数的异常处理
|
||||
* @param exception 参数验证异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(IllegalArgumentException.class)
|
||||
public GlobalResult<?> manualValidationExceptionResponse(IllegalArgumentException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), exception.getMessage(), "参数验证异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 未知异常处理
|
||||
*
|
||||
* @param exception 未知异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
public GlobalResult<?> validationExceptionResponse(Exception exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "未知错误", "未知错误");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.supervision.config.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@Data
|
||||
@ApiModel
|
||||
public class GlobalResult<T> {
|
||||
|
||||
private int code = 200;
|
||||
|
||||
private String msg = "success";
|
||||
|
||||
@ApiModelProperty
|
||||
private T data;
|
||||
|
||||
|
||||
public static <T> GlobalResult<T> ok() {
|
||||
return ok(null);
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> ok(T data) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setData(data);
|
||||
return globalResult;
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> ok(T data, String message) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setMsg(message);
|
||||
globalResult.setData(data);
|
||||
return globalResult;
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> error(String msg) {
|
||||
return error(HttpStatus.INTERNAL_SERVER_ERROR.value(), null, msg);
|
||||
}
|
||||
|
||||
|
||||
public static <T> GlobalResult<T> error(int code, T data, String msg) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setCode(code);
|
||||
globalResult.setData(data);
|
||||
globalResult.setMsg(msg);
|
||||
return globalResult;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.supervision.config.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserInfo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.supervision.controller;
|
||||
|
||||
import com.supervision.dto.MatchQuestionAnswerDTO;
|
||||
import com.supervision.service.MatchToolService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "相似度匹配工具")
|
||||
@RestController
|
||||
@RequestMapping("matchTool")
|
||||
@RequiredArgsConstructor
|
||||
public class MatchToolController {
|
||||
|
||||
private final MatchToolService matchToolService;
|
||||
|
||||
@ApiOperation("刷新匹配工具知识库")
|
||||
@GetMapping("refreshMatchToolLibrary")
|
||||
public void refreshMatchToolLibrary() {
|
||||
matchToolService.refreshMatchToolLibrary();
|
||||
}
|
||||
|
||||
@ApiOperation("进行问答")
|
||||
@GetMapping("execMatch")
|
||||
public List<MatchQuestionAnswerDTO> execMatch(String question) {
|
||||
return matchToolService.execMatch(question);
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.supervision.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.service.IrSessionService;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "会话管理")
|
||||
@RestController
|
||||
@RequestMapping("session")
|
||||
@RequiredArgsConstructor
|
||||
public class SessionController {
|
||||
|
||||
private final IrSessionService irSessionService;
|
||||
|
||||
@ApiOperation("创建新的会话")
|
||||
@GetMapping("createNewSession")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "caseNumber", value = "案件编号", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "type", value = "播报方式(1语音 2文字)", required = true, dataType = "Integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "speed", value = "播放速度(2位,小数后1位,例如:1.0,0.5,1.5,2.0)", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
public IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed) {
|
||||
return irSessionService.createNewSession(caseNumber, type, speed);
|
||||
}
|
||||
|
||||
@ApiOperation("分页获取会话列表")
|
||||
@GetMapping("querySessionPage")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sessionName", value = "模糊搜索", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "Integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "pageNum", value = "pageNum", required = true, dataType = "Integer", paramType = "query")
|
||||
})
|
||||
public IPage<IrSession> querySessionPage(String sessionName, Integer pageSize, Integer pageNum) {
|
||||
return irSessionService.querySessionPage(sessionName, pageSize, pageNum);
|
||||
}
|
||||
|
||||
@ApiOperation("结束会话")
|
||||
@PostMapping("finishSession")
|
||||
public void finishSession(@RequestBody FinishSessionVO finishSessionVO) {
|
||||
irSessionService.finishSession(finishSessionVO);
|
||||
}
|
||||
|
||||
@ApiOperation("查询会话历史记录列表")
|
||||
@GetMapping("querySessionHistory")
|
||||
public List<IrSessionHistory> querySessionHistory(@NotBlank(message = "会话ID不能为空") String sessionId) {
|
||||
return irSessionService.querySessionHistory(sessionId);
|
||||
}
|
||||
|
||||
@ApiOperation("删除会话记录")
|
||||
@DeleteMapping("deleteSession")
|
||||
public void deleteSession(@NotBlank(message = "会话ID不能为空") String sessionId) {
|
||||
irSessionService.deleteSession(sessionId);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 知识库
|
||||
*
|
||||
* @TableName ir_knowledge
|
||||
*/
|
||||
@TableName(value = "ir_knowledge", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrKnowledge implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 标准问题
|
||||
*/
|
||||
private String standardQuestion;
|
||||
|
||||
/**
|
||||
* 状态(1生效 2部分生效 3未部署)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* SQL模板(使用模板工具)
|
||||
*/
|
||||
private String sqlTemplate;
|
||||
|
||||
/**
|
||||
* 回答模板格式(使用模板工具)
|
||||
*/
|
||||
private String resultTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 相似问法表
|
||||
* @TableName ir_knowledge_similar
|
||||
*/
|
||||
@TableName(value ="ir_knowledge_similar")
|
||||
@Data
|
||||
public class IrKnowledgeSimilar implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 相似问法
|
||||
*/
|
||||
private String similarQuestion;
|
||||
|
||||
/**
|
||||
* 生效状态(1生效 2部分生效 3未部署)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机器人配置
|
||||
* @TableName ir_robot_config
|
||||
*/
|
||||
@TableName(value ="ir_robot_config", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrRobotConfig implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 所属机构名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备状态(1启用 2禁用)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 语速配置
|
||||
*/
|
||||
private BigDecimal talkSpeed;
|
||||
|
||||
/**
|
||||
* 机器人图表
|
||||
*/
|
||||
private String iconBase64;
|
||||
|
||||
/**
|
||||
* 主动话术
|
||||
*/
|
||||
private String activeLanguage;
|
||||
|
||||
/**
|
||||
* 异常话术
|
||||
*/
|
||||
private String errorLanguage;
|
||||
|
||||
/**
|
||||
* 未识别话术1
|
||||
*/
|
||||
private String unrecognizedOne;
|
||||
|
||||
/**
|
||||
* 未识别话术2
|
||||
*/
|
||||
private String unrecognizedTwo;
|
||||
|
||||
/**
|
||||
* 未识别话术3
|
||||
*/
|
||||
private String unrecognizedThree;
|
||||
|
||||
/**
|
||||
* 未识别话术5
|
||||
*/
|
||||
private String unrecognizedFour;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话表
|
||||
* @TableName ir_session
|
||||
*/
|
||||
@TableName(value ="ir_session", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSession implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会话名称,一般以案件号作为会话名称
|
||||
*/
|
||||
private String sessionName;
|
||||
|
||||
/**
|
||||
* 会话状态(1进行中,2已结束)
|
||||
*/
|
||||
private Integer sessionState;
|
||||
|
||||
/**
|
||||
* 会话用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 播放速度(2位,小数后1位,例如:1.5)
|
||||
*/
|
||||
private BigDecimal videoSpeed;
|
||||
|
||||
/**
|
||||
* 播报方式(1语音 2文字)
|
||||
*/
|
||||
private Integer broadcastType;
|
||||
|
||||
/**
|
||||
* 会话评分(1满意 2不满意,3未评估)
|
||||
*/
|
||||
private Integer sessionScore;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话历史记录表
|
||||
* @TableName ir_session_history
|
||||
*/
|
||||
@TableName(value ="ir_session_history", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSessionHistory implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 所属会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 用户问题
|
||||
*/
|
||||
private String userQuestion;
|
||||
|
||||
/**
|
||||
* 用户语音ID(关联语音表ID)
|
||||
*/
|
||||
private String userQuestionVideoId;
|
||||
|
||||
/**
|
||||
* 匹配知识库ID
|
||||
*/
|
||||
private String matchKnowledgeId;
|
||||
|
||||
/**
|
||||
* 提问用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 阈值
|
||||
*/
|
||||
private BigDecimal threshold;
|
||||
|
||||
/**
|
||||
* (原因 1信息错误 2答非所问 3其他),只有不满意时触发
|
||||
*/
|
||||
private Integer scoreCause;
|
||||
|
||||
/**
|
||||
* 应答时间
|
||||
*/
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
/**
|
||||
* 处理状态(1未处理 2已处理)
|
||||
*/
|
||||
private Integer dealState;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话参数
|
||||
* @TableName ir_session_param
|
||||
*/
|
||||
@TableName(value ="ir_session_param", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSessionParam implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String paramName;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String paramValue;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
private String paramType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 问题模板参数
|
||||
* @TableName ir_sql_param
|
||||
*/
|
||||
@TableName(value ="ir_sql_param", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSqlParam implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
private Integer knowledgeId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String paramName;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
private String paramType;
|
||||
|
||||
/**
|
||||
* 是否必填(1必填,2非必填)
|
||||
*/
|
||||
private Integer paramRequire;
|
||||
|
||||
/**
|
||||
* 参数注释
|
||||
*/
|
||||
private String paramDesc;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
*
|
||||
* @TableName ir_user
|
||||
*/
|
||||
@TableName(value = "ir_user", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrUser implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String ps;
|
||||
|
||||
/**
|
||||
* 状态(1启动 2禁用)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 用户角色(1管理员 2普通用户)
|
||||
*/
|
||||
private Integer roleType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MatchQuestionAnswerDTO {
|
||||
|
||||
private String matchQuestion;
|
||||
|
||||
private String matchQuestionCode;
|
||||
|
||||
private Double matchScore;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MatchToolQuestionDTO {
|
||||
|
||||
private String questionId;
|
||||
|
||||
private List<String> questionList;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.supervision.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class QuestionReqDTO {
|
||||
|
||||
private String question;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.supervision.enums;
|
||||
|
||||
public enum SessionParamEnum {
|
||||
|
||||
CASE_NUMBER("CASE_NUMBER", String.class);
|
||||
|
||||
private final String paramName;
|
||||
private final Class<?> paramType;
|
||||
|
||||
SessionParamEnum(String paramName, Class<?> paramType) {
|
||||
this.paramName = paramName;
|
||||
this.paramType = paramType;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public Class<?> getParamType() {
|
||||
return paramType;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 文 件 名: CustomException
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 修 改 人: RedName
|
||||
* 修改时间: 2022/8/5
|
||||
* 跟踪单号: <跟踪单号>
|
||||
* 修改单号: <修改单号>
|
||||
* 修改内容: <修改内容>
|
||||
*/
|
||||
package com.supervision.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
/**
|
||||
* <功能详细描述>
|
||||
* 自定义异常
|
||||
*
|
||||
* @author ljt
|
||||
* @version [版本号, 2022/8/5]
|
||||
* @see [相关类/方法]
|
||||
* @since [产品/模块版本]
|
||||
*/
|
||||
@Slf4j
|
||||
public class BusinessException extends RuntimeException {
|
||||
/**
|
||||
* 异常编码
|
||||
*/
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private final String message;
|
||||
|
||||
public BusinessException(Throwable cause) {
|
||||
super(cause);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = null;
|
||||
|
||||
}
|
||||
|
||||
public BusinessException(Throwable cause, String message) {
|
||||
super(cause);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
|
||||
}
|
||||
|
||||
public BusinessException(String message) {
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BusinessException(String message, Integer code) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public BusinessException(String message, Throwable e) {
|
||||
super(message, e);
|
||||
log.error(message, e);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrKnowledge
|
||||
*/
|
||||
public interface IrKnowledgeMapper extends BaseMapper<IrKnowledge> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrKnowledgeSimilar;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge_similar(相似问法表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 15:27:37
|
||||
* @Entity com.supervision.domain.IrKnowledgeSimilar
|
||||
*/
|
||||
public interface IrKnowledgeSimilarMapper extends BaseMapper<IrKnowledgeSimilar> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrRobotConfig
|
||||
*/
|
||||
public interface IrRobotConfigMapper extends BaseMapper<IrRobotConfig> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSessionHistory
|
||||
*/
|
||||
public interface IrSessionHistoryMapper extends BaseMapper<IrSessionHistory> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSession
|
||||
*/
|
||||
public interface IrSessionMapper extends BaseMapper<IrSession> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSessionParam
|
||||
*/
|
||||
public interface IrSessionParamMapper extends BaseMapper<IrSessionParam> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSqlParam
|
||||
*/
|
||||
public interface IrSqlParamMapper extends BaseMapper<IrSqlParam> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrUser
|
||||
*/
|
||||
public interface IrUserMapper extends BaseMapper<IrUser> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrKnowledgeService extends IService<IrKnowledge> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrKnowledgeSimilar;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge_similar(相似问法表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 15:27:37
|
||||
*/
|
||||
public interface IrKnowledgeSimilarService extends IService<IrKnowledgeSimilar> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrRobotConfigService extends IService<IrRobotConfig> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionHistoryService extends IService<IrSessionHistory> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionParamService extends IService<IrSessionParam> {
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionService extends IService<IrSession> {
|
||||
|
||||
IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed);
|
||||
|
||||
IPage<IrSession> querySessionPage(String sessionName,Integer pageSize, Integer pageNum);
|
||||
|
||||
void finishSession(FinishSessionVO finishSessionVO);
|
||||
|
||||
List<IrSessionHistory> querySessionHistory(String sessionId);
|
||||
|
||||
void deleteSession(String sessionId);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSqlParamService extends IService<IrSqlParam> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrUserService extends IService<IrUser> {
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.dto.MatchQuestionAnswerDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MatchToolService {
|
||||
|
||||
void refreshMatchToolLibrary();
|
||||
|
||||
List<MatchQuestionAnswerDTO> execMatch(String question);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.supervision.service.IrKnowledgeService;
|
||||
import com.supervision.mapper.IrKnowledgeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrKnowledgeServiceImpl extends ServiceImpl<IrKnowledgeMapper, IrKnowledge>
|
||||
implements IrKnowledgeService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrKnowledgeSimilar;
|
||||
import com.supervision.service.IrKnowledgeSimilarService;
|
||||
import com.supervision.mapper.IrKnowledgeSimilarMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge_similar(相似问法表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 15:27:37
|
||||
*/
|
||||
@Service
|
||||
public class IrKnowledgeSimilarServiceImpl extends ServiceImpl<IrKnowledgeSimilarMapper, IrKnowledgeSimilar>
|
||||
implements IrKnowledgeSimilarService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.supervision.service.IrRobotConfigService;
|
||||
import com.supervision.mapper.IrRobotConfigMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrRobotConfigServiceImpl extends ServiceImpl<IrRobotConfigMapper, IrRobotConfig>
|
||||
implements IrRobotConfigService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.service.IrSessionHistoryService;
|
||||
import com.supervision.mapper.IrSessionHistoryMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSessionHistoryServiceImpl extends ServiceImpl<IrSessionHistoryMapper, IrSessionHistory>
|
||||
implements IrSessionHistoryService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.supervision.service.IrSessionParamService;
|
||||
import com.supervision.mapper.IrSessionParamMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSessionParamServiceImpl extends ServiceImpl<IrSessionParamMapper, IrSessionParam>
|
||||
implements IrSessionParamService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.config.domain.UserInfo;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.supervision.exception.BusinessException;
|
||||
import com.supervision.service.IrSessionHistoryService;
|
||||
import com.supervision.service.IrSessionService;
|
||||
import com.supervision.mapper.IrSessionMapper;
|
||||
import com.supervision.util.UserUtil;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IrSessionServiceImpl extends ServiceImpl<IrSessionMapper, IrSession>
|
||||
implements IrSessionService {
|
||||
|
||||
private final IrSessionHistoryService irSessionHistoryService;
|
||||
|
||||
@Override
|
||||
public IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed) {
|
||||
UserInfo user = UserUtil.getUser();
|
||||
IrSession irSession = new IrSession();
|
||||
irSession.setSessionName("案件编号:" + caseNumber);
|
||||
irSession.setSessionState(1);
|
||||
irSession.setUserId(user.getId());
|
||||
irSession.setVideoSpeed(speed);
|
||||
irSession.setBroadcastType(type);
|
||||
this.save(irSession);
|
||||
return irSession;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<IrSession> querySessionPage(String sessionName, Integer pageSize, Integer pageNum) {
|
||||
UserInfo user = UserUtil.getUser();
|
||||
return this.lambdaQuery().like(StrUtil.isNotBlank(sessionName), IrSession::getSessionName, sessionName).eq(IrSession::getUserId, user.getId()).page(new Page<>(pageNum, pageSize));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishSession(FinishSessionVO finishSessionVO) {
|
||||
IrSession irSession = Optional.ofNullable(this.getById(finishSessionVO.getSessionId())).orElseThrow(() -> new BusinessException("未找到的会话"));
|
||||
if (irSession.getSessionState() == 2) {
|
||||
throw new BusinessException("会话已结束");
|
||||
}
|
||||
// 更新会话
|
||||
irSession.setSessionState(2);
|
||||
if (ObjUtil.isNotEmpty(finishSessionVO.getSessionScore())) {
|
||||
irSession.setSessionScore(finishSessionVO.getSessionScore());
|
||||
}
|
||||
this.updateById(irSession);
|
||||
// 更新会话历史
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getIrrelevantAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 2).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getIrrelevantAnswerHistoryId()).update();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getErrorAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 1).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getErrorAnswerHistoryId()).update();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getOtherAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 2).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getOtherAnswerHistoryId()).update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IrSessionHistory> querySessionHistory(String sessionId) {
|
||||
return irSessionHistoryService.lambdaQuery().eq(IrSessionHistory::getSessionId, sessionId).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSession(String sessionId) {
|
||||
this.removeById(sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.supervision.service.IrSqlParamService;
|
||||
import com.supervision.mapper.IrSqlParamMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSqlParamServiceImpl extends ServiceImpl<IrSqlParamMapper, IrSqlParam>
|
||||
implements IrSqlParamService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.supervision.service.IrUserService;
|
||||
import com.supervision.mapper.IrUserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrUserServiceImpl extends ServiceImpl<IrUserMapper, IrUser>
|
||||
implements IrUserService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,103 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.supervision.config.domain.GlobalResult;
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.supervision.domain.IrKnowledgeSimilar;
|
||||
import com.supervision.dto.MatchQuestionAnswerDTO;
|
||||
import com.supervision.dto.MatchToolQuestionDTO;
|
||||
import com.supervision.dto.QuestionReqDTO;
|
||||
import com.supervision.exception.BusinessException;
|
||||
import com.supervision.service.IrKnowledgeService;
|
||||
import com.supervision.service.IrKnowledgeSimilarService;
|
||||
import com.supervision.service.MatchToolService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MatchToolServiceImpl implements MatchToolService {
|
||||
|
||||
private final IrKnowledgeService irKnowledgeService;
|
||||
|
||||
private final IrKnowledgeSimilarService irKnowledgeSimilarService;
|
||||
|
||||
@Value("${matchTool.url}")
|
||||
private String matchToolUrl;
|
||||
|
||||
@Override
|
||||
public void refreshMatchToolLibrary() {
|
||||
// 获取所有的问题
|
||||
List<IrKnowledge> knowledgeList = irKnowledgeService.list();
|
||||
// 获取相似问题
|
||||
List<IrKnowledgeSimilar> similarList = irKnowledgeSimilarService.list();
|
||||
Map<String, List<IrKnowledgeSimilar>> similarKnowledgeMap = similarList.stream().collect(Collectors.groupingBy(IrKnowledgeSimilar::getKnowledgeId));
|
||||
Map<String, List<String>> questionLibrary = knowledgeList.stream().collect(Collectors.toMap(IrKnowledge::getId, e -> CollUtil.newArrayList(e.getStandardQuestion())));
|
||||
List<MatchToolQuestionDTO> matchToolQuestionDTOList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, List<String>> entry : questionLibrary.entrySet()) {
|
||||
String questionId = entry.getKey();
|
||||
List<IrKnowledgeSimilar> similarKnowledgeList = similarKnowledgeMap.get(questionId);
|
||||
if (CollUtil.isNotEmpty(similarKnowledgeList)) {
|
||||
Set<String> similarQuestionSet = similarKnowledgeList.stream().map(IrKnowledgeSimilar::getSimilarQuestion).collect(Collectors.toSet());
|
||||
entry.getValue().addAll(similarQuestionSet);
|
||||
}
|
||||
MatchToolQuestionDTO matchToolQuestionDTO = new MatchToolQuestionDTO();
|
||||
matchToolQuestionDTO.setQuestionId(questionId);
|
||||
matchToolQuestionDTO.setQuestionList(entry.getValue());
|
||||
matchToolQuestionDTOList.add(matchToolQuestionDTO);
|
||||
}
|
||||
// 调用tool服务进行更新操作
|
||||
submitRefresh(matchToolQuestionDTOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MatchQuestionAnswerDTO> execMatch(String question) {
|
||||
log.info("开始调用talkQaSimilarity,问题:{}", question);
|
||||
try {
|
||||
String post = HttpUtil.post(matchToolUrl + "/matchQuestion", JSONUtil.toJsonStr(new QuestionReqDTO(question)));
|
||||
log.info("相似度匹配答案:{}", post);
|
||||
TypeReference<GlobalResult<List<MatchQuestionAnswerDTO>>> globalResultTypeReference = new TypeReference<GlobalResult<List<MatchQuestionAnswerDTO>>>() {
|
||||
};
|
||||
GlobalResult<List<MatchQuestionAnswerDTO>> result = JSONUtil.toBean(post, globalResultTypeReference.getType(), true);
|
||||
if (result.getCode() != 200) {
|
||||
throw new BusinessException("匹配失败");
|
||||
}
|
||||
|
||||
return result.getData();
|
||||
} catch (Exception e) {
|
||||
log.error("调用talkQaSimilarity error ", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void submitRefresh(List<MatchToolQuestionDTO> matchToolQuestionDTOList) {
|
||||
log.info("开始调用matchTool服务进行更新操作");
|
||||
try {
|
||||
String post = HttpUtil.post(matchToolUrl + "/updateDatabase", JSONUtil.toJsonStr(matchToolQuestionDTOList));
|
||||
log.info(post);
|
||||
if (!JSONUtil.isTypeJSON(post)) {
|
||||
throw new BusinessException("更新失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("调用matchTool服务更新失败", e);
|
||||
throw new BusinessException("更新失败");
|
||||
}
|
||||
log.info("成功调用matchTool服务更新数据库");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.supervision.util;
|
||||
|
||||
import com.supervision.config.domain.UserInfo;
|
||||
|
||||
public class UserUtil {
|
||||
|
||||
public static UserInfo getUser(){
|
||||
// String userStr = ThreadCache.USER.get();
|
||||
// User bean = JSONUtil.toBean(userStr, User.class);
|
||||
// if (ObjectUtil.isEmpty(bean)){
|
||||
// throw new BusinessException("未获取到用户信息");
|
||||
// }
|
||||
// return bean;
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId("1");
|
||||
userInfo.setName("张警官");
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.supervision.vo.session;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FinishSessionVO {
|
||||
|
||||
@ApiModelProperty("会话ID")
|
||||
private String sessionId;
|
||||
|
||||
@ApiModelProperty("会话评分(1满意 2不满意,3未评估)")
|
||||
private Integer sessionScore;
|
||||
|
||||
@ApiModelProperty("答非所问historyId")
|
||||
private List<String> irrelevantAnswerHistoryId;
|
||||
|
||||
@ApiModelProperty("信息错误historyId")
|
||||
private List<String> errorAnswerHistoryId;
|
||||
|
||||
@ApiModelProperty("其他historyId")
|
||||
private List<String> otherAnswerHistoryId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.supervision.vo.session;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel
|
||||
public class talkHistoryVO {
|
||||
|
||||
private String historyId;
|
||||
|
||||
private String question;
|
||||
|
||||
private String answer;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrKnowledgeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrKnowledge">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="questionCode" column="question_code" jdbcType="INTEGER"/>
|
||||
<result property="standardQuestion" column="standard_question" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="sqlTemplate" column="sql_template" jdbcType="VARCHAR"/>
|
||||
<result property="resultTemplate" column="result_template" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,question_code,standard_question,
|
||||
state,sql_template,result_template,
|
||||
create_user_id,create_time,update_user_id,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrKnowledgeSimilarMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrKnowledgeSimilar">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="knowledgeId" column="knowledge_id" jdbcType="VARCHAR"/>
|
||||
<result property="similarQuestion" column="similar_question" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,knowledge_id,similar_question,
|
||||
state,create_user_id,create_time,
|
||||
update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrRobotConfigMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrRobotConfig">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="deviceName" column="device_name" jdbcType="VARCHAR"/>
|
||||
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
|
||||
<result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="talkSpeed" column="talk_speed" jdbcType="NUMERIC"/>
|
||||
<result property="iconBase64" column="icon_base64" jdbcType="VARCHAR"/>
|
||||
<result property="activeLanguage" column="active_language" jdbcType="VARCHAR"/>
|
||||
<result property="errorLanguage" column="error_language" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedOne" column="unrecognized_one" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedTwo" column="unrecognized_two" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedThree" column="unrecognized_three" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedFour" column="unrecognized_four" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,device_name,dept_name,
|
||||
device_code,state,talk_speed,
|
||||
icon_base64,active_language,error_language,
|
||||
unrecognized_one,unrecognized_two,unrecognized_three,
|
||||
unrecognized_four,create_user_id,create_time,
|
||||
update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrSessionHistoryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSessionHistory">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionId" column="session_id" jdbcType="VARCHAR"/>
|
||||
<result property="userQuestion" column="user_question" jdbcType="VARCHAR"/>
|
||||
<result property="userQuestionVideoId" column="user_question_video_id" jdbcType="VARCHAR"/>
|
||||
<result property="matchKnowledgeId" column="match_knowledge_id" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="threshold" column="threshold" jdbcType="NUMERIC"/>
|
||||
<result property="score" column="score" jdbcType="INTEGER"/>
|
||||
<result property="scoreCause" column="score_cause" jdbcType="INTEGER"/>
|
||||
<result property="answerTime" column="answer_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="dealState" column="deal_state" jdbcType="INTEGER"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_id,user_question,
|
||||
user_question_video_id,match_knowledge_id,user_id,
|
||||
threshold,score,score_cause,
|
||||
answer_time,deal_state,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrSessionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSession">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionState" column="session_state" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="videoSpeed" column="video_speed" jdbcType="NUMERIC"/>
|
||||
<result property="broadcastType" column="broadcast_type" jdbcType="INTEGER"/>
|
||||
<result property="sessionScore" column="session_score" jdbcType="INTEGER"/>
|
||||
<result property="scoreCause" column="score_cause" jdbcType="INTEGER"/>
|
||||
<result property="scoreExplain" column="score_explain" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_state,user_id,
|
||||
video_speed,broadcast_type,session_score,
|
||||
score_cause,score_explain,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrSessionParamMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSessionParam">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionId" column="session_id" jdbcType="VARCHAR"/>
|
||||
<result property="paramName" column="param_name" jdbcType="VARCHAR"/>
|
||||
<result property="paramValue" column="param_value" jdbcType="VARCHAR"/>
|
||||
<result property="paramType" column="param_type" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_id,param_name,
|
||||
param_value,param_type,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrSqlParamMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSqlParam">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="knowledgeId" column="knowledge_id" jdbcType="INTEGER"/>
|
||||
<result property="paramName" column="param_name" jdbcType="VARCHAR"/>
|
||||
<result property="paramType" column="param_type" jdbcType="VARCHAR"/>
|
||||
<result property="paramRequire" column="param_require" jdbcType="INTEGER"/>
|
||||
<result property="paramDesc" column="param_desc" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,knowledge_id,param_name,
|
||||
param_type,param_require,param_desc,
|
||||
create_user_id,create_time,update_user_id,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.supervision.mapper.IrUserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrUser">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="userAccount" column="user_account" jdbcType="VARCHAR"/>
|
||||
<result property="realName" column="real_name" jdbcType="VARCHAR"/>
|
||||
<result property="ps" column="ps" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="roleType" column="role_type" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_account,real_name,
|
||||
ps,create_user_id,create_time,
|
||||
update_user_id,update_time,state,
|
||||
role_type
|
||||
</sql>
|
||||
</mapper>
|
@ -1,15 +1,26 @@
|
||||
package com.supervision;
|
||||
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.supervision.domain.IrKnowledgeSimilar;
|
||||
import com.supervision.service.IrKnowledgeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@MapperScan(basePackages = {"com.supervision.**.mapper"})
|
||||
@SpringBootTest
|
||||
@Slf4j
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@RequiredArgsConstructor
|
||||
class AskApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
@Autowired
|
||||
private IrKnowledgeService irKnowledgeService;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue